Skip to content

Commit

Permalink
Change token_t to hamlib_token_t to avoid collsions with libbsm and o…
Browse files Browse the repository at this point in the history
…thers

#1469
  • Loading branch information
mdblack98 committed Jan 22, 2024
1 parent 67aee82 commit 0503317
Show file tree
Hide file tree
Showing 82 changed files with 333 additions and 333 deletions.
6 changes: 3 additions & 3 deletions c++/ampclass.cc
Expand Up @@ -65,7 +65,7 @@ void Amplifier::close(void) {
CHECK_AMP( amp_close(theAmp) );
}

void Amplifier::setConf(token_t token, const char *val)
void Amplifier::setConf(hamlib_token_t token, const char *val)
{
CHECK_AMP( amp_set_conf(theAmp, token, val) );
}
Expand All @@ -74,7 +74,7 @@ void Amplifier::setConf(const char *name, const char *val)
CHECK_AMP( amp_set_conf(theAmp, tokenLookup(name), val) );
}

void Amplifier::getConf(token_t token, char *val)
void Amplifier::getConf(hamlib_token_t token, char *val)
{
CHECK_AMP( amp_get_conf(theAmp, token, val) );
}
Expand All @@ -83,7 +83,7 @@ void Amplifier::getConf(const char *name, char *val)
CHECK_AMP( amp_get_conf(theAmp, tokenLookup(name), val) );
}

token_t Amplifier::tokenLookup(const char *name)
hamlib_token_t Amplifier::tokenLookup(const char *name)
{
return amp_token_lookup(theAmp, name);
}
Expand Down
6 changes: 3 additions & 3 deletions c++/rigclass.cc
Expand Up @@ -76,7 +76,7 @@ void Rig::close(void) {
CHECK_RIG( rig_close(theRig) );
}

void Rig::setConf(token_t token, const char *val)
void Rig::setConf(hamlib_token_t token, const char *val)
{
CHECK_RIG( rig_set_conf(theRig, token, val) );
}
Expand All @@ -85,7 +85,7 @@ void Rig::setConf(const char *name, const char *val)
CHECK_RIG( rig_set_conf(theRig, tokenLookup(name), val) );
}

void Rig::getConf(token_t token, char *val)
void Rig::getConf(hamlib_token_t token, char *val)
{
CHECK_RIG( rig_get_conf(theRig, token, val) );
}
Expand All @@ -94,7 +94,7 @@ void Rig::getConf(const char *name, char *val)
CHECK_RIG( rig_get_conf(theRig, tokenLookup(name), val) );
}

token_t Rig::tokenLookup(const char *name)
hamlib_token_t Rig::tokenLookup(const char *name)
{
return rig_token_lookup(theRig, name);
}
Expand Down
6 changes: 3 additions & 3 deletions c++/rotclass.cc
Expand Up @@ -64,7 +64,7 @@ void Rotator::close(void) {
CHECK_ROT( rot_close(theRot) );
}

void Rotator::setConf(token_t token, const char *val)
void Rotator::setConf(hamlib_token_t token, const char *val)
{
CHECK_ROT( rot_set_conf(theRot, token, val) );
}
Expand All @@ -73,7 +73,7 @@ void Rotator::setConf(const char *name, const char *val)
CHECK_ROT( rot_set_conf(theRot, tokenLookup(name), val) );
}

void Rotator::getConf(token_t token, char *val)
void Rotator::getConf(hamlib_token_t token, char *val)
{
CHECK_ROT( rot_get_conf(theRot, token, val) );
}
Expand All @@ -82,7 +82,7 @@ void Rotator::getConf(const char *name, char *val)
CHECK_ROT( rot_get_conf(theRot, tokenLookup(name), val) );
}

token_t Rotator::tokenLookup(const char *name)
hamlib_token_t Rotator::tokenLookup(const char *name)
{
return rot_token_lookup(theRot, name);
}
Expand Down
6 changes: 3 additions & 3 deletions include/hamlib/ampclass.h
Expand Up @@ -53,11 +53,11 @@ class HAMLIB_CPP_IMPEXP Amplifier
// This method closes the communication port to the amp
void close(void);

