Skip to content

Instantly share code, notes, and snippets.

@relrod
Created August 12, 2014 17:02
Show Gist options
  • Save relrod/c6f275bddf8ae3dc07f5 to your computer and use it in GitHub Desktop.
Save relrod/c6f275bddf8ae3dc07f5 to your computer and use it in GitHub Desktop.
ricky@monadic /tmp$ diff -u ./usr/include/hamlib/rig.h /usr/include/hamlib/rig.h | colordiff
--- ./usr/include/hamlib/rig.h 2014-08-12 13:00:57.554398449 -0400
+++ /usr/include/hamlib/rig.h 2014-08-12 12:55:35.683637690 -0400
@@ -536,13 +536,13 @@
const char *tooltip; /*!< Hint on the parameter */
const char *dflt; /*!< Default value */
enum rig_conf_e type; /*!< Type of the parameter */
- union { /*!< */
- struct { /*!< */
+ union u { /*!< */
+ struct n { /*!< */
float min; /*!< Minimum value */
float max; /*!< Maximum value */
float step; /*!< Step */
} n; /*!< Numeric type */
- struct { /*!< */
+ struct c { /*!< */
const char *combostr[RIG_COMBO_MAX]; /*!< Combo list */
} c; /*!< Combo type */
} u; /*!< Type union */
@@ -1071,7 +1071,7 @@
/** \brief Calibration table struct */
struct cal_table {
int size; /*!< number of plots in the table */
- struct {
+ struct table {
int raw; /*!< raw (A/D) value, as returned by \a RIG_LEVEL_RAWSTR */
int val; /*!< associated value, basically the measured dB value */
} table[MAX_CAL_LENGTH]; /*!< table of plots */
@@ -1325,8 +1325,8 @@
*
* Of course, looks like OO painstakingly programmed in C, sigh.
*/
-typedef struct {
- union {
+typedef struct hamlib_port_t {
+ union type {
rig_port_t rig; /*!< Communication port type */
ptt_type_t ptt; /*!< PTT port type */
dcd_type_t dcd; /*!< DCD port type */
@@ -1336,13 +1336,13 @@
int write_delay; /*!< Delay between each byte sent out, in mS */
int post_write_delay; /*!< Delay between each commands send out, in mS */
- struct { int tv_sec,tv_usec; } post_write_date; /*!< hamlib internal use */
+ struct post_write_date { int tv_sec,tv_usec; } post_write_date; /*!< hamlib internal use */
int timeout; /*!< Timeout, in mS */
int retry; /*!< Maximum number of retries, 0 to disable */
char pathname[FILPATHLEN]; /*!< Port pathname */
- union {
- struct {
+ union parm {
+ struct serial {
int rate; /*!< Serial baud rate */
int data_bits; /*!< Number of data bits */
int stop_bits; /*!< Number of stop bits */
@@ -1351,13 +1351,13 @@
enum serial_control_state_e rts_state; /*!< RTS set state */
enum serial_control_state_e dtr_state; /*!< DTR set state */
} serial; /*!< serial attributes */
- struct {
+ struct parallel {
int pin; /*!< Parallel port pin number */
} parallel; /*!< parallel attributes */
- struct {
+ struct cm108 {
int ptt_bitnum; /*< Bit number for CM108 GPIO PTT */
} cm108; /*!< CM108 attributes */
- struct {
+ struct usb {
int vid; /*!< Vendor ID */
int pid; /*!< Product ID */
int conf; /*!< Configuration */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment