Move ???PORT() macro definitions back to rig.h

Many (most?) of the uses of the port structures in Hamlib are to pass through
  to the basic I/O routines (rig_flush(), write_block(), read_string()),
  without referencing any of the structure data.  Don't bother including
  port.h if it won't be used.

The ???PORT macros are independent of actual hamlib_port_t data use.
pull/1802/head
George Baltz N3GB 2025-07-07 20:24:48 -04:00
rodzic 80cfadadb0
commit f3e9a859ed
20 zmienionych plików z 12 dodań i 29 usunięć

Wyświetl plik

@ -28,7 +28,6 @@
#include "register.h"
#include "kpa.h"
#include "hamlib/port.h"
struct kpa_priv_data *kpa1500_priv;

Wyświetl plik

@ -28,7 +28,6 @@
#include "register.h"
#include "gemini.h"
#include "hamlib/port.h"
struct gemini_priv_data *gemini_priv;
/*

Wyświetl plik

@ -178,15 +178,7 @@ typedef hamlib_port_t_deprecated port_t_deprecated;
typedef hamlib_port_t port_t;
#endif
#if defined(IN_HAMLIB)
/* These are for internal use only */
#define RIGPORT(r) (&(r)->state.rigport)
#define PTTPORT(r) (&(r)->state.pttport)
#define DCDPORT(r) (&(r)->state.dcdport)
#define AMPPORT(a) (&(a)->state.ampport)
#define ROTPORT(r) (&(r)->state.rotport)
#define ROTPORT2(r) (&(r)->state.rotport2)
#endif
// Macros for app access to hamlib_port_t data
#define HAMLIB_RIGPORT(r) ((hamlib_port_t *)rig_data_pointer((r), RIG_PTRX_RIGPORT))
#define HAMLIB_PTTPORT(r) ((hamlib_port_t *)rig_data_pointer((r), RIG_PTRX_PTTPORT))
#define HAMLIB_DCDPORT(r) ((hamlib_port_t *)rig_data_pointer((r), RIG_PTRX_DCDPORT))

Wyświetl plik

@ -2385,13 +2385,13 @@ __BEGIN_DECLS
// Note: Experimental, and subject to change!!
#if defined(IN_HAMLIB)
/* These are for internal use only */
//Moved to include/hamlib/port.h #define RIGPORT(r) (&r->state.rigport)
// " " " #define PTTPORT(r) (&r->state.pttport)
// " " " #define DCDPORT(r) (&r->state.dcdport)
#define RIGPORT(r) (&(r)->state.rigport)
#define PTTPORT(r) (&(r)->state.pttport)
#define DCDPORT(r) (&(r)->state.dcdport)
//Moved to src/cache.h #define CACHE(r) ((r)->cache_addr)
//Moved to include/hamlib/port.h #define AMPPORT(a) (&a->state.ampport)
// " " " #define ROTPORT(r) (&r->state.rotport)
// " " " #define ROTPORT2(r) (&r->state.rotport2)
#define AMPPORT(a) (&(a)->state.ampport)
#define ROTPORT(r) (&(r)->state.rotport)
#define ROTPORT2(r) (&(r)->state.rotport2)
//Moved to include/hamlib/rig_state.h #define STATE(r) (&r->state)
//Moved to include/hamlib/amp_state.h #define AMPSTATE(a) (&(a)->state)
//Moved to include/hamlib/rot_state.h #define ROTSTATE(r) (&(r)->state)

Wyświetl plik

@ -27,7 +27,6 @@
#endif
#include <hamlib/rotator.h>
#include "hamlib/port.h"
#include "hamlib/rot_state.h"
#include "parallel.h"
#include "register.h"

Wyświetl plik

@ -1,5 +1,4 @@
#include <hamlib/rotator.h>
#include "hamlib/port.h"
#include <pthread.h>
#include "iofunc.h"
#include "register.h"

Wyświetl plik

@ -2,7 +2,6 @@
#include <math.h>
#include "hamlib/rotator.h"
#include "hamlib/port.h"
#include "iofunc.h"
#include "apex.h"

Wyświetl plik

@ -32,7 +32,6 @@
#endif
#include "hamlib/rotator.h"
#include "hamlib/port.h"
#include "hamlib/rot_state.h"
#include "parallel.h"
#include "misc.h"

Wyświetl plik

@ -26,7 +26,6 @@
#include <string.h> /* String function definitions */
#include "hamlib/rotator.h"
#include "hamlib/port.h"
#include "hamlib/rot_state.h"
#include "serial.h"
#include "register.h"

Wyświetl plik

@ -25,7 +25,6 @@
#include <string.h> /* String function definitions */
#include <hamlib/rotator.h>
#include "hamlib/port.h"
#include "hamlib/rot_state.h"
#include "serial.h"
#include "register.h"

Wyświetl plik

@ -32,7 +32,6 @@
#endif
#include "hamlib/rotator.h"
#include "hamlib/port.h"
#include "hamlib/rot_state.h"
#include "parallel.h"
#include "misc.h"

Wyświetl plik

@ -24,7 +24,6 @@
#include <stddef.h>
#include "hamlib/rotator.h"
#include "hamlib/port.h"
#include "serial.h"
#include "register.h"

Wyświetl plik

@ -26,7 +26,6 @@
#include <string.h> /* String function definitions */
#include "hamlib/rotator.h"
#include "hamlib/port.h"
#include "serial.h"
#include "misc.h"
#include "register.h"

Wyświetl plik

@ -29,7 +29,6 @@
#include <string.h> /* String function definitions */
#include "hamlib/rotator.h"
#include "hamlib/port.h"
#include "serial.h"
#include "register.h"

Wyświetl plik

@ -28,7 +28,6 @@
#include <stdbool.h>
#include "hamlib/rotator.h"
#include "hamlib/port.h"
#include "serial.h"
#include "register.h"

Wyświetl plik

@ -27,6 +27,7 @@
#include <fcntl.h>
#include "gpio.h"
#include "hamlib/port.h"
int gpio_open(hamlib_port_t *port, int output, int on_value)

Wyświetl plik

@ -42,7 +42,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <hamlib/rig.h>
#include "hamlib/port.h"
#include "iofunc.h"
#include "misc.h"

Wyświetl plik

@ -74,6 +74,7 @@
#endif
#include <hamlib/rig.h>
#include "hamlib/port.h"
#include "hamlib/rig_state.h"
#include "network.h"
#include "misc.h"

Wyświetl plik

@ -58,6 +58,7 @@
# include <winbase.h>
#endif
#include "hamlib/port.h"
#include "parallel.h"
#ifdef HAVE_LINUX_PPDEV_H

Wyświetl plik

@ -40,6 +40,7 @@
#include <sys/types.h>
#include <hamlib/rig.h>
#include "hamlib/port.h"
#ifdef HAVE_LIBUSB_H
# include <libusb.h>