Prefix action function names so as not to clash with system names.

The prefix rigctl_ is added to all parser action routine names so that
they do not clash with system names.
Hamlib-3.0
Bill Somerville 2014-05-02 19:09:35 +01:00
rodzic 2fe2587ee5
commit 8e5ad418fd
1 zmienionych plików z 68 dodań i 67 usunięć

Wyświetl plik

@ -147,7 +147,8 @@ struct test_table {
#define CHKSCN1ARG(a) if ((a) != 1) return -RIG_EINVAL; else do {} while(0)
#define declare_proto_rig(f) static int (f)(RIG *rig, FILE *fout, FILE *fin, int interactive, \
#define ACTION(f) rigctl_##f
#define declare_proto_rig(f) static int (ACTION(f))(RIG *rig, FILE *fout, FILE *fin, int interactive, \
const struct test_table *cmd, vfo_t vfo, const char *arg1, \
const char *arg2, const char *arg3)
@ -230,72 +231,72 @@ declare_proto_rig(pause);
* Available alphabetic letters: -.--------K-----*-----W-Y-
*/
static struct test_table test_list[] = {
{ 'F', "set_freq", set_freq, ARG_IN, "Frequency" },
{ 'f', "get_freq", get_freq, ARG_OUT, "Frequency" },
{ 'M', "set_mode", set_mode, ARG_IN, "Mode", "Passband" },
{ 'm', "get_mode", get_mode, ARG_OUT, "Mode", "Passband" },
{ 'I', "set_split_freq", set_split_freq, ARG_IN, "TX Frequency" },
{ 'i', "get_split_freq", get_split_freq, ARG_OUT, "TX Frequency" },
{ 'X', "set_split_mode", set_split_mode, ARG_IN, "TX Mode", "TX Passband" },
{ 'x', "get_split_mode", get_split_mode, ARG_OUT, "TX Mode", "TX Passband" },
{ 'S', "set_split_vfo", set_split_vfo, ARG_IN, "Split", "TX VFO" },
{ 's', "get_split_vfo", get_split_vfo, ARG_OUT, "Split", "TX VFO" },
{ 'N', "set_ts", set_ts, ARG_IN, "Tuning Step" },
{ 'n', "get_ts", get_ts, ARG_OUT, "Tuning Step" },
{ 'L', "set_level", set_level, ARG_IN, "Level", "Level Value" },
{ 'l', "get_level", get_level, ARG_IN1|ARG_OUT2, "Level", "Level Value" },
{ 'U', "set_func", set_func, ARG_IN, "Func", "Func Status" },
{ 'u', "get_func", get_func, ARG_IN1|ARG_OUT2, "Func", "Func Status" },
{ 'P', "set_parm", set_parm, ARG_IN|ARG_NOVFO, "Parm", "Parm Value" },
{ 'p', "get_parm", get_parm, ARG_IN1|ARG_OUT2|ARG_NOVFO, "Parm", "Parm Value" },
{ 'G', "vfo_op", vfo_op, ARG_IN, "Mem/VFO Op" },
{ 'g', "scan", scan, ARG_IN, "Scan Fct", "Scan Channel" },
{ 'A', "set_trn", set_trn, ARG_IN|ARG_NOVFO, "Transceive" },
{ 'a', "get_trn", get_trn, ARG_OUT|ARG_NOVFO, "Transceive" },
{ 'R', "set_rptr_shift", set_rptr_shift, ARG_IN, "Rptr Shift" },
{ 'r', "get_rptr_shift", get_rptr_shift, ARG_OUT, "Rptr Shift" },
{ 'O', "set_rptr_offs", set_rptr_offs, ARG_IN, "Rptr Offset" },
{ 'o', "get_rptr_offs", get_rptr_offs, ARG_OUT, "Rptr Offset" },
{ 'C', "set_ctcss_tone", set_ctcss_tone, ARG_IN, "CTCSS Tone" },
{ 'c', "get_ctcss_tone", get_ctcss_tone, ARG_OUT, "CTCSS Tone" },
{ 'D', "set_dcs_code", set_dcs_code, ARG_IN, "DCS Code" },
{ 'd', "get_dcs_code", get_dcs_code, ARG_OUT, "DCS Code" },
{ 0x90, "set_ctcss_sql", set_ctcss_sql, ARG_IN, "CTCSS Sql" },
{ 0x91, "get_ctcss_sql", get_ctcss_sql, ARG_OUT, "CTCSS Sql" },
{ 0x92, "set_dcs_sql", set_dcs_sql, ARG_IN, "DCS Sql" },
{ 0x93, "get_dcs_sql", get_dcs_sql, ARG_OUT, "DCS Sql" },
{ 'V', "set_vfo", set_vfo, ARG_IN|ARG_NOVFO, "VFO" },
{ 'v', "get_vfo", get_vfo, ARG_OUT, "VFO" },
{ 'T', "set_ptt", set_ptt, ARG_IN, "PTT" },
{ 't', "get_ptt", get_ptt, ARG_OUT, "PTT" },
{ 'E', "set_mem", set_mem, ARG_IN, "Memory#" },
{ 'e', "get_mem", get_mem, ARG_OUT, "Memory#" },
{ 'H', "set_channel", set_channel, ARG_IN|ARG_NOVFO, "Channel" },
{ 'h', "get_channel", get_channel, ARG_IN|ARG_NOVFO, "Channel" },
{ 'B', "set_bank", set_bank, ARG_IN, "Bank" },
{ '_', "get_info", get_info, ARG_OUT|ARG_NOVFO, "Info" },
{ 'J', "set_rit", set_rit, ARG_IN, "RIT" },
{ 'j', "get_rit", get_rit, ARG_OUT, "RIT" },
{ 'Z', "set_xit", set_xit, ARG_IN, "XIT" },
{ 'z', "get_xit", get_xit, ARG_OUT, "XIT" },
{ 'Y', "set_ant", set_ant, ARG_IN, "Antenna" },
{ 'y', "get_ant", get_ant, ARG_OUT, "Antenna" },
{ 0x87, "set_powerstat", set_powerstat, ARG_IN|ARG_NOVFO, "Power Status" },
{ 0x88, "get_powerstat", get_powerstat, ARG_OUT|ARG_NOVFO, "Power Status" },
{ 0x89, "send_dtmf", send_dtmf, ARG_IN, "Digits" },
{ 0x8a, "recv_dtmf", recv_dtmf, ARG_OUT, "Digits" },
{ '*', "reset", reset, ARG_IN, "Reset" },
{ 'w', "send_cmd", send_cmd, ARG_IN1|ARG_IN_LINE|ARG_OUT2|ARG_NOVFO, "Cmd", "Reply" },
{ 'b', "send_morse", send_morse, ARG_IN|ARG_IN_LINE, "Morse" },
{ 0x8b, "get_dcd", get_dcd, ARG_OUT, "DCD" },
{ '2', "power2mW", power2mW, ARG_IN1|ARG_IN2|ARG_IN3|ARG_OUT1|ARG_NOVFO, "Power [0.0..1.0]", "Frequency", "Mode", "Power mW" },
{ '4', "mW2power", mW2power, ARG_IN1|ARG_IN2|ARG_IN3|ARG_OUT1|ARG_NOVFO, "Power mW", "Frequency", "Mode", "Power [0.0..1.0]" },
{ '1', "dump_caps", dump_caps, ARG_NOVFO },
{ '3', "dump_conf", dump_conf, ARG_NOVFO },
{ 0x8f,"dump_state", dump_state, ARG_OUT|ARG_NOVFO },
{ 0xf0,"chk_vfo", chk_vfo, ARG_NOVFO }, /* rigctld only--check for VFO mode */
{ 0xf1,"halt", halt, ARG_NOVFO }, /* rigctld only--halt the daemon */
{ 0x8c, "pause", pause, ARG_IN, "Seconds" },
{ 'F', "set_freq", ACTION(set_freq), ARG_IN, "Frequency" },
{ 'f', "get_freq", ACTION(get_freq), ARG_OUT, "Frequency" },
{ 'M', "set_mode", ACTION(set_mode), ARG_IN, "Mode", "Passband" },
{ 'm', "get_mode", ACTION(get_mode), ARG_OUT, "Mode", "Passband" },
{ 'I', "set_split_freq", ACTION(set_split_freq), ARG_IN, "TX Frequency" },
{ 'i', "get_split_freq", ACTION(get_split_freq), ARG_OUT, "TX Frequency" },
{ 'X', "set_split_mode", ACTION(set_split_mode), ARG_IN, "TX Mode", "TX Passband" },
{ 'x', "get_split_mode", ACTION(get_split_mode), ARG_OUT, "TX Mode", "TX Passband" },
{ 'S', "set_split_vfo", ACTION(set_split_vfo), ARG_IN, "Split", "TX VFO" },
{ 's', "get_split_vfo", ACTION(get_split_vfo), ARG_OUT, "Split", "TX VFO" },
{ 'N', "set_ts", ACTION(set_ts), ARG_IN, "Tuning Step" },
{ 'n', "get_ts", ACTION(get_ts), ARG_OUT, "Tuning Step" },
{ 'L', "set_level", ACTION(set_level), ARG_IN, "Level", "Level Value" },
{ 'l', "get_level", ACTION(get_level), ARG_IN1|ARG_OUT2, "Level", "Level Value" },
{ 'U', "set_func", ACTION(set_func), ARG_IN, "Func", "Func Status" },
{ 'u', "get_func", ACTION(get_func), ARG_IN1|ARG_OUT2, "Func", "Func Status" },
{ 'P', "set_parm", ACTION(set_parm), ARG_IN|ARG_NOVFO, "Parm", "Parm Value" },
{ 'p', "get_parm", ACTION(get_parm), ARG_IN1|ARG_OUT2|ARG_NOVFO, "Parm", "Parm Value" },
{ 'G', "vfo_op", ACTION(vfo_op), ARG_IN, "Mem/VFO Op" },
{ 'g', "scan", ACTION(scan), ARG_IN, "Scan Fct", "Scan Channel" },
{ 'A', "set_trn", ACTION(set_trn), ARG_IN|ARG_NOVFO, "Transceive" },
{ 'a', "get_trn", ACTION(get_trn), ARG_OUT|ARG_NOVFO, "Transceive" },
{ 'R', "set_rptr_shift", ACTION(set_rptr_shift), ARG_IN, "Rptr Shift" },
{ 'r', "get_rptr_shift", ACTION(get_rptr_shift), ARG_OUT, "Rptr Shift" },
{ 'O', "set_rptr_offs", ACTION(set_rptr_offs), ARG_IN, "Rptr Offset" },
{ 'o', "get_rptr_offs", ACTION(get_rptr_offs), ARG_OUT, "Rptr Offset" },
{ 'C', "set_ctcss_tone", ACTION(set_ctcss_tone), ARG_IN, "CTCSS Tone" },
{ 'c', "get_ctcss_tone", ACTION(get_ctcss_tone), ARG_OUT, "CTCSS Tone" },
{ 'D', "set_dcs_code", ACTION(set_dcs_code), ARG_IN, "DCS Code" },
{ 'd', "get_dcs_code", ACTION(get_dcs_code), ARG_OUT, "DCS Code" },
{ 0x90, "set_ctcss_sql", ACTION(set_ctcss_sql), ARG_IN, "CTCSS Sql" },
{ 0x91, "get_ctcss_sql", ACTION(get_ctcss_sql), ARG_OUT, "CTCSS Sql" },
{ 0x92, "set_dcs_sql", ACTION(set_dcs_sql), ARG_IN, "DCS Sql" },
{ 0x93, "get_dcs_sql", ACTION(get_dcs_sql), ARG_OUT, "DCS Sql" },
{ 'V', "set_vfo", ACTION(set_vfo), ARG_IN|ARG_NOVFO, "VFO" },
{ 'v', "get_vfo", ACTION(get_vfo), ARG_OUT, "VFO" },
{ 'T', "set_ptt", ACTION(set_ptt), ARG_IN, "PTT" },
{ 't', "get_ptt", ACTION(get_ptt), ARG_OUT, "PTT" },
{ 'E', "set_mem", ACTION(set_mem), ARG_IN, "Memory#" },
{ 'e', "get_mem", ACTION(get_mem), ARG_OUT, "Memory#" },
{ 'H', "set_channel", ACTION(set_channel), ARG_IN|ARG_NOVFO, "Channel" },
{ 'h', "get_channel", ACTION(get_channel), ARG_IN|ARG_NOVFO, "Channel" },
{ 'B', "set_bank", ACTION(set_bank), ARG_IN, "Bank" },
{ '_', "get_info", ACTION(get_info), ARG_OUT|ARG_NOVFO, "Info" },
{ 'J', "set_rit", ACTION(set_rit), ARG_IN, "RIT" },
{ 'j', "get_rit", ACTION(get_rit), ARG_OUT, "RIT" },
{ 'Z', "set_xit", ACTION(set_xit), ARG_IN, "XIT" },
{ 'z', "get_xit", ACTION(get_xit), ARG_OUT, "XIT" },
{ 'Y', "set_ant", ACTION(set_ant), ARG_IN, "Antenna" },
{ 'y', "get_ant", ACTION(get_ant), ARG_OUT, "Antenna" },
{ 0x87, "set_powerstat", ACTION(set_powerstat), ARG_IN|ARG_NOVFO, "Power Status" },
{ 0x88, "get_powerstat", ACTION(get_powerstat), ARG_OUT|ARG_NOVFO, "Power Status" },
{ 0x89, "send_dtmf", ACTION(send_dtmf), ARG_IN, "Digits" },
{ 0x8a, "recv_dtmf", ACTION(recv_dtmf), ARG_OUT, "Digits" },
{ '*', "reset", ACTION(reset), ARG_IN, "Reset" },
{ 'w', "send_cmd", ACTION(send_cmd), ARG_IN1|ARG_IN_LINE|ARG_OUT2|ARG_NOVFO, "Cmd", "Reply" },
{ 'b', "send_morse", ACTION(send_morse), ARG_IN|ARG_IN_LINE, "Morse" },
{ 0x8b, "get_dcd", ACTION(get_dcd), ARG_OUT, "DCD" },
{ '2', "power2mW", ACTION(power2mW), ARG_IN1|ARG_IN2|ARG_IN3|ARG_OUT1|ARG_NOVFO, "Power [0.0..1.0]", "Frequency", "Mode", "Power mW" },
{ '4', "mW2power", ACTION(mW2power), ARG_IN1|ARG_IN2|ARG_IN3|ARG_OUT1|ARG_NOVFO, "Power mW", "Frequency", "Mode", "Power [0.0..1.0]" },
{ '1', "dump_caps", ACTION(dump_caps), ARG_NOVFO },
{ '3', "dump_conf", ACTION(dump_conf), ARG_NOVFO },
{ 0x8f,"dump_state", ACTION(dump_state), ARG_OUT|ARG_NOVFO },
{ 0xf0,"chk_vfo", ACTION(chk_vfo), ARG_NOVFO }, /* rigctld only--check for VFO mode */
{ 0xf1,"halt", ACTION(halt), ARG_NOVFO }, /* rigctld only--halt the daemon */
{ 0x8c, "pause", ACTION(pause), ARG_IN, "Seconds" },
{ 0x00, "", NULL },
};