void setConf(token_t token, const char *val);
void setConf(hamlib_token_t token, const char *val);
void setConf(const char *name, const char *val);
void getConf(token_t token, char *val);
void getConf(hamlib_token_t token, char *val);
void getConf(const char *name, char *val);
token_t tokenLookup(const char *name);
hamlib_token_t tokenLookup(const char *name);

void setFreq(freq_t freq);
freq_t getFreq();
Expand Down
20 changes: 10 additions & 10 deletions include/hamlib/amplifier.h
Expand Up @@ -233,9 +233,9 @@ struct amp_caps
int (*set_freq)(AMP *amp, freq_t val); /*!< Pointer to backend implementation of ::amp_set_freq(). */
int (*get_freq)(AMP *amp, freq_t *val); /*!< Pointer to backend implementation of ::amp_get_freq(). */

int (*set_conf)(AMP *amp, token_t token, const char *val); /*!< Pointer to backend implementation of ::amp_set_conf(). */
int (*get_conf2)(AMP *amp, token_t token, char *val, int val_len); /*!< Pointer to backend implementation of ::amp_get_conf(). */
int (*get_conf)(AMP *amp, token_t token, char *val); /*!< Pointer to backend implementation of ::amp_get_conf(). */
int (*set_conf)(AMP *amp, hamlib_token_t token, const char *val); /*!< Pointer to backend implementation of ::amp_set_conf(). */
int (*get_conf2)(AMP *amp, hamlib_token_t token, char *val, int val_len); /*!< Pointer to backend implementation of ::amp_get_conf(). */
int (*get_conf)(AMP *amp, hamlib_token_t token, char *val); /*!< Pointer to backend implementation of ::amp_get_conf(). */

/*
* General API commands, from most primitive to least.. :()
Expand All @@ -245,8 +245,8 @@ struct amp_caps
int (*reset)(AMP *amp, amp_reset_t reset); /*!< Pointer to backend implementation of ::amp_reset(). */
int (*get_level)(AMP *amp, setting_t level, value_t *val); /*!< Pointer to backend implementation of ::amp_get_level(). */
int (*set_level)(AMP *amp, setting_t level, value_t val); /*!< Pointer to backend implementation of ::amp_get_level(). */
int (*get_ext_level)(AMP *amp, token_t level, value_t *val); /*!< Pointer to backend implementation of ::amp_get_ext_level(). */
int (*set_ext_level)(AMP *amp, token_t level, value_t val); /*!< Pointer to backend implementation of ::amp_set_ext_level(). */
int (*get_ext_level)(AMP *amp, hamlib_token_t level, value_t *val); /*!< Pointer to backend implementation of ::amp_get_ext_level(). */
int (*set_ext_level)(AMP *amp, hamlib_token_t level, value_t val); /*!< Pointer to backend implementation of ::amp_set_ext_level(). */
int (*set_powerstat)(AMP *amp, powerstat_t status); /*!< Pointer to backend implementation of ::amp_set_powerstat(). */
int (*get_powerstat)(AMP *amp, powerstat_t *status); /*!< Pointer to backend implementation of ::amp_get_powerstat(). */

Expand Down Expand Up @@ -336,11 +336,11 @@ amp_cleanup HAMLIB_PARAMS((AMP *amp));

