diff --git a/bindings/rig.swg b/bindings/rig.swg index a56494a4b..41d33ce75 100644 --- a/bindings/rig.swg +++ b/bindings/rig.swg @@ -1,8 +1,8 @@ /* * Hamlib bindings - Rig interface - * Copyright (c) 2001-2003 by Stephane Fillod + * Copyright (c) 2001-2004 by Stephane Fillod * - * $Id: rig.swg,v 1.7 2004-01-15 22:40:44 fillods Exp $ + * $Id: rig.swg,v 1.8 2004-05-17 21:09:41 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -95,7 +95,7 @@ typedef struct Rig { #define METHODSUPERSET(f, t1, fld, chk) void set_##f (const char *name, t1 fld _VFO_DECL) \ { setting_t stg; value_t val; \ - stg = parse_##f(name); \ + stg = rig_parse_##f(name); \ if (!rig_has_set_##f(self->rig, stg)) { \ const struct confparams *cfp; \ cfp = rig_ext_lookup(self->rig, name); \ @@ -158,7 +158,7 @@ typedef struct Rig { #define METHODSUPERGET(fct, t1, fld, chk) t1 get_##fct##_##fld(const char *name _VFO_DECL) \ { setting_t stg; value_t val; \ - stg = parse_##fct(name); \ + stg = rig_parse_##fct(name); \ if (!rig_has_get_##fct(self->rig, stg)) { \ const struct confparams *cfp; \ cfp = rig_ext_lookup(self->rig, name); \ diff --git a/dummy/dummy.c b/dummy/dummy.c index b615b243b..072eb4958 100644 --- a/dummy/dummy.c +++ b/dummy/dummy.c @@ -1,8 +1,8 @@ /* * Hamlib Dummy backend - main file - * Copyright (c) 2001-2003 by Stephane Fillod + * Copyright (c) 2001-2004 by Stephane Fillod * - * $Id: dummy.c,v 1.38 2004-01-15 22:43:59 fillods Exp $ + * $Id: dummy.c,v 1.39 2004-05-17 21:09:42 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -65,7 +65,7 @@ static void init_chan(RIG *rig, vfo_t vfo, channel_t *chan) { chan->channel_num = 0; chan->vfo = vfo; - strcpy(chan->channel_desc, strvfo(vfo)); + strcpy(chan->channel_desc, rig_strvfo(vfo)); chan->freq = MHz(145); chan->mode = RIG_MODE_FM; @@ -155,7 +155,7 @@ static int dummy_set_freq(RIG *rig, vfo_t vfo, freq_t freq) sprintf_freq(fstr, freq); rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %s\n", __FUNCTION__, - strvfo(vfo), fstr); + rig_strvfo(vfo), fstr); curr->freq = freq; return RIG_OK; @@ -167,7 +167,7 @@ static int dummy_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv; channel_t *curr = priv->curr; - rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, strvfo(vfo)); + rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, rig_strvfo(vfo)); *freq = curr->freq; @@ -183,7 +183,7 @@ static int dummy_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) sprintf_freq(buf, width); rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %s %s\n", __FUNCTION__, - strvfo(vfo), strrmode(mode), buf); + rig_strvfo(vfo), rig_strrmode(mode), buf); curr->mode = mode; curr->width = width; @@ -197,7 +197,7 @@ static int dummy_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv; channel_t *curr = priv->curr; - rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, strvfo(vfo)); + rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, rig_strvfo(vfo)); *mode = curr->mode; *width = curr->width; @@ -211,7 +211,7 @@ static int dummy_set_vfo(RIG *rig, vfo_t vfo) struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv; channel_t *curr = priv->curr; - rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, strvfo(vfo)); + rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, rig_strvfo(vfo)); priv->last_vfo = priv->curr_vfo; priv->curr_vfo = vfo; @@ -226,7 +226,7 @@ static int dummy_set_vfo(RIG *rig, vfo_t vfo) break; } default: - rig_debug(RIG_DEBUG_VERBOSE,"%s unknown vfo: %s\n", __FUNCTION__, strvfo(vfo)); + rig_debug(RIG_DEBUG_VERBOSE,"%s unknown vfo: %s\n", __FUNCTION__, rig_strvfo(vfo)); } return RIG_OK; @@ -238,7 +238,7 @@ static int dummy_get_vfo(RIG *rig, vfo_t *vfo) struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv; *vfo = priv->curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, strvfo(*vfo)); + rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, rig_strvfo(*vfo)); return RIG_OK; } @@ -429,7 +429,7 @@ static int dummy_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) sprintf_freq(fstr, tx_freq); rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %s\n", __FUNCTION__, - strvfo(vfo), fstr); + rig_strvfo(vfo), fstr); curr->tx_freq = tx_freq; return RIG_OK; @@ -441,7 +441,7 @@ static int dummy_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv; channel_t *curr = priv->curr; - rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__,strvfo(vfo)); + rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__,rig_strvfo(vfo)); *tx_freq = curr->tx_freq; @@ -456,7 +456,7 @@ static int dummy_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t sprintf_freq(buf, tx_width); rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %s %s\n", __FUNCTION__, - strvfo(vfo), strrmode(tx_mode), buf); + rig_strvfo(vfo), rig_strrmode(tx_mode), buf); curr->tx_mode = tx_mode; curr->tx_width = tx_width; @@ -469,7 +469,7 @@ static int dummy_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv; channel_t *curr = priv->curr; - rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, strvfo(vfo)); + rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, rig_strvfo(vfo)); *tx_mode = curr->tx_mode; *tx_width = curr->tx_width; @@ -578,7 +578,7 @@ static int dummy_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) channel_t *curr = priv->curr; rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %d\n",__FUNCTION__, - strfunc(func), status); + rig_strfunc(func), status); if (func < RIG_SETTING_MAX) { if (status) curr->funcs |= func; @@ -599,7 +599,7 @@ static int dummy_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) *status = curr->funcs & func ? 1 : 0; rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n",__FUNCTION__, - strfunc(func)); + rig_strfunc(func)); return RIG_OK; } @@ -621,7 +621,7 @@ static int dummy_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) else sprintf(lstr, "%d", val.i); rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %s\n",__FUNCTION__, - strlevel(level), lstr); + rig_strlevel(level), lstr); return RIG_OK; } @@ -638,7 +638,7 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (idx < RIG_SETTING_MAX) *val = curr->levels[idx]; rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n",__FUNCTION__, - strlevel(level)); + rig_strlevel(level)); return RIG_OK; } @@ -679,7 +679,7 @@ static int dummy_set_parm(RIG *rig, setting_t parm, value_t val) else sprintf(pstr, "%d", val.i); rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %s\n", __FUNCTION__, - strparm(parm), pstr); + rig_strparm(parm), pstr); if (idx < RIG_SETTING_MAX) priv->parms[idx] = val; @@ -697,7 +697,7 @@ static int dummy_get_parm(RIG *rig, setting_t parm, value_t *val) if (idx < RIG_SETTING_MAX) *val = priv->parms[idx]; rig_debug(RIG_DEBUG_VERBOSE,"%s called %s\n",__FUNCTION__, - strparm(parm)); + rig_strparm(parm)); return RIG_OK; } @@ -767,7 +767,7 @@ static int dummy_get_mem(RIG *rig, vfo_t vfo, int *ch) static int dummy_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) { rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %d\n",__FUNCTION__, - strscan(scan), ch); + rig_strscan(scan), ch); return RIG_OK; } @@ -775,7 +775,7 @@ static int dummy_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) static void chan_vfo(channel_t *chan, vfo_t vfo) { chan->vfo = vfo; - strcpy(chan->channel_desc, strvfo(vfo)); + strcpy(chan->channel_desc, rig_strvfo(vfo)); } static int dummy_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) @@ -787,7 +787,7 @@ static int dummy_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) shortfreq_t ts; rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n",__FUNCTION__, - strvfop(op)); + rig_strvfop(op)); switch (op) { case RIG_OP_FROM_VFO: /* VFO->MEM */ diff --git a/flexradio/sdr1k.c b/flexradio/sdr1k.c index cac8e3bcb..5327916d4 100644 --- a/flexradio/sdr1k.c +++ b/flexradio/sdr1k.c @@ -2,7 +2,7 @@ * Hamlib Rotator backend - SDR-1000 * Copyright (c) 2003-2004 by Stephane Fillod * - * $Id: sdr1k.c,v 1.5 2004-02-08 17:41:52 fillods Exp $ + * $Id: sdr1k.c,v 1.6 2004-05-17 21:09:42 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -397,7 +397,7 @@ int sdr1k_set_ptt (RIG *rig, vfo_t vfo, ptt_t ptt) int sdr1k_set_level (RIG *rig, vfo_t vfo, setting_t level, value_t val) { - rig_debug(RIG_DEBUG_TRACE,"%s: %s %d\n", __FUNCTION__, strlevel(level), val.i); + rig_debug(RIG_DEBUG_TRACE,"%s: %s %d\n", __FUNCTION__, rig_strlevel(level), val.i); switch (level) { case RIG_LEVEL_PREAMP: diff --git a/gnuradio/demod.h b/gnuradio/demod.h index a80844ab1..bf59cbc7b 100644 --- a/gnuradio/demod.h +++ b/gnuradio/demod.h @@ -1,8 +1,8 @@ /* * Hamlib GNUradio backend - Demodulator chain class - * Copyright (c) 2003 by Stephane Fillod + * Copyright (c) 2003-2004 by Stephane Fillod * - * $Id: demod.h,v 1.2 2004-02-08 20:27:58 fillods Exp $ + * $Id: demod.h,v 1.3 2004-05-17 21:09:43 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -48,7 +48,7 @@ class DemodChainCF { d_source(d_source), d_sink(d_sink), mode(mode), width(width), input_rate(input_rate), centerfreq(centerfreq), rf_gain(1.0), if_width_of_transition_band(1000), CFIRdecimate(1), RFIRdecimate(1) {} virtual ~DemodChainCF () { delete agc; delete mixer; delete gainstage; delete audio_filter; } - virtual const char *name() { return strrmode(mode); } + virtual const char *name() { return rig_strrmode(mode); } virtual void connect (void); void setWidth (pbwidth_t width); diff --git a/gnuradio/gnuradio.cc b/gnuradio/gnuradio.cc index d3aae7128..0fb775ba0 100644 --- a/gnuradio/gnuradio.cc +++ b/gnuradio/gnuradio.cc @@ -1,9 +1,9 @@ /* -*- Mode: c++ -*- */ /* * Hamlib GNUradio backend - main file - * Copyright (c) 2001-2003 by Stephane Fillod + * Copyright (c) 2001-2004 by Stephane Fillod * - * $Id: gnuradio.cc,v 1.8 2004-02-08 20:27:58 fillods Exp $ + * $Id: gnuradio.cc,v 1.9 2004-05-17 21:09:43 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -98,7 +98,7 @@ static void init_chan(RIG *rig, vfo_t vfo, channel_t *chan) { chan->channel_num = 0; chan->vfo = vfo; - strcpy(chan->channel_desc, strvfo(vfo)); + strcpy(chan->channel_desc, rig_strvfo(vfo)); chan->freq = RIG_FREQ_NONE; chan->mode = RIG_MODE_NONE; @@ -501,7 +501,7 @@ int gr_set_freq(RIG *rig, vfo_t vfo, freq_t freq) sprintf_freq(fstr, freq); rig_debug(RIG_DEBUG_TRACE,"%s called: %s %s\n", - __FUNCTION__, strvfo(vfo), fstr); + __FUNCTION__, rig_strvfo(vfo), fstr); ret = rig_get_freq(priv->tuner, RIG_VFO_CURR, &tuner_freq); if (ret != RIG_OK) @@ -555,7 +555,7 @@ int gr_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) int chan_num = vfo2chan_num(rig, vfo); channel_t *chan = &priv->chans[chan_num]; - rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, strvfo(vfo)); + rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, rig_strvfo(vfo)); *freq = chan->freq; @@ -581,7 +581,7 @@ int gr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) width = rig_passband_normal(rig, mode); sprintf_freq(buf, width); rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %s %s\n", - __FUNCTION__, strvfo(vfo), strrmode(mode), buf); + __FUNCTION__, rig_strvfo(vfo), rig_strrmode(mode), buf); if (mode == chan->mode && width == chan->width) return RIG_OK; @@ -681,7 +681,7 @@ int gr_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) int chan_num = vfo2chan_num(rig, vfo); channel_t *chan = &priv->chans[chan_num]; - rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, strvfo(vfo)); + rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, rig_strvfo(vfo)); *mode = chan->mode; *width = chan->width; @@ -701,7 +701,7 @@ int gr_set_vfo(RIG *rig, vfo_t vfo) return -RIG_EINVAL; priv->curr_vfo = vfo; - rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, strvfo(vfo)); + rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, rig_strvfo(vfo)); return RIG_OK; } @@ -712,7 +712,7 @@ int gr_get_vfo(RIG *rig, vfo_t *vfo) struct gnuradio_priv_data *priv = (struct gnuradio_priv_data *)rig->state.priv; *vfo = priv->curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, strvfo(*vfo)); + rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, rig_strvfo(*vfo)); return RIG_OK; } @@ -738,7 +738,7 @@ int gnuradio_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) else sprintf(lstr, "%d", val.i); rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %s\n",__FUNCTION__, - strlevel(level), lstr); + rig_strlevel(level), lstr); /* TODO: check val is in range */ pthread_mutex_lock(&priv->mutex_process); @@ -749,7 +749,7 @@ int gnuradio_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; default: rig_debug(RIG_DEBUG_TRACE, "%s: level %s, try tuner\n", - __FUNCTION__, strlevel(level)); + __FUNCTION__, rig_strlevel(level)); ret = rig_set_level(priv->tuner, vfo, level, val); break; } @@ -772,7 +772,7 @@ int gnuradio_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (idx < RIG_SETTING_MAX) *val = chan->levels[idx]; rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n",__FUNCTION__, - strlevel(level)); + rig_strlevel(level)); return RIG_OK; } @@ -844,7 +844,7 @@ int gnuradio_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) int ret = RIG_OK; rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n",__FUNCTION__, - strvfop(op)); + rig_strvfop(op)); switch (op) { case RIG_OP_UP: diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 358ca7c31..7279894ff 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -1,8 +1,8 @@ /* * Hamlib Interface - API header - * Copyright (c) 2000-2003 by Stephane Fillod and Frank Singleton + * Copyright (c) 2000-2004 by Stephane Fillod and Frank Singleton * - * $Id: rig.h,v 1.94 2004-05-11 17:36:10 fillods Exp $ + * $Id: rig.h,v 1.95 2004-05-17 21:09:40 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -1545,6 +1545,27 @@ extern HAMLIB_EXPORT(int) rig_probe_all HAMLIB_PARAMS((port_t *p, rig_probe_func extern HAMLIB_EXPORT(rig_model_t) rig_probe HAMLIB_PARAMS((port_t *p)); +/* Misc calls */ +extern HAMLIB_EXPORT(const char *) rig_strrmode(rmode_t mode); +extern HAMLIB_EXPORT(const char *) rig_strvfo(vfo_t vfo); +extern HAMLIB_EXPORT(const char *) rig_strfunc(setting_t); +extern HAMLIB_EXPORT(const char *) rig_strlevel(setting_t); +extern HAMLIB_EXPORT(const char *) rig_strparm(setting_t); +extern HAMLIB_EXPORT(const char *) rig_strptrshift(rptr_shift_t); +extern HAMLIB_EXPORT(const char *) rig_strvfop(vfo_op_t op); +extern HAMLIB_EXPORT(const char *) rig_strscan(scan_t scan); +extern HAMLIB_EXPORT(const char *) rig_strstatus(enum rig_status_e status); + +extern HAMLIB_EXPORT(rmode_t) rig_parse_mode(const char *s); +extern HAMLIB_EXPORT(vfo_t) rig_parse_vfo(const char *s); +extern HAMLIB_EXPORT(setting_t) rig_parse_func(const char *s); +extern HAMLIB_EXPORT(setting_t) rig_parse_level(const char *s); +extern HAMLIB_EXPORT(setting_t) rig_parse_parm(const char *s); +extern HAMLIB_EXPORT(vfo_op_t) rig_parse_vfo_op(const char *s); +extern HAMLIB_EXPORT(scan_t) rig_parse_scan(const char *s); +extern HAMLIB_EXPORT(rptr_shift_t) rig_parse_rptr_shift(const char *s); + + __END_DECLS #endif /* _RIG_H */ diff --git a/src/misc.c b/src/misc.c index 48c3eb726..ca0fcf29c 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1,8 +1,8 @@ /* * Hamlib Interface - toolbox - * Copyright (c) 2000-2003 by Stephane Fillod and Frank Singleton + * Copyright (c) 2000-2004 by Stephane Fillod * - * $Id: misc.c,v 1.31 2003-12-24 09:07:52 fillods Exp $ + * $Id: misc.c,v 1.32 2004-05-17 21:09:44 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -262,7 +262,7 @@ int sprintf_freq(char *str, freq_t freq) return sprintf (str, "%g %s", f, hz); } -const char *strptrshift(rptr_shift_t shift) +const char *rig_strptrshift(rptr_shift_t shift) { switch (shift) { case RIG_RPT_SHIFT_MINUS: return "+"; @@ -273,7 +273,7 @@ const char *strptrshift(rptr_shift_t shift) return NULL; } -const char *strstatus(enum rig_status_e status) +const char *rig_strstatus(enum rig_status_e status) { switch (status) { case RIG_STATUS_ALPHA: @@ -314,7 +314,7 @@ static struct { }; -rmode_t parse_mode(const char *s) +rmode_t rig_parse_mode(const char *s) { int i; @@ -324,7 +324,7 @@ rmode_t parse_mode(const char *s) return RIG_MODE_NONE; } -const char * strrmode(rmode_t mode) +const char * rig_strrmode(rmode_t mode) { int i; @@ -354,7 +354,7 @@ static struct { { RIG_VFO_NONE, "" }, }; -vfo_t parse_vfo(const char *s) +vfo_t rig_parse_vfo(const char *s) { int i; @@ -364,7 +364,7 @@ vfo_t parse_vfo(const char *s) return RIG_VFO_NONE; } -const char *strvfo(vfo_t vfo) +const char *rig_strvfo(vfo_t vfo) { int i; @@ -414,7 +414,7 @@ static struct { { RIG_FUNC_NONE, "" }, }; -setting_t parse_func(const char *s) +setting_t rig_parse_func(const char *s) { int i; @@ -424,7 +424,7 @@ setting_t parse_func(const char *s) return RIG_FUNC_NONE; } -const char *strfunc(setting_t func) +const char *rig_strfunc(setting_t func) { int i; @@ -474,7 +474,7 @@ static struct { { RIG_LEVEL_NONE, "" }, }; -setting_t parse_level(const char *s) +setting_t rig_parse_level(const char *s) { int i; @@ -484,7 +484,7 @@ setting_t parse_level(const char *s) return RIG_LEVEL_NONE; } -const char *strlevel(setting_t level) +const char *rig_strlevel(setting_t level) { int i; @@ -512,7 +512,7 @@ static struct { { RIG_PARM_NONE, "" }, }; -setting_t parse_parm(const char *s) +setting_t rig_parse_parm(const char *s) { int i; @@ -522,7 +522,7 @@ setting_t parse_parm(const char *s) return RIG_PARM_NONE; } -const char *strparm(setting_t parm) +const char *rig_strparm(setting_t parm) { int i; @@ -557,7 +557,7 @@ static struct { { RIG_OP_NONE, "" }, }; -vfo_op_t parse_vfo_op(const char *s) +vfo_op_t rig_parse_vfo_op(const char *s) { int i; @@ -567,7 +567,7 @@ vfo_op_t parse_vfo_op(const char *s) return RIG_OP_NONE; } -const char *strvfop(vfo_op_t op) +const char *rig_strvfop(vfo_op_t op) { int i; @@ -597,7 +597,7 @@ static struct { { RIG_SCAN_NONE, "" }, }; -scan_t parse_scan(const char *s) +scan_t rig_parse_scan(const char *s) { int i; @@ -610,7 +610,7 @@ scan_t parse_scan(const char *s) return RIG_SCAN_NONE; } -const char *strscan(scan_t rscan) +const char *rig_strscan(scan_t rscan) { int i; @@ -625,7 +625,7 @@ const char *strscan(scan_t rscan) } -rptr_shift_t parse_rptr_shift(const char *s) +rptr_shift_t rig_parse_rptr_shift(const char *s) { if (strcmp(s, "+") == 0) return RIG_RPT_SHIFT_PLUS; diff --git a/src/misc.h b/src/misc.h index 855939fe8..f2eb7c766 100644 --- a/src/misc.h +++ b/src/misc.h @@ -1,8 +1,8 @@ /* * Hamlib Interface - toolbox header - * Copyright (c) 2000,2001 by Stephane Fillod and Frank Singleton + * Copyright (c) 2000-2004 by Stephane Fillod * - * $Id: misc.h,v 1.16 2003-11-16 17:34:00 fillods Exp $ + * $Id: misc.h,v 1.17 2004-05-17 21:09:44 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -61,24 +61,7 @@ extern HAMLIB_EXPORT(unsigned char *) to_bcd_be(unsigned char bcd_data[], unsign extern HAMLIB_EXPORT(unsigned long long) from_bcd_be(const unsigned char bcd_data[], unsigned bcd_len); extern HAMLIB_EXPORT(int) sprintf_freq(char *str, freq_t); -extern HAMLIB_EXPORT(const char *) strrmode(rmode_t mode); -extern HAMLIB_EXPORT(const char *) strvfo(vfo_t vfo); -extern HAMLIB_EXPORT(const char *) strfunc(setting_t); -extern HAMLIB_EXPORT(const char *) strlevel(setting_t); -extern HAMLIB_EXPORT(const char *) strparm(setting_t); -extern HAMLIB_EXPORT(const char *) strptrshift(rptr_shift_t); -extern HAMLIB_EXPORT(const char *) strvfop(vfo_op_t op); -extern HAMLIB_EXPORT(const char *) strscan(scan_t scan); -extern HAMLIB_EXPORT(const char *) strstatus(enum rig_status_e status); -extern HAMLIB_EXPORT(rmode_t) parse_mode(const char *s); -extern HAMLIB_EXPORT(vfo_t) parse_vfo(const char *s); -extern HAMLIB_EXPORT(setting_t) parse_func(const char *s); -extern HAMLIB_EXPORT(setting_t) parse_level(const char *s); -extern HAMLIB_EXPORT(setting_t) parse_parm(const char *s); -extern HAMLIB_EXPORT(vfo_op_t) parse_vfo_op(const char *s); -extern HAMLIB_EXPORT(scan_t) parse_scan(const char *s); -extern HAMLIB_EXPORT(rptr_shift_t) parse_rptr_shift(const char *s); /* check if it's any of CR or LF */ #define isreturn(c) ((c) == 10 || (c) == 13) diff --git a/tentec/tentec2.c b/tentec/tentec2.c index 1b86ebd60..9553ea2b7 100644 --- a/tentec/tentec2.c +++ b/tentec/tentec2.c @@ -1,8 +1,8 @@ /* * Hamlib Tentec backend - Argonaut, Jupiter, RX-350 - * Copyright (c) 2001-2003 by Stephane Fillod + * Copyright (c) 2001-2004 by Stephane Fillod * - * $Id: tentec2.c,v 1.3 2003-10-20 22:15:02 fillods Exp $ + * $Id: tentec2.c,v 1.4 2004-05-17 21:09:44 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -86,7 +86,7 @@ int tentec2_set_freq(RIG *rig, vfo_t vfo, freq_t freq) case RIG_VFO_B: vfo_val = 'B'; break; default: rig_debug(RIG_DEBUG_ERR,"%s: unsupported VFO %s\n", - __FUNCTION__, strvfo(vfo)); + __FUNCTION__, rig_strvfo(vfo)); return -RIG_EINVAL; } freq_len = sprintf(freqbuf, "*%c%c%c%c%c" EOM, @@ -127,7 +127,7 @@ int tentec2_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) case RIG_VFO_B: vfo_val = 'B'; break; default: rig_debug(RIG_DEBUG_ERR,"%s: unsupported VFO %s\n", - __FUNCTION__, strvfo(vfo)); + __FUNCTION__, rig_strvfo(vfo)); return -RIG_EINVAL; } freq_len = sprintf(freqbuf, "?%c" EOM, vfo_val); @@ -171,7 +171,7 @@ int tentec2_set_vfo(RIG *rig, vfo_t vfo) case RIG_VFO_B: vfo_val = 'B'; break; default: rig_debug(RIG_DEBUG_ERR,"%s: unsupported VFO %s\n", - __FUNCTION__, strvfo(vfo)); + __FUNCTION__, rig_strvfo(vfo)); return -RIG_EINVAL; } vfo_len = sprintf(vfobuf, "*E%c%c" EOM, @@ -314,7 +314,7 @@ int tentec2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_VFO_B: ttmode_b = ttmode; break; default: rig_debug(RIG_DEBUG_ERR,"%s: unsupported VFO %s\n", - __FUNCTION__, strvfo(vfo)); + __FUNCTION__, rig_strvfo(vfo)); return -RIG_EINVAL; } @@ -368,7 +368,7 @@ int tentec2_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) case RIG_VFO_B: ttmode = mdbuf[3]; break; default: rig_debug(RIG_DEBUG_ERR,"%s: unsupported VFO %s\n", - __FUNCTION__, strvfo(vfo)); + __FUNCTION__, rig_strvfo(vfo)); return -RIG_EINVAL; } switch (ttmode) { diff --git a/tests/dumpcaps.c b/tests/dumpcaps.c index d594266e6..346bf7d05 100644 --- a/tests/dumpcaps.c +++ b/tests/dumpcaps.c @@ -1,9 +1,9 @@ /* - * dumpcaps.c - Copyright (C) 2000-2003 Stephane Fillod + * dumpcaps.c - Copyright (C) 2000-2004 Stephane Fillod * This programs dumps the capabilities of a backend rig. * * - * $Id: dumpcaps.c,v 1.41 2003-12-04 23:18:49 fillods Exp $ + * $Id: dumpcaps.c,v 1.42 2004-05-17 21:09:44 fillods Exp $ * * * This program is free software; you can redistribute it and/or @@ -63,7 +63,7 @@ int dumpcaps (RIG* rig) printf("Mfg name:\t%s\n",caps->mfg_name); printf("Backend version:\t%s\n",caps->version); printf("Backend copyright:\t%s\n",caps->copyright); - printf("Backend status:\t%s\n", strstatus(caps->status)); + printf("Backend status:\t%s\n", rig_strstatus(caps->status)); printf("Rig type:\t"); switch (caps->rig_type & RIG_TYPE_MASK) { case RIG_TYPE_TRANSCEIVER: @@ -332,7 +332,7 @@ int dumpcaps (RIG* rig) continue; sprintf_freq(freqbuf, pbnorm); - printf("\n\t%s\tnormal: %s,\t", strrmode(i), freqbuf); + printf("\n\t%s\tnormal: %s,\t", rig_strrmode(i), freqbuf); sprintf_freq(freqbuf, rig_passband_narrow(rig, i)); printf("narrow: %s,\t", freqbuf); diff --git a/tests/memcsv.c b/tests/memcsv.c index 9e617bab1..789a00c6a 100644 --- a/tests/memcsv.c +++ b/tests/memcsv.c @@ -1,10 +1,10 @@ /* - * memcsv.c - (C) Stephane Fillod 2003 + * memcsv.c - (C) Stephane Fillod 2003-2004 * * This program exercises the backup and restore of a radio * using Hamlib. CSV primitives * - * $Id: memcsv.c,v 1.3 2004-01-15 22:43:59 fillods Exp $ + * $Id: memcsv.c,v 1.4 2004-05-17 21:09:45 fillods Exp $ * * * This program is free software; you can redistribute it and/or @@ -144,7 +144,7 @@ int csv_parm_save (RIG *rig, const char *outfilename) return -1; for (i = 0; i < RIG_SETTING_MAX; i++) { - const char *ms = strparm(get_parm & rig_idx2setting(i)); + const char *ms = rig_strparm(get_parm & rig_idx2setting(i)); if (!ms || !ms[0]) continue; fprintf(f, "%s;", ms); @@ -158,7 +158,7 @@ int csv_parm_save (RIG *rig, const char *outfilename) value_t val; parm = get_parm & rig_idx2setting(i); - ms = strparm(parm); + ms = rig_strparm(parm); if (!ms || !ms[0]) continue; @@ -280,7 +280,7 @@ void dump_csv_chan(const channel_cap_t *mem_caps, const channel_t *chan, FILE *f fprintf(f, "%s;", chan->channel_desc); } if (mem_caps->vfo) { - fprintf(f,"%s;",strvfo(chan->vfo)); + fprintf(f,"%s;",rig_strvfo(chan->vfo)); } if (mem_caps->ant) { fprintf(f,"%d;",chan->ant); @@ -289,7 +289,7 @@ void dump_csv_chan(const channel_cap_t *mem_caps, const channel_t *chan, FILE *f fprintf(f,"%"FREQFMT";",chan->freq); } if (mem_caps->mode) { - fprintf(f, "%s;", strrmode(chan->mode)); + fprintf(f, "%s;", rig_strrmode(chan->mode)); } if (mem_caps->width) { fprintf(f,"%d;",(int)chan->width); @@ -298,7 +298,7 @@ void dump_csv_chan(const channel_cap_t *mem_caps, const channel_t *chan, FILE *f fprintf(f,"%"FREQFMT";",chan->tx_freq); } if (mem_caps->tx_mode) { - fprintf(f, "%s;", strrmode(chan->tx_mode)); + fprintf(f, "%s;", rig_strrmode(chan->tx_mode)); } if (mem_caps->tx_width) { fprintf(f,"%d;",(int)chan->tx_width); @@ -307,10 +307,10 @@ void dump_csv_chan(const channel_cap_t *mem_caps, const channel_t *chan, FILE *f fprintf(f, "%s;", chan->split==RIG_SPLIT_ON?"on":"off"); } if (mem_caps->tx_vfo) { - fprintf(f,"%s;",strvfo(chan->tx_vfo)); + fprintf(f,"%s;",rig_strvfo(chan->tx_vfo)); } if (mem_caps->rptr_shift) { - fprintf(f, "%s;", strptrshift(chan->rptr_shift)); + fprintf(f, "%s;", rig_strptrshift(chan->rptr_shift)); } if (mem_caps->rptr_offs) { fprintf(f,"%d",(int)chan->rptr_offs); diff --git a/tests/memload.c b/tests/memload.c index 2ca891d3b..ff911ba4f 100644 --- a/tests/memload.c +++ b/tests/memload.c @@ -2,7 +2,7 @@ * memload.c - Copyright (C) 2003 Thierry Leconte * * - * $Id: memload.c,v 1.3 2004-01-21 19:48:12 f4dwv Exp $ + * $Id: memload.c,v 1.4 2004-05-17 21:09:45 fillods Exp $ * * * This program is free software; you can redistribute it and/or @@ -152,7 +152,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) if (rig->state.chan_list[i].mem_caps.mode) { prop=xmlGetProp(node, "mode"); if(prop!=NULL) - chan->mode = parse_mode(prop); + chan->mode = rig_parse_mode(prop); } if (rig->state.chan_list[i].mem_caps.width) { prop=xmlGetProp(node, "width"); @@ -167,7 +167,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) if (rig->state.chan_list[i].mem_caps.tx_mode) { prop=xmlGetProp(node, "tx_mode"); if(prop!=NULL) - chan->tx_mode = parse_mode(prop); + chan->tx_mode = rig_parse_mode(prop); } if (rig->state.chan_list[i].mem_caps.tx_width) { prop=xmlGetProp(node, "tx_width"); diff --git a/tests/memsave.c b/tests/memsave.c index b01d1b9df..a9982d53c 100644 --- a/tests/memsave.c +++ b/tests/memsave.c @@ -1,8 +1,8 @@ /* - * memsave.c - Copyright (C) 2003 Thierry Leconte + * memsave.c - Copyright (C) 2003-2004 Thierry Leconte * * - * $Id: memsave.c,v 1.4 2004-01-21 19:47:15 f4dwv Exp $ + * $Id: memsave.c,v 1.5 2004-05-17 21:09:45 fillods Exp $ * * * This program is free software; you can redistribute it and/or @@ -142,7 +142,7 @@ int dump_xml_chan(RIG *rig, xmlNodePtr root, int i, int chan_num) xmlNewProp(node, "freq", attrbuf); } if (rig->state.chan_list[i].mem_caps.mode && chan.mode != RIG_MODE_NONE) { - xmlNewProp(node, "mode", strrmode(chan.mode)); + xmlNewProp(node, "mode", rig_strrmode(chan.mode)); } if (rig->state.chan_list[i].mem_caps.width && chan.width != 0) { sprintf(attrbuf,"%d",(int)chan.width); @@ -153,7 +153,7 @@ int dump_xml_chan(RIG *rig, xmlNodePtr root, int i, int chan_num) xmlNewProp(node, "tx_freq", attrbuf); } if (rig->state.chan_list[i].mem_caps.tx_mode && chan.tx_mode != RIG_MODE_NONE) { - xmlNewProp(node, "tx_mode", strrmode(chan.tx_mode)); + xmlNewProp(node, "tx_mode", rig_strrmode(chan.tx_mode)); } if (rig->state.chan_list[i].mem_caps.tx_width && chan.tx_width!=0) { sprintf(attrbuf,"%d",(int)chan.tx_width); diff --git a/tests/rigctl.c b/tests/rigctl.c index f3e22c624..1f62e5ade 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -5,7 +5,7 @@ * It takes commands in interactive mode as well as * from command line options. * - * $Id: rigctl.c,v 1.49 2004-02-08 20:25:36 fillods Exp $ + * $Id: rigctl.c,v 1.50 2004-05-17 21:09:45 fillods Exp $ * * * This program is free software; you can redistribute it and/or @@ -504,7 +504,7 @@ int main (int argc, char *argv[]) printf("Opened rig model %d, '%s'\n", my_rig->caps->rig_model, my_rig->caps->model_name); rig_debug(RIG_DEBUG_VERBOSE, "Backend version: %s, Status: %s\n", - my_rig->caps->version, strstatus(my_rig->caps->status)); + my_rig->caps->version, rig_strstatus(my_rig->caps->status)); #define MAXARGSZ 127 while (1) { @@ -580,14 +580,14 @@ int main (int argc, char *argv[]) if (interactive) { printf("VFO: "); scanfc("%s", arg1); - vfo = parse_vfo(arg1); + vfo = rig_parse_vfo(arg1); } else { if (!argv[optind]) { fprintf(stderr, "Invalid arg for command '%s'\n", cmd_entry->name); exit(2); } - vfo = parse_vfo(argv[optind++]); + vfo = rig_parse_vfo(argv[optind++]); } } if ((cmd_entry->flags & ARG_IN1) && cmd_entry->arg1) { @@ -731,13 +731,13 @@ static int print_conf_list(const struct confparams *cfp, rig_ptr_t data) printf("\n"); break; case RIG_CONF_STRING: - printf("String.\n"); + printf("\tString.\n"); break; case RIG_CONF_CHECKBUTTON: - printf("Check button.\n"); + printf("\tCheck button.\n"); break; default: - printf("Unkown conf\n"); + printf("\tUnkown conf\n"); } return 1; /* !=0, we want them all ! */ @@ -746,7 +746,7 @@ static int print_conf_list(const struct confparams *cfp, rig_ptr_t data) static int print_model_list(const struct rig_caps *caps, void *data) { printf("%d\t%-16s%-24s%-8s%s\n", caps->rig_model, caps->mfg_name, - caps->model_name, caps->version, strstatus(caps->status)); + caps->model_name, caps->version, rig_strstatus(caps->status)); return 1; /* !=0, we want them all ! */ } @@ -863,7 +863,7 @@ declare_proto_rig(set_mode) rmode_t mode; pbwidth_t width; - mode = parse_mode(arg1); + mode = rig_parse_mode(arg1); sscanf(arg2, "%ld", &width); return rig_set_mode(rig, vfo, mode, width); } @@ -880,7 +880,7 @@ declare_proto_rig(get_mode) return status; if (interactive) printf("%s: ", cmd->arg1); - printf("%s\n", strrmode(mode)); + printf("%s\n", rig_strrmode(mode)); if (interactive) printf("%s: ", cmd->arg2); printf("%ld\n", width); @@ -890,7 +890,7 @@ declare_proto_rig(get_mode) declare_proto_rig(set_vfo) { - return rig_set_vfo(rig, parse_vfo(arg1)); + return rig_set_vfo(rig, rig_parse_vfo(arg1)); } @@ -903,7 +903,7 @@ declare_proto_rig(get_vfo) return status; if (interactive) printf("%s: ", cmd->arg1); - printf("%s\n", strvfo(vfo)); + printf("%s\n", rig_strvfo(vfo)); return status; } @@ -936,7 +936,7 @@ declare_proto_rig(set_rptr_shift) { rptr_shift_t rptr_shift; - rptr_shift = parse_rptr_shift(arg1); + rptr_shift = rig_parse_rptr_shift(arg1); return rig_set_rptr_shift(rig, vfo, rptr_shift); } @@ -951,7 +951,7 @@ declare_proto_rig(get_rptr_shift) return status; if (interactive) printf("%s: ", cmd->arg1); - printf("%s\n", strptrshift(rptr_shift)); + printf("%s\n", rig_strptrshift(rptr_shift)); return status; } @@ -1056,7 +1056,7 @@ declare_proto_rig(set_split_mode) rmode_t mode; pbwidth_t width; - mode = parse_mode(arg1); + mode = rig_parse_mode(arg1); sscanf(arg2, "%d", (int*)&width); return rig_set_split_mode(rig, vfo, mode, width); } @@ -1073,7 +1073,7 @@ declare_proto_rig(get_split_mode) return status; if (interactive) printf("%s: ", cmd->arg1); - printf("%s\n", strrmode(mode)); + printf("%s\n", rig_strrmode(mode)); if (interactive) printf("%s: ", cmd->arg2); printf("%ld\n", width); @@ -1086,7 +1086,7 @@ declare_proto_rig(set_split_vfo) split_t split; sscanf(arg1, "%d", (int*)&split); - return rig_set_split_vfo(rig, vfo, split, parse_vfo(arg2)); + return rig_set_split_vfo(rig, vfo, split, rig_parse_vfo(arg2)); } @@ -1104,7 +1104,7 @@ declare_proto_rig(get_split_vfo) printf("%d\n", split); if (interactive) printf("%s: ", cmd->arg2); - printf("%s\n", strvfo(tx_vfo)); + printf("%s\n", rig_strvfo(tx_vfo)); return status; } @@ -1163,7 +1163,7 @@ declare_proto_rig(set_level) setting_t level; value_t val; - level = parse_level(arg1); + level = rig_parse_level(arg1); if (!rig_has_set_level(rig, level)) { const struct confparams *cfp; @@ -1203,7 +1203,7 @@ declare_proto_rig(get_level) setting_t level; value_t val; - level = parse_level(arg1); + level = rig_parse_level(arg1); if (!rig_has_get_level(rig, level)) { const struct confparams *cfp; @@ -1253,7 +1253,7 @@ declare_proto_rig(set_func) setting_t func; int func_stat; - func = parse_func(arg1); + func = rig_parse_func(arg1); sscanf(arg2, "%d", (int*)&func_stat); return rig_set_func(rig, vfo, func, func_stat); } @@ -1265,7 +1265,7 @@ declare_proto_rig(get_func) setting_t func; int func_stat; - func = parse_func(arg1); + func = rig_parse_func(arg1); status = rig_get_func(rig, vfo, func, &func_stat); if (status != RIG_OK) return status; @@ -1280,7 +1280,7 @@ declare_proto_rig(set_parm) setting_t parm; value_t val; - parm = parse_parm(arg1); + parm = rig_parse_parm(arg1); if (!rig_has_set_parm(rig, parm)) { const struct confparams *cfp; @@ -1321,7 +1321,7 @@ declare_proto_rig(get_parm) setting_t parm; value_t val; - parm = parse_parm(arg1); + parm = rig_parse_parm(arg1); if (!rig_has_get_parm(rig, parm)) { const struct confparams *cfp; @@ -1403,7 +1403,7 @@ declare_proto_rig(vfo_op) { vfo_op_t op; - op = parse_vfo_op(arg1); + op = rig_parse_vfo_op(arg1); return rig_vfo_op(rig, vfo, op); } @@ -1412,7 +1412,7 @@ declare_proto_rig(scan) scan_t op; int ch; - op = parse_scan(arg1); + op = rig_parse_scan(arg1); sscanf(arg2, "%d", &ch); return rig_scan(rig, vfo, op, ch); } @@ -1434,7 +1434,7 @@ declare_proto_rig(get_channel) if (sscanf(arg1, "%d", &chan.channel_num) != 1) return -RIG_EINVAL; } else { - chan.vfo = parse_vfo(arg1); + chan.vfo = rig_parse_vfo(arg1); chan.channel_num = 0; } @@ -1447,32 +1447,32 @@ declare_proto_rig(get_channel) static int myfreq_event(RIG *rig, vfo_t vfo, freq_t freq, rig_ptr_t arg) { - printf("Event: freq changed to %lliHz on %s\n", (long long)freq, strvfo(vfo)); + printf("Event: freq changed to %lliHz on %s\n", (long long)freq, rig_strvfo(vfo)); return 0; } static int mymode_event(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, rig_ptr_t arg) { - printf("Event: mode changed to %s, width %liHz on %s\n", strrmode(mode), - width, strvfo(vfo)); + printf("Event: mode changed to %s, width %liHz on %s\n", rig_strrmode(mode), + width, rig_strvfo(vfo)); return 0; } static int myvfo_event(RIG *rig, vfo_t vfo, rig_ptr_t arg) { - printf("Event: vfo changed to %s\n", strvfo(vfo)); + printf("Event: vfo changed to %s\n", rig_strvfo(vfo)); return 0; } static int myptt_event(RIG *rig, vfo_t vfo, ptt_t ptt, rig_ptr_t arg) { - printf("Event: PTT changed to %i on %s\n", ptt, strvfo(vfo)); + printf("Event: PTT changed to %i on %s\n", ptt, rig_strvfo(vfo)); return 0; } static int mydcd_event(RIG *rig, vfo_t vfo, dcd_t dcd, rig_ptr_t arg) { - printf("Event: DCD changed to %i on %s\n", dcd, strvfo(vfo)); + printf("Event: DCD changed to %i on %s\n", dcd, rig_strvfo(vfo)); return 0; } @@ -1537,21 +1537,21 @@ void dump_chan(RIG *rig, channel_t *chan) printf("Channel: %d, Name: '%s'\n", chan->channel_num, chan->channel_desc); - printf("VFO: %s, Antenna: %d, Split: %s\n", strvfo(chan->vfo), + printf("VFO: %s, Antenna: %d, Split: %s\n", rig_strvfo(chan->vfo), chan->ant, chan->split==RIG_SPLIT_ON?"ON":"OFF"); sprintf_freq(freqbuf, chan->freq); sprintf_freq(widthbuf, chan->width); printf("Freq: %s\tMode: %s\tWidth: %s\n", - freqbuf, strrmode(chan->mode), widthbuf); + freqbuf, rig_strrmode(chan->mode), widthbuf); sprintf_freq(freqbuf, chan->tx_freq); sprintf_freq(widthbuf, chan->tx_width); printf("txFreq: %s\ttxMode: %s\ttxWidth: %s\n", - freqbuf, strrmode(chan->tx_mode), widthbuf); + freqbuf, rig_strrmode(chan->tx_mode), widthbuf); sprintf_freq(freqbuf,chan->rptr_offs); - printf("Shift: %s, Offset: %s%s, ", strptrshift(chan->rptr_shift), + printf("Shift: %s, Offset: %s%s, ", rig_strptrshift(chan->rptr_shift), chan->rptr_offs>0?"+":"", freqbuf); sprintf_freq(freqbuf,chan->tuning_step); @@ -1576,7 +1576,7 @@ void dump_chan(RIG *rig, channel_t *chan) if (!rig_has_set_level(rig, level)) continue; - level_s = strlevel(level); + level_s = rig_strlevel(level); if (!level_s) continue; /* duh! */ if (firstloop) diff --git a/tests/rigmem.c b/tests/rigmem.c index 417019334..c5c4d60d7 100644 --- a/tests/rigmem.c +++ b/tests/rigmem.c @@ -1,10 +1,10 @@ /* - * rigmem.c - (C) Stephane Fillod and Thierry Leconte 2003 + * rigmem.c - (C) Stephane Fillod and Thierry Leconte 2003-2004 * * This program exercises the backup and restore of a radio * using Hamlib. * - * $Id: rigmem.c,v 1.1 2003-12-04 23:15:02 fillods Exp $ + * $Id: rigmem.c,v 1.2 2004-05-17 21:09:45 fillods Exp $ * * * This program is free software; you can redistribute it and/or @@ -224,7 +224,7 @@ int main (int argc, char *argv[]) printf("Opened rig model %d, '%s'\n", rig->caps->rig_model, rig->caps->model_name); rig_debug(RIG_DEBUG_VERBOSE, "Backend version: %s, Status: %s\n", - rig->caps->version, strstatus(rig->caps->status)); + rig->caps->version, rig_strstatus(rig->caps->status)); /* on some rigs, this accelerates the backup/restore */ rig_set_vfo(rig, RIG_VFO_MEM); diff --git a/tests/sprintflst.c b/tests/sprintflst.c index 86b9e6d9c..ff13f4fb6 100644 --- a/tests/sprintflst.c +++ b/tests/sprintflst.c @@ -1,8 +1,8 @@ /* * Hamlib Interface - sprintf toolbox - * Copyright (c) 2000-2003 by Stephane Fillod and Frank Singleton + * Copyright (c) 2000-2004 by Stephane Fillod and Frank Singleton * - * $Id: sprintflst.c,v 1.4 2004-01-15 22:43:59 fillods Exp $ + * $Id: sprintflst.c,v 1.5 2004-05-17 21:09:45 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -48,19 +48,19 @@ int sprintf_vfo(char *str, vfo_t vfo) *str = '\0'; if (vfo == RIG_VFO_NONE) return 0; - sv = strvfo(vfo & RIG_VFO_CURR); + sv = rig_strvfo(vfo & RIG_VFO_CURR); if (sv && sv[0]) len += sprintf(str+len, "%s ", sv); - sv = strvfo(vfo & RIG_VFO_MEM); + sv = rig_strvfo(vfo & RIG_VFO_MEM); if (sv && sv[0]) len += sprintf(str+len, "%s ", sv); - sv = strvfo(vfo & RIG_VFO_VFO); + sv = rig_strvfo(vfo & RIG_VFO_VFO); if (sv && sv[0]) len += sprintf(str+len, "%s ", sv); - sv = strvfo(vfo & RIG_VFO_MAIN); + sv = rig_strvfo(vfo & RIG_VFO_MAIN); if (sv && sv[0]) len += sprintf(str+len, "%s ", sv); - sv = strvfo(vfo & RIG_VFO_SUB); + sv = rig_strvfo(vfo & RIG_VFO_SUB); if (sv && sv[0]) len += sprintf(str+len, "%s ", sv); for (i=0; i<16; i++) { - sv = strvfo(vfo & RIG_VFO_N(i)); + sv = rig_strvfo(vfo & RIG_VFO_N(i)); if (sv && sv[0]) len += sprintf(str+len, "%s ", sv); } @@ -76,7 +76,7 @@ int sprintf_mode(char *str, rmode_t mode) return 0; for (i = 0; i < 30; i++) { - const char *ms = strrmode(mode & (1UL<state.priv; diff --git a/yaesu/ft847.c b/yaesu/ft847.c index 90f429401..648b655f9 100644 --- a/yaesu/ft847.c +++ b/yaesu/ft847.c @@ -6,7 +6,7 @@ * via serial interface to an FT-847 using the "CAT" interface. * * - * $Id: ft847.c,v 1.27 2004-02-16 21:38:59 fillods Exp $ + * $Id: ft847.c,v 1.28 2004-05-17 21:09:41 fillods Exp $ * * * @@ -461,7 +461,7 @@ int ft847_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { */ - rig_debug(RIG_DEBUG_VERBOSE,"ft847: vfo =%s \n", strvfo(vfo)); + rig_debug(RIG_DEBUG_VERBOSE,"ft847: vfo =%s \n", rig_strvfo(vfo)); if (vfo == RIG_VFO_CURR) vfo = p->current_vfo; @@ -510,7 +510,7 @@ static int get_freq_and_mode(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, p = (struct ft847_priv_data*)rs->priv; - rig_debug(RIG_DEBUG_VERBOSE,"ft847: vfo =%s \n", strvfo(vfo)); + rig_debug(RIG_DEBUG_VERBOSE,"ft847: vfo =%s \n", rig_strvfo(vfo)); if (vfo == RIG_VFO_CURR) vfo = p->current_vfo; @@ -623,7 +623,7 @@ int ft847_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { vfo = p->current_vfo; if (vfo != RIG_VFO_MAIN) { - rig_debug(RIG_DEBUG_VERBOSE,"ft847: unsupported VFO '%s'\n", strvfo(vfo)); + rig_debug(RIG_DEBUG_VERBOSE,"ft847: unsupported VFO '%s'\n", rig_strvfo(vfo)); return -RIG_ENIMPL; /* sorry, it's in TODO list */ }