extern HAMLIB_EXPORT(int)
amp_set_conf HAMLIB_PARAMS((AMP *amp,
token_t token,
hamlib_token_t token,
const char *val));
extern HAMLIB_EXPORT(int)
amp_get_conf HAMLIB_PARAMS((AMP *amp,
token_t token,
hamlib_token_t token,
char *val));
extern HAMLIB_EXPORT(int)
amp_set_powerstat HAMLIB_PARAMS((AMP *amp,
Expand Down Expand Up @@ -408,7 +408,7 @@ extern HAMLIB_EXPORT(const struct confparams *)
amp_confparam_lookup HAMLIB_PARAMS((AMP *amp,
const char *name));

extern HAMLIB_EXPORT(token_t)
extern HAMLIB_EXPORT(hamlib_token_t)
amp_token_lookup HAMLIB_PARAMS((AMP *amp,
const char *name));

Expand All @@ -429,12 +429,12 @@ amp_ext_lookup HAMLIB_PARAMS((AMP *amp,

extern HAMLIB_EXPORT(int)
amp_get_ext_level HAMLIB_PARAMS((AMP *amp,
token_t token,
hamlib_token_t token,
value_t *val));

extern HAMLIB_EXPORT(int)
amp_set_ext_level HAMLIB_PARAMS((AMP *amp,
token_t token,
hamlib_token_t token,
value_t val));

extern HAMLIB_EXPORT(const char *) amp_strlevel(setting_t);
Expand Down
48 changes: 24 additions & 24 deletions include/hamlib/rig.h
Expand Up @@ -842,7 +842,7 @@ typedef enum {
/**
* \brief configuration token
*/
typedef long token_t;
typedef long hamlib_token_t;


//! @cond Doxygen_Suppress
Expand Down Expand Up @@ -883,7 +883,7 @@ enum rig_conf_e {
* \brief Configuration parameter structure.
*/
struct confparams {
token_t token; /*!< Conf param token ID */
hamlib_token_t token; /*!< Conf param token ID */
const char *name; /*!< Param name, no spaces allowed */
const char *label; /*!< Human readable label */
const char *tooltip; /*!< Hint on the parameter */
Expand Down Expand Up @@ -1536,7 +1536,7 @@ struct filter_list {
*
*/
struct ext_list {
token_t token; /*!< Token ID */
hamlib_token_t token; /*!< Token ID */
value_t val; /*!< Value */
};

Expand Down Expand Up @@ -2081,17 +2081,17 @@ struct rig_caps {
int (*set_parm)(RIG *rig, setting_t parm, value_t val);
int (*get_parm)(RIG *rig, setting_t parm, value_t *val);

int (*set_ext_level)(RIG *rig, vfo_t vfo, token_t token, value_t val);
int (*get_ext_level)(RIG *rig, vfo_t vfo, token_t token, value_t *val);
int (*set_ext_level)(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val);
int (*get_ext_level)(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val);

int (*set_ext_func)(RIG *rig, vfo_t vfo, token_t token, int status);
int (*get_ext_func)(RIG *rig, vfo_t vfo, token_t token, int *status);
int (*set_ext_func)(RIG *rig, vfo_t vfo, hamlib_token_t token, int status);
int (*get_ext_func)(RIG *rig, vfo_t vfo, hamlib_token_t token, int *status);

int (*set_ext_parm)(RIG *rig, token_t token, value_t val);
int (*get_ext_parm)(RIG *rig, token_t token, value_t *val);
int (*set_ext_parm)(RIG *rig, hamlib_token_t token, value_t val);
int (*get_ext_parm)(RIG *rig, hamlib_token_t token, value_t *val);

int (*set_conf)(RIG *rig, token_t token, const char *val);
int (*get_conf)(RIG *rig, token_t token, char *val);
int (*set_conf)(RIG *rig, hamlib_token_t token, const char *val);
int (*get_conf)(RIG *rig, hamlib_token_t token, char *val);

int (*send_dtmf)(RIG *rig, vfo_t vfo, const char *digits);
int (*recv_dtmf)(RIG *rig, vfo_t vfo, char *digits, int *length);
Expand Down Expand Up @@ -2162,7 +2162,7 @@ struct rig_caps {
const unsigned char *frame);
// this will be used to check rigcaps structure is compatible with client
char *hamlib_check_rig_caps; // a constant value we can check for hamlib integrity
int (*get_conf2)(RIG *rig, token_t token, char *val, int val_len);
int (*get_conf2)(RIG *rig, hamlib_token_t token, char *val, int val_len);
int (*password)(RIG *rig, const char *key1); /*< Send encrypted password if rigctld is secured with -A/--password */
int (*set_lock_mode)(RIG *rig, int mode);
int (*get_lock_mode)(RIG *rig, int *mode);
Expand Down Expand Up @@ -3321,16 +3321,16 @@ rig_get_parm HAMLIB_PARAMS((RIG *rig,

extern HAMLIB_EXPORT(int)
rig_set_conf HAMLIB_PARAMS((RIG *rig,
token_t token,
hamlib_token_t token,
const char *val));
// deprecating rig_get_conf
extern HAMLIB_EXPORT(int)
rig_get_conf HAMLIB_PARAMS((RIG *rig,
token_t token,
hamlib_token_t token,
char *val));
extern HAMLIB_EXPORT(int)
rig_get_conf2 HAMLIB_PARAMS((RIG *rig,
token_t token,
hamlib_token_t token,
char *val,
int val_len));

Expand All @@ -3348,32 +3348,32 @@ rig_reset HAMLIB_PARAMS((RIG *rig,
extern HAMLIB_EXPORT(int)
rig_set_ext_level HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
token_t token,
hamlib_token_t token,
value_t val));
extern HAMLIB_EXPORT(int)
rig_get_ext_level HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
token_t token,
hamlib_token_t token,
value_t *val));

extern HAMLIB_EXPORT(int)
rig_set_ext_func HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
token_t token,
hamlib_token_t token,
int status));
extern HAMLIB_EXPORT(int)
rig_get_ext_func HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
token_t token,
hamlib_token_t token,
int *status));

extern HAMLIB_EXPORT(int)
rig_set_ext_parm HAMLIB_PARAMS((RIG *rig,
token_t token,
hamlib_token_t token,
value_t val));
extern HAMLIB_EXPORT(int)
rig_get_ext_parm HAMLIB_PARAMS((RIG *rig,
token_t token,
hamlib_token_t token,
value_t *val));

extern HAMLIB_EXPORT(int)
Expand Down Expand Up @@ -3401,8 +3401,8 @@ rig_ext_lookup HAMLIB_PARAMS((RIG *rig,

extern HAMLIB_EXPORT(const struct confparams *)
rig_ext_lookup_tok HAMLIB_PARAMS((RIG *rig,
token_t token));
extern HAMLIB_EXPORT(token_t)
hamlib_token_t token));
extern HAMLIB_EXPORT(hamlib_token_t)
rig_ext_token_lookup HAMLIB_PARAMS((RIG *rig,
const char *name));

Expand All @@ -3416,7 +3416,7 @@ rig_token_foreach HAMLIB_PARAMS((RIG *rig,
extern HAMLIB_EXPORT(const struct confparams *)
rig_confparam_lookup HAMLIB_PARAMS((RIG *rig,
const char *name));
extern HAMLIB_EXPORT(token_t)
extern HAMLIB_EXPORT(hamlib_token_t)
rig_token_lookup HAMLIB_PARAMS((RIG *rig,
const char *name));

Expand Down
6 changes: 3 additions & 3 deletions include/hamlib/rigclass.h
Expand Up @@ -54,11 +54,11 @@ class HAMLIB_CPP_IMPEXP Rig
// This method closes the communication port to the rig
void close(void);

void setConf(token_t token, const char *val);
void setConf(hamlib_token_t token, const char *val);
void setConf(const char *name, const char *val);
void getConf(token_t token, char *val);
void getConf(hamlib_token_t token, char *val);
void getConf(const char *name, char *val);
token_t tokenLookup(const char *name);
hamlib_token_t tokenLookup(const char *name);

void setFreq(freq_t freq, vfo_t vfo = RIG_VFO_CURR);
freq_t getFreq(vfo_t vfo = RIG_VFO_CURR);
Expand Down

1 comment on commit 0503317

@Tyrbiter
Copy link

@Tyrbiter Tyrbiter commented on 0503317 Jan 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of these errors with the token_t change Mike:

hamlibtcl_wrap.c:52173:3: error: unknown type name 'token_t'; did you mean 'tone_t'?

Looks like the tests sub-directory needs a few more changes.

And now fixed.

Please sign in to comment.