You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(57) |
Nov
(27) |
Dec
(25) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(41) |
Feb
(101) |
Mar
(60) |
Apr
(32) |
May
(32) |
Jun
(198) |
Jul
(95) |
Aug
(60) |
Sep
(48) |
Oct
(96) |
Nov
(27) |
Dec
(222) |
2002 |
Jan
(180) |
Feb
(46) |
Mar
(68) |
Apr
(11) |
May
(36) |
Jun
(34) |
Jul
(113) |
Aug
(42) |
Sep
(71) |
Oct
(65) |
Nov
(116) |
Dec
(40) |
2003 |
Jan
(32) |
Feb
(92) |
Mar
(29) |
Apr
(102) |
May
(21) |
Jun
(34) |
Jul
(3) |
Aug
(60) |
Sep
(30) |
Oct
(62) |
Nov
(57) |
Dec
(33) |
2004 |
Jan
(28) |
Feb
(46) |
Mar
(16) |
Apr
(14) |
May
(31) |
Jun
(21) |
Jul
(10) |
Aug
(80) |
Sep
(42) |
Oct
(11) |
Nov
(28) |
Dec
(13) |
2005 |
Jan
(35) |
Feb
(26) |
Mar
(20) |
Apr
(118) |
May
(2) |
Jun
(5) |
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
(13) |
Dec
(1) |
2006 |
Jan
(9) |
Feb
(25) |
Mar
(22) |
Apr
(6) |
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
(3) |
Oct
(46) |
Nov
(13) |
Dec
(7) |
2007 |
Jan
(9) |
Feb
(14) |
Mar
(3) |
Apr
|
May
(6) |
Jun
(1) |
Jul
|
Aug
(11) |
Sep
(7) |
Oct
(8) |
Nov
(41) |
Dec
(3) |
2008 |
Jan
(27) |
Feb
(16) |
Mar
(13) |
Apr
(23) |
May
(39) |
Jun
(4) |
Jul
(7) |
Aug
(1) |
Sep
(13) |
Oct
(52) |
Nov
(44) |
Dec
(55) |
2009 |
Jan
(72) |
Feb
(69) |
Mar
|
Apr
|
May
|
Jun
(13) |
Jul
(1) |
Aug
(6) |
Sep
(15) |
Oct
(11) |
Nov
(31) |
Dec
(20) |
2010 |
Jan
(24) |
Feb
(21) |
Mar
(22) |
Apr
(40) |
May
(38) |
Jun
(4) |
Jul
(2) |
Aug
(22) |
Sep
(19) |
Oct
(14) |
Nov
(5) |
Dec
(8) |
2011 |
Jan
(14) |
Feb
(36) |
Mar
(6) |
Apr
|
May
|
Jun
(23) |
Jul
(13) |
Aug
(8) |
Sep
(7) |
Oct
|
Nov
(3) |
Dec
(9) |
2012 |
Jan
(17) |
Feb
(13) |
Mar
(10) |
Apr
|
May
(1) |
Jun
(14) |
Jul
(4) |
Aug
(12) |
Sep
(2) |
Oct
(24) |
Nov
(14) |
Dec
(2) |
2013 |
Jan
(4) |
Feb
(3) |
Mar
(3) |
Apr
(3) |
May
(10) |
Jun
(4) |
Jul
(7) |
Aug
|
Sep
(15) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
2014 |
Jan
|
Feb
(8) |
Mar
(1) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
(3) |
Oct
(7) |
Nov
(6) |
Dec
(3) |
2015 |
Jan
(4) |
Feb
(5) |
Mar
(8) |
Apr
(8) |
May
(2) |
Jun
|
Jul
(4) |
Aug
(7) |
Sep
(8) |
Oct
|
Nov
(6) |
Dec
(4) |
2016 |
Jan
(6) |
Feb
(26) |
Mar
(3) |
Apr
(10) |
May
(6) |
Jun
(5) |
Jul
(1) |
Aug
(4) |
Sep
(3) |
Oct
(4) |
Nov
(3) |
Dec
(10) |
2017 |
Jan
(11) |
Feb
(11) |
Mar
(2) |
Apr
(1) |
May
(7) |
Jun
(2) |
Jul
(11) |
Aug
(9) |
Sep
(5) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
2018 |
Jan
(5) |
Feb
(2) |
Mar
(19) |
Apr
(7) |
May
(11) |
Jun
(3) |
Jul
(4) |
Aug
(10) |
Sep
(2) |
Oct
(8) |
Nov
(6) |
Dec
(9) |
2019 |
Jan
(9) |
Feb
(6) |
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(9) |
Jul
(6) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(8) |
Dec
(9) |
2020 |
Jan
(15) |
Feb
(1) |
Mar
(18) |
Apr
(33) |
May
(43) |
Jun
(87) |
Jul
(45) |
Aug
(8) |
Sep
(43) |
Oct
(3) |
Nov
(5) |
Dec
(42) |
2021 |
Jan
(116) |
Feb
(40) |
Mar
(58) |
Apr
(48) |
May
(29) |
Jun
(2) |
Jul
|
Aug
(22) |
Sep
(18) |
Oct
(1) |
Nov
|
Dec
(3) |
2022 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
(6) |
Nov
(2) |
Dec
(9) |
2023 |
Jan
(10) |
Feb
|
Mar
|
Apr
(10) |
May
(3) |
Jun
(1) |
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(3) |
2024 |
Jan
(4) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(5) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(9) |
2025 |
Jan
(5) |
Feb
(5) |
Mar
|
Apr
(10) |
May
(20) |
Jun
(43) |
Jul
(24) |
Aug
(47) |
Sep
(38) |
Oct
(4) |
Nov
|
Dec
|
From: n0nb <n0...@us...> - 2025-08-20 18:01:40
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via cbefd0835f5284509d5b32b1f50251aa2c3f82f3 (commit) via 5a001ab3aa31b7d2458f54d998f3281f9bf5cb13 (commit) via ead67ec17005f5aa2790d429dd72a39c9dead7e1 (commit) from d6165f74115aa4794ebacc7d775477eaacd02445 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit cbefd0835f5284509d5b32b1f50251aa2c3f82f3 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Wed Aug 20 16:22:39 2025 +0200 Do not show any debug trace messages unless requested with -vvvvv This fixes the following commands that always printed debug messages at the trace level: tests/ampctld -l >/dev/null tests/ampctl -h >/dev/null tests/rigctld -l >/dev/null tests/rigctltcp -l >/dev/null tests/rotctld -l >/dev/null It doesn't affect other software which worked around this issue, but changes all software to avoid regressions in future. Test case (should print nothing in bash): { tests/ampctl -l -h tests/ampctld -l -h tests/rigctl -l -h tests/rigctlcom -l -h tests/rigctld -l -h tests/rigctlsync -l -h tests/rigctltcp -l -h tests/rotctl -l -h tests/rotctld -l -h } >/dev/null diff --git a/tests/ampctl.c b/tests/ampctl.c index 9b1884840..da664c31a 100644 --- a/tests/ampctl.c +++ b/tests/ampctl.c @@ -132,6 +132,7 @@ int main(int argc, char *argv[]) int serial_rate = 0; char conf_parms[MAXCONFLEN] = ""; + rig_set_debug(verbose); while (1) { int c; @@ -216,6 +217,7 @@ int main(int argc, char *argv[]) case 'v': verbose++; + rig_set_debug(verbose); break; case 'L': @@ -223,7 +225,6 @@ int main(int argc, char *argv[]) break; case 'l': - rig_set_debug(0); list_models(); exit(0); @@ -241,8 +242,6 @@ int main(int argc, char *argv[]) } } - rig_set_debug(verbose); - rig_debug(RIG_DEBUG_VERBOSE, "ampctl %s\n", hamlib_version2); rig_debug(RIG_DEBUG_VERBOSE, "%s", "Report bugs to <ham...@li...>\n\n"); diff --git a/tests/ampctld.c b/tests/ampctld.c index ece010532..89baf9c62 100644 --- a/tests/ampctld.c +++ b/tests/ampctld.c @@ -179,6 +179,7 @@ int main(int argc, char *argv[]) #endif #endif + rig_set_debug(verbose); while (1) { int c; @@ -245,6 +246,7 @@ int main(int argc, char *argv[]) case 'v': verbose++; + rig_set_debug(verbose); break; case 'L': @@ -269,8 +271,6 @@ int main(int argc, char *argv[]) } } - rig_set_debug(verbose); - rig_debug(RIG_DEBUG_VERBOSE, "ampctld, %s\n", hamlib_version2); rig_debug(RIG_DEBUG_VERBOSE, "%s", "Report bugs to <ham...@li...>\n\n"); diff --git a/tests/rigctl.c b/tests/rigctl.c index 98371ae0b..e001ab4bc 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -240,6 +240,7 @@ int main(int argc, char *argv[]) if (err) { rig_debug(RIG_DEBUG_ERR, "%s: setvbuf err=%s\n", __func__, strerror(err)); } + rig_set_debug(verbose); while (1) { int c; @@ -438,6 +439,7 @@ int main(int argc, char *argv[]) case 'v': verbose++; + rig_set_debug(verbose); break; case 'L': @@ -445,7 +447,6 @@ int main(int argc, char *argv[]) break; case 'l': - rig_set_debug(verbose); list_models(); exit(0); @@ -467,8 +468,6 @@ int main(int argc, char *argv[]) } } - rig_set_debug(verbose); - SNPRINTF(rigstartup, sizeof(rigstartup), "%s(%d) Startup:", __FILE__, __LINE__); for (i = 0; i < argc; ++i) { strcat(rigstartup, " "); strcat(rigstartup, argv[i]); } diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index 1e5dc182f..255628cd0 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -227,6 +227,7 @@ int main(int argc, char *argv[]) printf("rigctlcom Version 1.6\n"); + rig_set_debug(verbose); while (1) { int c; @@ -379,6 +380,7 @@ int main(int argc, char *argv[]) case 'v': verbose++; + rig_set_debug(verbose); break; case 'L': @@ -386,7 +388,6 @@ int main(int argc, char *argv[]) break; case 'l': - rig_set_debug(verbose); list_models(); exit(0); @@ -404,8 +405,6 @@ int main(int argc, char *argv[]) } } - rig_set_debug(verbose); - rig_debug(RIG_DEBUG_VERBOSE, "%s, %s\n", "rigctlcom", hamlib_version2); rig_debug(RIG_DEBUG_VERBOSE, "%s", "Report bugs to <ham...@li...>\n\n"); diff --git a/tests/rigctld.c b/tests/rigctld.c index 6930a1f3a..1f291de61 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -288,7 +288,7 @@ int main(int argc, char *argv[]) if (err) { rig_debug(RIG_DEBUG_ERR, "%s: setvbuf err=%s\n", __func__, strerror(err)); } - + rig_set_debug(verbose); while (1) { int c; @@ -494,6 +494,7 @@ int main(int argc, char *argv[]) case 'v': verbose++; + rig_set_debug(verbose); break; case 'L': @@ -546,8 +547,6 @@ int main(int argc, char *argv[]) #endif - rig_set_debug(verbose); - SNPRINTF(rigstartup, sizeof(rigstartup), "%s(%d) Startup:", __FILE__, __LINE__); for (i = 0; i < argc; ++i) { strcat(rigstartup, " "); strcat(rigstartup, argv[i]); } diff --git a/tests/rigctlsync.c b/tests/rigctlsync.c index d42bf0823..9e332a426 100644 --- a/tests/rigctlsync.c +++ b/tests/rigctlsync.c @@ -215,6 +215,7 @@ int main(int argc, char *argv[]) printf("rigctlsync Version 1.0\n"); + rig_set_debug(verbose); while (1) { int c; @@ -388,6 +389,7 @@ int main(int argc, char *argv[]) case 'v': verbose++; + rig_set_debug(verbose); break; case 'L': @@ -395,7 +397,6 @@ int main(int argc, char *argv[]) break; case 'l': - rig_set_debug(verbose); list_models(); exit(0); @@ -413,8 +414,6 @@ int main(int argc, char *argv[]) } } - rig_set_debug(verbose); - rig_debug(RIG_DEBUG_VERBOSE, "%s, %s\n", "rigctlsync", hamlib_version2); rig_debug(RIG_DEBUG_VERBOSE, "%s", "Report bugs to <ham...@li...>\n\n"); diff --git a/tests/rigctltcp.c b/tests/rigctltcp.c index a927cd37d..0aef3a708 100644 --- a/tests/rigctltcp.c +++ b/tests/rigctltcp.c @@ -289,7 +289,7 @@ int main(int argc, char *argv[]) if (err) { rig_debug(RIG_DEBUG_ERR, "%s: setvbuf err=%s\n", __func__, strerror(err)); } - + rig_set_debug(verbose); while (1) { int c; @@ -481,6 +481,7 @@ int main(int argc, char *argv[]) case 'v': verbose++; + rig_set_debug(verbose); break; case 'L': @@ -548,8 +549,6 @@ int main(int argc, char *argv[]) #endif - rig_set_debug(verbose); - SNPRINTF(rigstartup, sizeof(rigstartup), "%s(%d) Startup:", __FILE__, __LINE__); for (i = 0; i < argc; ++i) { strcat(rigstartup, " "); strcat(rigstartup, argv[i]); } diff --git a/tests/rigmem.c b/tests/rigmem.c index e3dc115ab..4314e1c2a 100644 --- a/tests/rigmem.c +++ b/tests/rigmem.c @@ -105,6 +105,7 @@ int main(int argc, char *argv[]) char conf_parms[MAXCONFLEN] = ""; extern char csv_sep; + rig_set_debug(verbose); while (1) { int c; @@ -182,6 +183,7 @@ int main(int argc, char *argv[]) case 'v': verbose++; + rig_set_debug(verbose); break; default: diff --git a/tests/rigsmtr.c b/tests/rigsmtr.c index b09b6208b..132422ccb 100644 --- a/tests/rigsmtr.c +++ b/tests/rigsmtr.c @@ -89,6 +89,7 @@ int main(int argc, char *argv[]) elevation_t elevation; unsigned step = 1000000; /* 1e6 us */ + rig_set_debug(verbose); while (1) { int c; @@ -172,6 +173,7 @@ int main(int argc, char *argv[]) case 'v': verbose++; + rig_set_debug(verbose); break; default: diff --git a/tests/rigswr.c b/tests/rigswr.c index 995b79a30..e4f64e562 100644 --- a/tests/rigswr.c +++ b/tests/rigswr.c @@ -79,6 +79,7 @@ int main(int argc, char *argv[]) freq_t step = kHz(100); value_t pwr; + rig_set_debug(verbose); while (1) { int c; @@ -173,6 +174,7 @@ int main(int argc, char *argv[]) case 'v': verbose++; + rig_set_debug(verbose); break; default: diff --git a/tests/rotctl.c b/tests/rotctl.c index 88af56f05..fd740c2d2 100644 --- a/tests/rotctl.c +++ b/tests/rotctl.c @@ -140,6 +140,7 @@ int main(int argc, char *argv[]) azimuth_t az_offset = 0; elevation_t el_offset = 0; + rig_set_debug(verbose); while (1) { int c; @@ -237,6 +238,7 @@ int main(int argc, char *argv[]) case 'v': verbose++; + rig_set_debug(verbose); break; case 'L': @@ -244,7 +246,6 @@ int main(int argc, char *argv[]) break; case 'l': - rig_set_debug(0); list_models(); exit(0); @@ -262,8 +263,6 @@ int main(int argc, char *argv[]) } } - rig_set_debug(verbose); - rig_debug(RIG_DEBUG_VERBOSE, "rotctl %s\n", hamlib_version2); rig_debug(RIG_DEBUG_VERBOSE, "%s", "Report bugs to <ham...@li...>\n\n"); diff --git a/tests/rotctld.c b/tests/rotctld.c index 1734ff347..405591bb6 100644 --- a/tests/rotctld.c +++ b/tests/rotctld.c @@ -172,6 +172,7 @@ int main(int argc, char *argv[]) #endif struct handle_data *arg; + rig_set_debug(verbose); while (1) { int c; @@ -250,6 +251,7 @@ int main(int argc, char *argv[]) case 'v': verbose++; + rig_set_debug(verbose); break; case 'L': @@ -274,8 +276,6 @@ int main(int argc, char *argv[]) } } - rig_set_debug(verbose); - rig_debug(RIG_DEBUG_VERBOSE, "rotctld, %s\n", hamlib_version2); rig_debug(RIG_DEBUG_VERBOSE, "%s", "Report bugs to <ham...@li...>\n\n"); commit 5a001ab3aa31b7d2458f54d998f3281f9bf5cb13 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Thu Aug 14 20:30:56 2025 +0200 Explicitely initialize static int verbose diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index 3471e9f18..1e5dc182f 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -119,7 +119,7 @@ static int handle_ts2000(void *arg); static RIG *my_rig; /* handle to rig */ static hamlib_port_t my_com; /* handle to virtual COM port */ -static int verbose; +static int verbose = RIG_DEBUG_NONE; /* CW Skimmer can only set VFOA */ /* IC7300 for example can run VFOA on FM and VFOB on CW */ /* So -A/--mapa2b changes set_freq on VFOA to VFOB */ diff --git a/tests/rigctld.c b/tests/rigctld.c index 31f65e94c..6930a1f3a 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -135,7 +135,7 @@ static unsigned client_count; static RIG *my_rig; /* handle to rig (instance) */ static volatile int rig_opened = 0; -static int verbose; +static int verbose = RIG_DEBUG_NONE; #ifdef HAVE_SIG_ATOMIC_T static sig_atomic_t volatile ctrl_c = 0; diff --git a/tests/rigctlsync.c b/tests/rigctlsync.c index ef563888d..d42bf0823 100644 --- a/tests/rigctlsync.c +++ b/tests/rigctlsync.c @@ -109,7 +109,7 @@ void usage(); static RIG *my_rig; /* handle to rig */ static RIG *my_rig_sync; /* rig the gets synchronized -- freq only for now */ -static int verbose; +static int verbose = RIG_DEBUG_NONE; /* CW Skimmer can only set VFOA */ /* IC7300 for example can run VFOA on FM and VFOB on CW */ /* So -A/--mapa2b changes set_freq on VFOA to VFOB */ diff --git a/tests/rigctltcp.c b/tests/rigctltcp.c index e965a1a88..a927cd37d 100644 --- a/tests/rigctltcp.c +++ b/tests/rigctltcp.c @@ -139,7 +139,7 @@ static unsigned client_count; static RIG *my_rig; /* handle to rig (instance) */ static volatile int rig_opened = 0; -static int verbose; +static int verbose = RIG_DEBUG_NONE; #ifdef HAVE_SIG_ATOMIC_T static sig_atomic_t volatile ctrl_c; commit ead67ec17005f5aa2790d429dd72a39c9dead7e1 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Thu Aug 14 20:20:34 2025 +0200 Replace magic number with define diff --git a/tests/ampctl.c b/tests/ampctl.c index 321dde1ec..9b1884840 100644 --- a/tests/ampctl.c +++ b/tests/ampctl.c @@ -116,7 +116,7 @@ int main(int argc, char *argv[]) int retcode; /* generic return code from functions */ int exitcode; - int verbose = 0; + int verbose = RIG_DEBUG_NONE; int show_conf = 0; int dump_caps_opt = 0; diff --git a/tests/ampctld.c b/tests/ampctld.c index b03d2f2c8..ece010532 100644 --- a/tests/ampctld.c +++ b/tests/ampctld.c @@ -155,7 +155,7 @@ int main(int argc, char *argv[]) int retcode; /* generic return code from functions */ - int verbose = 0; + int verbose = RIG_DEBUG_NONE; int show_conf = 0; int dump_caps_opt = 0; const char *amp_file = NULL; diff --git a/tests/rigctl.c b/tests/rigctl.c index 0d5d772f9..98371ae0b 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -203,7 +203,7 @@ int main(int argc, char *argv[]) int retcode; /* generic return code from functions */ int exitcode; - int verbose = 0; + int verbose = RIG_DEBUG_NONE; int show_conf = 0; int dump_caps_opt = 0; int ignore_rig_open_error = 0; diff --git a/tests/rigmem.c b/tests/rigmem.c index be307f2c5..e3dc115ab 100644 --- a/tests/rigmem.c +++ b/tests/rigmem.c @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) int retcode; /* generic return code from functions */ - int verbose = 0; + int verbose = RIG_DEBUG_NONE; #ifdef HAVE_XML2 int xml = 0; #endif diff --git a/tests/rigsmtr.c b/tests/rigsmtr.c index 8e67f3073..b09b6208b 100644 --- a/tests/rigsmtr.c +++ b/tests/rigsmtr.c @@ -76,7 +76,7 @@ int main(int argc, char *argv[]) int retcode; /* generic return code from functions */ - int verbose = 0; + int verbose = RIG_DEBUG_NONE; const char *rig_file = NULL, *rot_file = NULL; int serial_rate = 0; int rot_serial_rate = 0; diff --git a/tests/rigswr.c b/tests/rigswr.c index 766ed74f5..995b79a30 100644 --- a/tests/rigswr.c +++ b/tests/rigswr.c @@ -69,7 +69,7 @@ int main(int argc, char *argv[]) int retcode; /* generic return code from functions */ - int verbose = 0; + int verbose = RIG_DEBUG_NONE; const char *rig_file = NULL, *ptt_file = NULL; ptt_type_t ptt_type = RIG_PTT_NONE; int serial_rate = 0; diff --git a/tests/rotctl.c b/tests/rotctl.c index 1be198500..88af56f05 100644 --- a/tests/rotctl.c +++ b/tests/rotctl.c @@ -118,7 +118,7 @@ int main(int argc, char *argv[]) int retcode; /* generic return code from functions */ int exitcode; - int verbose = 0; + int verbose = RIG_DEBUG_NONE; int show_conf = 0; int dump_caps_opt = 0; diff --git a/tests/rotctld.c b/tests/rotctld.c index 454def788..1734ff347 100644 --- a/tests/rotctld.c +++ b/tests/rotctld.c @@ -152,7 +152,7 @@ int main(int argc, char *argv[]) int retcode; /* generic return code from functions */ - int verbose = 0; + int verbose = RIG_DEBUG_NONE; int show_conf = 0; int dump_caps_opt = 0; const char *rot_file = NULL; ----------------------------------------------------------------------- Summary of changes: tests/ampctl.c | 7 +++---- tests/ampctld.c | 6 +++--- tests/rigctl.c | 7 +++---- tests/rigctlcom.c | 7 +++---- tests/rigctld.c | 7 +++---- tests/rigctlsync.c | 7 +++---- tests/rigctltcp.c | 7 +++---- tests/rigmem.c | 4 +++- tests/rigsmtr.c | 4 +++- tests/rigswr.c | 4 +++- tests/rotctl.c | 7 +++---- tests/rotctld.c | 6 +++--- 12 files changed, 36 insertions(+), 37 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-20 01:44:41
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via d6165f74115aa4794ebacc7d775477eaacd02445 (commit) via 7a9e101b9d81e341f9d4a7cbb11f286fe5b1a45c (commit) from db7219b731e8c4f68e54a05e7ed4248c6a59c239 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d6165f74115aa4794ebacc7d775477eaacd02445 Merge: db7219b73 7a9e101b9 Author: Nate Bargmann <n0...@n0...> Date: Tue Aug 19 20:21:03 2025 -0500 Merge GitHub PR #1859 commit 7a9e101b9d81e341f9d4a7cbb11f286fe5b1a45c Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Tue Aug 19 19:41:26 2025 +0200 Add missing string form for RIG_FUNC_SLICE diff --git a/src/misc.c b/src/misc.c index fa2308f54..c87f9b3b0 100644 --- a/src/misc.c +++ b/src/misc.c @@ -736,6 +736,7 @@ static const struct { RIG_FUNC_DIVERSITY, "DIVERSITY"}, { RIG_FUNC_CSQL, "CSQL" }, { RIG_FUNC_SCEN, "SCEN" }, + { RIG_FUNC_SLICE, "SLICE" }, { RIG_FUNC_TRANSCEIVE, "TRANSCEIVE" }, { RIG_FUNC_SPECTRUM, "SPECTRUM" }, { RIG_FUNC_SPECTRUM_HOLD, "SPECTRUM_HOLD" }, ----------------------------------------------------------------------- Summary of changes: src/misc.c | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-20 01:19:52
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via db7219b731e8c4f68e54a05e7ed4248c6a59c239 (commit) via a0fa2def82abd321aa547e1f7ba5cf7417dfe359 (commit) via 90ffcadfa516176e26275b680baa68a689bd5dc1 (commit) via 67038154db238bec7b51cc66417665c9ee828918 (commit) via 7fce140970f93569b68af6dbe5e18b1092633d63 (commit) from 285b44add695c6c84d9b2b47c9632a44bbd1b802 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit db7219b731e8c4f68e54a05e7ed4248c6a59c239 Merge: 285b44add a0fa2def8 Author: Nate Bargmann <n0...@n0...> Date: Tue Aug 19 20:05:20 2025 -0500 Merge GitHub PR #1858 commit a0fa2def82abd321aa547e1f7ba5cf7417dfe359 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Fri Aug 15 18:10:08 2025 +0200 Refactor to remove code duplication in rotctl*.c diff --git a/tests/rotctl.c b/tests/rotctl.c index 6817977f0..1be198500 100644 --- a/tests/rotctl.c +++ b/tests/rotctl.c @@ -509,6 +509,4 @@ void usage() ); usage_rot(stdout); - - printf("\nReport bugs to <ham...@li...>.\n"); } diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c index 62ab4bcf1..fa2c69f0a 100644 --- a/tests/rotctl_parse.c +++ b/tests/rotctl_parse.c @@ -1572,6 +1572,8 @@ void usage_rot(FILE *fout) "Commands and arguments read from standard input must be white space separated,\n" "comments are allowed, comments start with the # character and continue to the\n" "end of the line.\n"); + + fprintf(fout, "\nReport bugs to <ham...@li...>.\n"); } diff --git a/tests/rotctld.c b/tests/rotctld.c index c3dedb52f..454def788 100644 --- a/tests/rotctld.c +++ b/tests/rotctld.c @@ -734,6 +734,4 @@ void usage() portno); usage_rot(stdout); - - printf("\nReport bugs to <ham...@li...>.\n"); } commit 90ffcadfa516176e26275b680baa68a689bd5dc1 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Fri Aug 15 18:08:06 2025 +0200 Refactor to remove code duplication in ampctl*.c diff --git a/tests/ampctl.c b/tests/ampctl.c index bc250e16b..321dde1ec 100644 --- a/tests/ampctl.c +++ b/tests/ampctl.c @@ -466,6 +466,4 @@ void usage() ); usage_amp(stdout); - - printf("\nReport bugs to <ham...@li...>.\n"); } diff --git a/tests/ampctl_parse.c b/tests/ampctl_parse.c index 44705b8d5..e47b6c1ff 100644 --- a/tests/ampctl_parse.c +++ b/tests/ampctl_parse.c @@ -1492,6 +1492,8 @@ void usage_amp(FILE *fout) "Commands and arguments read from standard input must be white space separated,\n" "comments are allowed, comments start with the # character and continue to the\n" "end of the line.\n"); + + fprintf(fout, "\nReport bugs to <ham...@li...>.\n"); } diff --git a/tests/ampctld.c b/tests/ampctld.c index d5c49ff0b..b03d2f2c8 100644 --- a/tests/ampctld.c +++ b/tests/ampctld.c @@ -705,6 +705,4 @@ void usage() portno); usage_amp(stdout); - - printf("\nReport bugs to <ham...@li...>.\n"); } commit 67038154db238bec7b51cc66417665c9ee828918 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Fri Aug 15 18:04:30 2025 +0200 Refactor to remove code duplication in rigctl*.c diff --git a/tests/rigctl.c b/tests/rigctl.c index 8db08d10c..0d5d772f9 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -910,14 +910,4 @@ void usage(void) ); usage_rig(stdout); - - printf("\nError codes and messages\n"); - - for (enum rig_errcode_e e = 0; e < RIG_EEND; ++e) - { - printf("-%d - %s", e, rigerror2(e)); - } - - printf("\nReport bugs to <ham...@li...>.\n"); - } diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 711dd7502..689c90e0f 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -2005,6 +2005,15 @@ void usage_rig(FILE *fout) "Commands and arguments read from standard input must be white space separated,\n" "comments are allowed, comments start with the # character and continue to the\n" "end of the line.\n"); + + fprintf(fout, "\nError codes and messages\n"); + + for (enum rig_errcode_e e = 0; e < RIG_EEND; ++e) + { + fprintf(fout, "-%d - %s", e, rigerror2(e)); + } + + fprintf(fout, "\nReport bugs to <ham...@li...>.\n"); } diff --git a/tests/rigctld.c b/tests/rigctld.c index 778f24a70..31f65e94c 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -1448,15 +1448,4 @@ void usage(void) portno); usage_rig(stdout); - - printf("\nError codes and messages\n"); - - for (enum rig_errcode_e e = 0; e < RIG_EEND; ++e) - { - printf("-%d - %s", e, rigerror2(e)); - } - - - printf("\nReport bugs to <ham...@li...>.\n"); - } diff --git a/tests/rigctltcp.c b/tests/rigctltcp.c index 59c383677..e965a1a88 100644 --- a/tests/rigctltcp.c +++ b/tests/rigctltcp.c @@ -1451,15 +1451,4 @@ void usage(void) portno); usage_rig(stdout); - - printf("\nError codes and messages\n"); - - for (enum rig_errcode_e e = 0; e < RIG_EEND; ++e) - { - printf("-%d - %s", e, rigerror2(e)); - } - - - printf("\nReport bugs to <ham...@li...>.\n"); - } commit 7fce140970f93569b68af6dbe5e18b1092633d63 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Thu Aug 14 23:16:17 2025 +0200 Make help texts more similar diff --git a/tests/ampctl.c b/tests/ampctl.c index 3add9ce6e..bc250e16b 100644 --- a/tests/ampctl.c +++ b/tests/ampctl.c @@ -449,7 +449,7 @@ void usage() " -r, --amp-file=DEVICE set device of the amplifier to operate on\n" " -s, --serial-speed=BAUD set serial speed of the serial port\n" " -t, --send-cmd-term=CHAR set send_cmd command termination char\n" - " -C, --set-conf=PARM=VAL set config parameters\n" + " -C, --set-conf=PARM=VAL[,...] set config parameters\n" " -L, --show-conf list all config parameters\n" " -l, --list list all model numbers and exit\n" " -u, --dump-caps dump capabilities and exit\n" diff --git a/tests/ampctld.c b/tests/ampctld.c index 2c0a5ec81..d5c49ff0b 100644 --- a/tests/ampctld.c +++ b/tests/ampctld.c @@ -694,7 +694,7 @@ void usage() " -s, --serial-speed=BAUD set serial speed of the serial port\n" " -t, --port=NUM set TCP listening port, default %s\n" " -T, --listen-addr=IPADDR set listening IP address, default ANY\n" - " -C, --set-conf=PARM=VAL set config parameters\n" + " -C, --set-conf=PARM=VAL[,...] set config parameters\n" " -L, --show-conf list all config parameters\n" " -l, --list list all model numbers and exit\n" " -u, --dump-caps dump capabilities and exit\n" diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index 405520b29..3471e9f18 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -1715,7 +1715,7 @@ void usage() " -s, --serial-speed=BAUD set serial speed of the serial port\n" " -S, --serial-speed2=BAUD set serial speed of the virtual com port [default=115200]\n" " -c, --civaddr=ID set CI-V address, decimal (for Icom rigs only)\n" - " -C, --set-conf=PARM=VAL set config parameters\n" + " -C, --set-conf=PARM=VAL[,...] set config parameters\n" " -B, --mapa2b map set_freq on VFOA to VFOB -- useful for CW Skimmer\n" " -L, --show-conf list all config parameters\n" " -l, --list list all model numbers and exit\n" diff --git a/tests/rigctld.c b/tests/rigctld.c index 0c502cf0b..778f24a70 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -1438,7 +1438,7 @@ void usage(void) " -v, --verbose set verbose mode, cumulative (-v to -vvvvv)\n" " -W, --twiddle_timeout=SECONDS timeout after detecting vfo manual change\n" " -w, --twiddle_rit=SECONDS suppress VFOB getfreq so RIT can be twiddled\n" - " -x, --uplink=OPTION set uplink get_freq ignore: option 1=Sub, 2=Main\n" + " -x, --uplink=OPTION set uplink get_freq ignore, option 1=Sub, 2=Main\n" " -Z, --debug-time-stamps enable time stamps for debug messages\n" " -A, --password=PASSWORD set password for rigctld access (NOT IMPLEMENTED)\n" " -R, --rigctld-idle make rigctld close the rig when no clients are connected\n" diff --git a/tests/rigctlsync.c b/tests/rigctlsync.c index 7b70df398..ef563888d 100644 --- a/tests/rigctlsync.c +++ b/tests/rigctlsync.c @@ -611,7 +611,7 @@ void usage() " -s, --serial-speed=BAUD set serial speed of the serial port\n" " -S, --serial-speed2=BAUD set serial speed of the virtual com port [default=115200]\n" " -c, --civaddr=ID set CI-V address, decimal (for Icom rigs only)\n" - " -C, --set-conf=PARM=VAL set config parameters\n" + " -C, --set-conf=PARM=VAL[,...] set config parameters\n" " -L, --show-conf list all config parameters\n" " -l, --list list all model numbers and exit\n" " -u, --dump-caps dump capabilities and exit\n" diff --git a/tests/rigctltcp.c b/tests/rigctltcp.c index b3cd4b398..59c383677 100644 --- a/tests/rigctltcp.c +++ b/tests/rigctltcp.c @@ -1432,7 +1432,7 @@ void usage(void) " -t, --port=NUM set TCP listening port, default %s\n" " -S, --separator=CHAR set char as rigctld response separator, default is \\n\n" " -T, --listen-addr=IPADDR set listening IP address, default ANY\n" - " -C, --set-conf=PARM=VAL set config parameters\n" + " -C, --set-conf=PARM=VAL[,...] set config parameters\n" " -L, --show-conf list all config parameters\n" " -l, --list list all model numbers and exit\n" " -u, --dump-caps dump capabilities and exit\n" @@ -1440,7 +1440,7 @@ void usage(void) " -v, --verbose set verbose mode, cumulative (-v to -vvvvv)\n" " -W, --twiddle_timeout=SECONDS timeout after detecting vfo manual change\n" " -w, --twiddle_rit=SECONDS suppress VFOB getfreq so RIT can be twiddled\n" - " -x, --uplink set uplink get_freq ignore, 1=Sub, 2=Main\n" + " -x, --uplink=OPTION set uplink get_freq ignore, option 1=Sub, 2=Main\n" " -Z, --debug-time-stamps enable time stamps for debug messages\n" " -M, --multicast-addr=ADDR set multicast UDP address, default 0.0.0.0 (off), recommend 224.0.1.1\n" " -n, --multicast-port=PORT set multicast UDP port, default 4531\n" diff --git a/tests/rigmem.c b/tests/rigmem.c index 084d59399..be307f2c5 100644 --- a/tests/rigmem.c +++ b/tests/rigmem.c @@ -382,7 +382,7 @@ void usage() " -r, --rig-file=DEVICE set device of the radio to operate on\n" " -s, --serial-speed=BAUD set serial speed of the serial port\n" " -c, --civaddr=ID set CI-V address, decimal (for Icom rigs only)\n" - " -C, --set-conf=PARM=VAL set config parameters\n" + " -C, --set-conf=PARM=VAL[,...] set config parameters\n" " -p, --set-separator=CHAR set character separator instead of the CSV comma\n" " -a, --all bypass mem_caps, apply to all fields of channel_t\n" #ifdef HAVE_XML2 ----------------------------------------------------------------------- Summary of changes: tests/ampctl.c | 4 +--- tests/ampctl_parse.c | 2 ++ tests/ampctld.c | 4 +--- tests/rigctl.c | 10 ---------- tests/rigctl_parse.c | 9 +++++++++ tests/rigctlcom.c | 2 +- tests/rigctld.c | 13 +------------ tests/rigctlsync.c | 2 +- tests/rigctltcp.c | 15 ++------------- tests/rigmem.c | 2 +- tests/rotctl.c | 2 -- tests/rotctl_parse.c | 2 ++ tests/rotctld.c | 2 -- 13 files changed, 21 insertions(+), 48 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-20 01:04:19
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 285b44add695c6c84d9b2b47c9632a44bbd1b802 (commit) via 6049d020a5a3429a51355a9def6d6610dd56a8f4 (commit) from e2ced58a143bdbefe388f16f5a50bbbed7b80255 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 285b44add695c6c84d9b2b47c9632a44bbd1b802 Merge: e2ced58a1 6049d020a Author: Nate Bargmann <n0...@n0...> Date: Tue Aug 19 19:50:45 2025 -0500 Merge GitHub PR #1857 commit 6049d020a5a3429a51355a9def6d6610dd56a8f4 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Tue Aug 19 10:30:32 2025 +0200 Fix compiler errors Adds the needed const qualifier. Fixes: rigmatrix.c:699:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types] rigmatrix.c:706:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types] rigmatrix.c:728:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types] rigmatrix.c:762:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types] rigmatrix.c:771:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types] rigmatrix.c:805:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types] rigmatrix.c:814:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types] rigmatrix.c:848:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types] rigmatrix.c:857:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types] rigmatrix.c:891:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types] diff --git a/tests/rigmatrix.c b/tests/rigmatrix.c index cb2f198da..639668b7d 100644 --- a/tests/rigmatrix.c +++ b/tests/rigmatrix.c @@ -37,7 +37,7 @@ static setting_t bitmap_func, bitmap_level, bitmap_parm, bitmap_vfo_ops; static int create_png_range(const freq_range_t rx_range_list[], const freq_range_t tx_range_list[], int num); -int print_caps_sum(struct rig_caps *caps, void *data) +int print_caps_sum(const struct rig_caps *caps, void *data) { printf("<TR><TD><A HREF=\"support/model%u.txt\">%s</A></TD><TD>%s</TD>" @@ -112,7 +112,7 @@ int print_caps_sum(struct rig_caps *caps, void *data) /* * IO params et al. */ -static int print_caps_parameters(struct rig_caps *caps, void *data) +static int print_caps_parameters(const struct rig_caps *caps, void *data) { printf("<A NAME=\"parms%u\"><TR><TD>%s</TD><TD>", caps->rig_model, @@ -223,7 +223,7 @@ static int print_caps_parameters(struct rig_caps *caps, void *data) * * TODO: add new API calls! */ -static int print_caps_caps(struct rig_caps *caps, void *data) +static int print_caps_caps(const struct rig_caps *caps, void *data) { printf("<A NAME=\"caps%u\"><TR><TD>%s</TD>", caps->rig_model, @@ -271,7 +271,7 @@ static int print_caps_caps(struct rig_caps *caps, void *data) /* * Get/Set parm abilities */ -static int print_caps_parm(struct rig_caps *caps, void *data) +static int print_caps_parm(const struct rig_caps *caps, void *data) { setting_t parm; int i; @@ -307,7 +307,7 @@ static int print_caps_parm(struct rig_caps *caps, void *data) /* * VFO Ops capabilities */ -static int print_caps_vfo_ops(struct rig_caps *caps, void *data) +static int print_caps_vfo_ops(const struct rig_caps *caps, void *data) { setting_t vfo_ops; int i; @@ -345,7 +345,7 @@ static int print_caps_vfo_ops(struct rig_caps *caps, void *data) /* * Get/Set level abilities */ -static int print_caps_level(struct rig_caps *caps, void *data) +static int print_caps_level(const struct rig_caps *caps, void *data) { setting_t level; int i; @@ -382,7 +382,7 @@ static int print_caps_level(struct rig_caps *caps, void *data) /* * Get/Set func abilities */ -static int print_caps_func(struct rig_caps *caps, void *data) +static int print_caps_func(const struct rig_caps *caps, void *data) { setting_t func; int i; @@ -421,7 +421,7 @@ static int print_caps_func(struct rig_caps *caps, void *data) * * FIXME: default output pics is for region2: add region 1 too! */ -static int print_caps_range(struct rig_caps *caps, void *data) +static int print_caps_range(const struct rig_caps *caps, void *data) { create_png_range(caps->rx_range_list2, caps->tx_range_list2, caps->rig_model); ----------------------------------------------------------------------- Summary of changes: tests/rigmatrix.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-19 18:26:48
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via e2ced58a143bdbefe388f16f5a50bbbed7b80255 (commit) via 7746d5943863c1e254cc8ea22a92b72c4e143c6b (commit) from c4aad6e0ec4faac50d3050688af1f9ff5135c9ea (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e2ced58a143bdbefe388f16f5a50bbbed7b80255 Merge: c4aad6e0e 7746d5943 Author: Nate Bargmann <n0...@n0...> Date: Tue Aug 19 13:23:37 2025 -0500 Merge GitHub PR #1855 commit 7746d5943863c1e254cc8ea22a92b72c4e143c6b Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Tue Aug 19 08:58:43 2025 +0200 Implement get_agc for flrig 2.0.06+ Test case: run: flrig configured for the rig in use run: tests/rigctl -m 4 get_level AGC expected: should print an enum agc_level_e (an integer in range 0..10) Part of issue #1376. diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index b378fa360..597856cab 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -54,7 +54,7 @@ RIG_MODE_FM | RIG_MODE_WFM | RIG_MODE_FMN | RIG_MODE_PKTFM |\ RIG_MODE_C4FM | RIG_MODE_DSTAR) -#define FLRIG_LEVELS (RIG_LEVEL_AF | RIG_LEVEL_RF | RIG_LEVEL_MICGAIN | RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER_METER | RIG_LEVEL_RFPOWER_METER_WATTS | RIG_LEVEL_RFPOWER | RIG_LEVEL_SWR) +#define FLRIG_LEVELS (RIG_LEVEL_AF | RIG_LEVEL_AGC | RIG_LEVEL_RF | RIG_LEVEL_MICGAIN | RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER_METER | RIG_LEVEL_RFPOWER_METER_WATTS | RIG_LEVEL_RFPOWER | RIG_LEVEL_SWR) #define FLRIG_PARM (TOK_FLRIG_VERIFY_FREQ|TOK_FLRIG_VERIFY_PTT) @@ -2377,6 +2377,8 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RFPOWER_METER_WATTS: case RIG_LEVEL_RFPOWER_METER: cmd = "rig.get_pwrmeter"; break; + case RIG_LEVEL_AGC: cmd = "rig.get_agc"; break; // flrig 2.0.6+ + default: rig_debug(RIG_DEBUG_ERR, "%s: unknown level=%d\n", __func__, (int)level); RETURNFUNC(-RIG_EINVAL); @@ -2435,6 +2437,11 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rig_debug(RIG_DEBUG_TRACE, "%s: val.f='%s'(%g)\n", __func__, value, val->f); break; + case RIG_LEVEL_AGC: // flrig 2.0.6+ + val->i = atoi(value); + rig_debug(RIG_DEBUG_TRACE, "%s: val.i='%s'(%d)\n", __func__, value, val->i); + break; + default: val->f = atof(value) / 100; rig_debug(RIG_DEBUG_TRACE, "%s: val.f='%s'(%f)\n", __func__, value, val->f); ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-19 18:22:02
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via c4aad6e0ec4faac50d3050688af1f9ff5135c9ea (commit) via a8a53124df3d3205eb4114cb58e950eab54fc2c2 (commit) via c5668bf75ae9fdf820e8130ddd7eca4b06102182 (commit) from ab311ac97b13f17c93dd198fa9cb8a8bc4d44090 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c4aad6e0ec4faac50d3050688af1f9ff5135c9ea Merge: ab311ac97 a8a53124d Author: Nate Bargmann <n0...@n0...> Date: Tue Aug 19 13:18:47 2025 -0500 Merge GitHub PR #1854 commit a8a53124df3d3205eb4114cb58e950eab54fc2c2 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Mon Aug 18 12:17:56 2025 +0200 freq_skip is a configuration parameter, not a command diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 4cec60e13..4dbe56bec 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -199,6 +199,7 @@ Set configuration parameter(s). Some common ones are: .BR dcd_pathname: "Path name to the device file of the Data Carrier Detect (or squelch)" .BR disable_yaesu_bandselect: "True disables the automatic band select on band change for Yaesu rigs" .BR dtr_state: "ON turns on DTR, OFF turns it off, Unset disables it" +.BR freq_skip: "!=0 skips setting freq on TX_VFO when in RX and on RX_VFO when in TX -- for use with gpredict and rigs that do not have TARGETABLE_VFO .BR lo_freq: "Frequency to add to the VFO frequency for use with a transverter" .BR post_write_delay: "Delay in ms between each command sent out" .BR ptt_share: "True enables ptt port to be shared with other apps" @@ -1559,10 +1560,6 @@ Can also use 1,2,3,4 .BR skip_init Skips rig initialization -- useful when executing commands with rigctl to speed up things . -.TP -.BR freq_skip " " 'skip' -When skip!=0 skips setting freq on TX_VFO when in RX and on RX_VFO when in TX -- for use with gpredict and rigs that do not have TARGETABLE_VFO -. .SH READLINE . If commit c5668bf75ae9fdf820e8130ddd7eca4b06102182 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Mon Aug 18 12:11:06 2025 +0200 Add value 0/1 to description of set_gpio diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 557b3028c..4cec60e13 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -1546,7 +1546,7 @@ Returns Hamlib version with ISO8601 date/time Performs test routines. Under development. . .TP -.BR set_gpio " \(aq" \fIGPIO#\fP "\(aq +.BR set_gpio " \(aq" \fIGPIO#\fP "\(aq \(aq" \fI0/1\fP "\(aq Sets GPIO1, GPIO2, GPIO3, GPIO4 on the GPIO ptt port Can also use 1,2,3,4 . diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 20652967c..98e6786dc 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -1376,7 +1376,7 @@ Returns Hamlib version with ISO8601 date/time Performs test routines. Under development. . .TP -.BR set_gpio " \(aq" \fIGPIO#\fP "\(aq +.BR set_gpio " \(aq" \fIGPIO#\fP "\(aq \(aq" \fI0/1\fP "\(aq Sets GPIO1, GPIO2, GPIO3, GPIO4 on the GPIO ptt port Can also use 1,2,3,4 . ----------------------------------------------------------------------- Summary of changes: doc/man1/rigctl.1 | 7 ++----- doc/man1/rigctld.1 | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-19 18:18:13
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via ab311ac97b13f17c93dd198fa9cb8a8bc4d44090 (commit) via 55f575565c41ab9fb6dcab87cf8b4e4948880b8d (commit) via 512f5f94d04dc84c89e43a1c443f9f47df8c0960 (commit) from cde3a5943256e1193f52cfcc4b903810daa1be52 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ab311ac97b13f17c93dd198fa9cb8a8bc4d44090 Merge: cde3a5943 55f575565 Author: Nate Bargmann <n0...@n0...> Date: Tue Aug 19 13:06:34 2025 -0500 Merge GitHub PR #1852 commit 55f575565c41ab9fb6dcab87cf8b4e4948880b8d Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Mon Aug 18 10:50:51 2025 +0200 Handle missing enums diff --git a/tests/dumpcaps.c b/tests/dumpcaps.c index 2fcd2dafc..4c5805730 100644 --- a/tests/dumpcaps.c +++ b/tests/dumpcaps.c @@ -148,6 +148,18 @@ int dumpcaps(RIG *rig, FILE *fout) fprintf(fout, "Rig capable (Mic/Data)\n"); break; + case RIG_PTT_CM108: + fprintf(fout, "CM108 GPIO pin\n"); + break; + + case RIG_PTT_GPIO: + fprintf(fout, "GPIO pin\n"); + break; + + case RIG_PTT_GPION: + fprintf(fout, "GPIO pin inverted\n"); + break; + default: fprintf(fout, "Unknown\n"); strcat(warnbuf, " PTT_TYPE"); diff --git a/tests/dumpstate.c b/tests/dumpstate.c index 9d1ee719d..ff66ce54a 100644 --- a/tests/dumpstate.c +++ b/tests/dumpstate.c @@ -146,6 +146,18 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "Rig capable (Mic/Data)\n"); break; + case RIG_PTT_CM108: + fprintf(fout, "CM108 GPIO pin\n"); + break; + + case RIG_PTT_GPIO: + fprintf(fout, "GPIO pin\n"); + break; + + case RIG_PTT_GPION: + fprintf(fout, "GPIO pin inverted\n"); + break; + default: fprintf(fout, "Unknown\n"); strcat(warnbuf, " PTT_TYPE"); commit 512f5f94d04dc84c89e43a1c443f9f47df8c0960 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Mon Aug 18 10:28:19 2025 +0200 Put the switch cases in the same order as the enum To see what is missing. diff --git a/tests/dumpcaps.c b/tests/dumpcaps.c index 4185812b4..2fcd2dafc 100644 --- a/tests/dumpcaps.c +++ b/tests/dumpcaps.c @@ -124,28 +124,28 @@ int dumpcaps(RIG *rig, FILE *fout) switch (caps->ptt_type) { - case RIG_PTT_RIG: - fprintf(fout, "Rig capable\n"); + case RIG_PTT_NONE: + fprintf(fout, "None\n"); break; - case RIG_PTT_RIG_MICDATA: - fprintf(fout, "Rig capable (Mic/Data)\n"); + case RIG_PTT_RIG: + fprintf(fout, "Rig capable\n"); break; - case RIG_PTT_PARALLEL: - fprintf(fout, "Parallel port (DATA0)\n"); + case RIG_PTT_SERIAL_DTR: + fprintf(fout, "Serial port (DTR/DSR)\n"); break; case RIG_PTT_SERIAL_RTS: fprintf(fout, "Serial port (CTS/RTS)\n"); break; - case RIG_PTT_SERIAL_DTR: - fprintf(fout, "Serial port (DTR/DSR)\n"); + case RIG_PTT_PARALLEL: + fprintf(fout, "Parallel port (DATA0)\n"); break; - case RIG_PTT_NONE: - fprintf(fout, "None\n"); + case RIG_PTT_RIG_MICDATA: + fprintf(fout, "Rig capable (Mic/Data)\n"); break; default: diff --git a/tests/dumpstate.c b/tests/dumpstate.c index cf725d412..9d1ee719d 100644 --- a/tests/dumpstate.c +++ b/tests/dumpstate.c @@ -122,28 +122,28 @@ int dumpstate(RIG *rig, FILE *fout) switch (rs->ptt_type) { - case RIG_PTT_RIG: - fprintf(fout, "Rig capable\n"); + case RIG_PTT_NONE: + fprintf(fout, "None\n"); break; - case RIG_PTT_RIG_MICDATA: - fprintf(fout, "Rig capable (Mic/Data)\n"); + case RIG_PTT_RIG: + fprintf(fout, "Rig capable\n"); break; - case RIG_PTT_PARALLEL: - fprintf(fout, "Parallel port (DATA0)\n"); + case RIG_PTT_SERIAL_DTR: + fprintf(fout, "Serial port (DTR/DSR)\n"); break; case RIG_PTT_SERIAL_RTS: fprintf(fout, "Serial port (CTS/RTS)\n"); break; - case RIG_PTT_SERIAL_DTR: - fprintf(fout, "Serial port (DTR/DSR)\n"); + case RIG_PTT_PARALLEL: + fprintf(fout, "Parallel port (DATA0)\n"); break; - case RIG_PTT_NONE: - fprintf(fout, "None\n"); + case RIG_PTT_RIG_MICDATA: + fprintf(fout, "Rig capable (Mic/Data)\n"); break; default: ----------------------------------------------------------------------- Summary of changes: tests/dumpcaps.c | 28 ++++++++++++++++++++-------- tests/dumpstate.c | 28 ++++++++++++++++++++-------- 2 files changed, 40 insertions(+), 16 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-19 18:05:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via cde3a5943256e1193f52cfcc4b903810daa1be52 (commit) via b57f092236735165dabf85dd876e4672c0a0170d (commit) from c15fecb8655e7eac3da26efa0cb224b00844ca4a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit cde3a5943256e1193f52cfcc4b903810daa1be52 Merge: c15fecb86 b57f09223 Author: Nate Bargmann <n0...@n0...> Date: Tue Aug 19 12:59:51 2025 -0500 Merge GitHub PR #1851 commit b57f092236735165dabf85dd876e4672c0a0170d Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sun Aug 17 22:37:53 2025 +0200 Remove the executable bit from source files and documents diff --git a/rigs/hamlib_voice_cw_memory_4.6.0.xlsx b/rigs/hamlib_voice_cw_memory_4.6.0.xlsx old mode 100755 new mode 100644 diff --git a/rigs/yaesu/FT8X7eeprom.odt b/rigs/yaesu/FT8X7eeprom.odt old mode 100755 new mode 100644 diff --git a/rigs/yaesu/ft990.c b/rigs/yaesu/ft990.c old mode 100755 new mode 100644 diff --git a/rigs/yaesu/ft990.h b/rigs/yaesu/ft990.h old mode 100755 new mode 100644 diff --git a/rigs/yaesu/ft990v12.h b/rigs/yaesu/ft990v12.h old mode 100755 new mode 100644 diff --git a/rotators/grbltrk/Android.mk b/rotators/grbltrk/Android.mk old mode 100755 new mode 100644 ----------------------------------------------------------------------- Summary of changes: rigs/hamlib_voice_cw_memory_4.6.0.xlsx | Bin rigs/yaesu/FT8X7eeprom.odt | Bin rigs/yaesu/ft990.c | 0 rigs/yaesu/ft990.h | 0 rigs/yaesu/ft990v12.h | 0 rotators/grbltrk/Android.mk | 0 6 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 rigs/hamlib_voice_cw_memory_4.6.0.xlsx mode change 100755 => 100644 rigs/yaesu/FT8X7eeprom.odt mode change 100755 => 100644 rigs/yaesu/ft990.c mode change 100755 => 100644 rigs/yaesu/ft990.h mode change 100755 => 100644 rigs/yaesu/ft990v12.h mode change 100755 => 100644 rotators/grbltrk/Android.mk hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-19 17:48:03
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via c15fecb8655e7eac3da26efa0cb224b00844ca4a (commit) via fd7d69d24c132b6ef94be6df04031cf41cf73228 (commit) from 3fa91c8771981106539eb16e5b02212232793912 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c15fecb8655e7eac3da26efa0cb224b00844ca4a Merge: 3fa91c877 fd7d69d24 Author: Nate Bargmann <n0...@n0...> Date: Tue Aug 19 08:16:22 2025 -0500 Merge GitHub PR #1849 commit fd7d69d24c132b6ef94be6df04031cf41cf73228 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sun Aug 17 18:13:43 2025 +0200 Fix output of dump_state Fixes references to levels and properly handles strings. Steps to reproduce: tests/rigctl chk_vfo dump_state diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 711dd7502..d2fbcee7f 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -4828,7 +4828,9 @@ declare_proto_rig(dump_state) for (i = 0; i < RIG_SETTING_MAX; ++i) { - if (RIG_LEVEL_IS_FLOAT(i)) + setting_t level = rig_idx2setting(i); + + if (RIG_LEVEL_IS_FLOAT(level)) { fprintf(fout, "%d=%g,%g,%g;", i, rs->level_gran[i].min.f, rs->level_gran[i].max.f, rs->level_gran[i].step.f); @@ -4844,11 +4846,17 @@ declare_proto_rig(dump_state) for (i = 0; i < RIG_SETTING_MAX; ++i) { - if (RIG_LEVEL_IS_FLOAT(i)) + setting_t parm = rig_idx2setting(i); + + if (RIG_PARM_IS_FLOAT(parm)) { fprintf(fout, "%d=%g,%g,%g;", i, rs->parm_gran[i].min.f, rs->parm_gran[i].max.f, rs->parm_gran[i].step.f); } + else if (RIG_PARM_IS_STRING(parm)) + { + fprintf(fout, "%d=%s;", i, rs->parm_gran[i].step.cs); + } else { fprintf(fout, "%d=%d,%d,%d;", i, rs->level_gran[i].min.i, ----------------------------------------------------------------------- Summary of changes: tests/rigctl_parse.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-19 13:10:14
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 3fa91c8771981106539eb16e5b02212232793912 (commit) via 73a967e5696e0c5255394e57d85a2d32214b691d (commit) via 6e3b8b223d086dac4c625536576dfef9b72f17b8 (commit) via e3d1ed00b7018d938e69c23dc7bac3a669401508 (commit) via 8f0c94dc773d7d3ae544d85ccff2247682362f4e (commit) via 1aafbb3f2415f2e701440a988068ecbf2ffd63d0 (commit) via 271129705aa123f2db5a6f71b617c80d7affbf71 (commit) via c91c3feac0fd592f307f74c6c30080d8a2031b88 (commit) via edda52b40ebb0824a844553fcf75fe830236afe4 (commit) via dadd6e1495f2e0f22f59347337827f19ec7d6f8a (commit) via 014b34e674b99ae7d3dcb221543267768541c4b0 (commit) via 8dc20bb2705e8df9173e1419130ad02e390efa23 (commit) via 26412650a66b33d329feb5c5235005eed383ff5c (commit) via d4eee93c858c0fd13c5910e70504a1d9180a223e (commit) via 53e27d6e8872a8754a33c87f0c07082481b095dc (commit) via 8805748e748720356525206c15961707fa18a6ac (commit) via 69a9f15e3e1fd645bd90b651f53acf24100a7694 (commit) via 250d661a2a752d72249f3990a9936f4cb6c092e2 (commit) via 6a83b0d0547fd0f0e115f3a3553faf061fa3666f (commit) via 201b4544b7c0bea829a19b877fa4a7422c7c23b1 (commit) via 897e59ef0e2e5876af44dc3ec0f8e8125bfa369e (commit) via 3c7b3dafcf40e8ab27871e6a91242a48d4d072bc (commit) via d4444d2247f4c2366981eebc9cb3a65305f4e034 (commit) via 3c214ed676db6a110a41130278d2507d99524805 (commit) via d8b02a73e1e7479e0cd3af09ae163cfc3399c045 (commit) via 3e43b513d6d048513d621e09b862c9d2971d88eb (commit) via b2828881b617986d33aa518459ff3b6451ba7415 (commit) from afda578d45098e77fe05be2044598f94c5a278ec (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3fa91c8771981106539eb16e5b02212232793912 Author: Nate Bargmann <n0...@n0...> Date: Mon Aug 18 13:28:35 2025 -0500 Document fixing MinGW warnings and linker error This commit has been left as documentation should these files be moved to /doc or some such. However, never of these files are built or distributed. ---------------- From example.c the following warning was generated by MinGW: CC example.o example.c: In function ‘main’: example.c:93:32: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘rmode_t’ {aka ‘long long unsigned int’} [-Wformat=] 93 | printf("Current mode = 0x%lX = %s, width = %ld\n", mode, rig_strrmode(mode), | ~~^ ~~~~ | | | | long unsigned int rmode_t {aka long long unsigned int} | %llX The 'l' was added as suggested to the format specifier but that resulted in the following warning from Linux: CC example.o ../../hamlib/tests/example.c:93:57: warning: format specifies type 'unsigned long long' but the argument has type 'rmode_t' (aka 'unsigned long') [-Wformat] printf("Current mode = 0x%llX = %s, width = %ld\n", mode, rig_strrmode(mode), ~~~~ ^~~~ %lX CC rigctl-dumpcaps.o 1 warning generated. So casting `mode` to `unsigned long long` quelled both warnings! From testsecurity.c came this warning: CC testsecurity-testsecurity.o In file included from ../include/hamlib/rig.h:49, from ../src/misc.h:26, from testsecurity.c:29: /usr/share/mingw-w64/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp] 15 | #warning Please include winsock2.h before windows.h | ^~~~~~~ Apparently winsock2.h being included through misc.h didn't work. Finally, the Mingw linker gave the following error: CCLD testsecurity.exe /usr/bin/x86_64-w64-mingw32-ld: testsecurity-testsecurity.o: in function `main': /home/nate/builds/hamlib-4.7~git/tests/testsecurity.c:97:(.text.startup+0x87): undefined reference to `AESStringCrypt' /usr/bin/x86_64-w64-mingw32-ld: /home/nate/builds/hamlib-4.7~git/tests/testsecurity.c:116:(.text.startup+0x128): undefined reference to `AESStringDecrypt' collect2: error: ld returned 1 exit status Specifcally add the libsecurity.la file path as a specific library. Even though the libhamlib.la seems to have the AESStringCrypt symbol already. diff --git a/tests/Makefile.am b/tests/Makefile.am index 78744bf2c..ab63d9d86 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -57,7 +57,9 @@ rigctlsync_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security if HAVE_LIBUSB rigtestlibusb_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) $(LIBUSB_CFLAGS) endif -testsecurity_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_srcdir)/security + +# Document building testsecurity +### testsecurity_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_srcdir)/security rigctl_LDADD = $(PTHREAD_LIBS) $(READLINE_LIBS) $(LDADD) rigctld_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) @@ -73,6 +75,9 @@ if HAVE_LIBUSB rigtestlibusb_LDADD = $(LIBUSB_LIBS) endif +# Document linking testsecurity +### testsecurity_LDADD = $(PTHREAD_LIBS) $(LDADD) $(top_builddir)/security/libsecurity.la + # Linker options rigctl_LDFLAGS = $(WINEXELDFLAGS) rigswr_LDFLAGS = $(WINEXELDFLAGS) @@ -90,6 +95,8 @@ if HAVE_LIBUSB rigtestlibusb_LDFLAGS = $(WINEXELDFLAGS) endif +# Document linking testsecurity with MinGW +### testsecurity_LDFLAGS = $(WINEXELDFLAGS) if HTML_MATRIX EXTRA_PROGRAMS = rigmatrix diff --git a/tests/example.c b/tests/example.c index 2e5ea6b32..7ded7a202 100644 --- a/tests/example.c +++ b/tests/example.c @@ -90,7 +90,7 @@ int main() if (status != RIG_OK) { printf("Get mode failed?? Err=%s\n", rigerror(status)); } - printf("Current mode = 0x%lX = %s, width = %ld\n", mode, rig_strrmode(mode), + printf("Current mode = 0x%llX = %s, width = %ld\n", (unsigned long long)mode, rig_strrmode(mode), width); /* rig power output */ diff --git a/tests/testsecurity.c b/tests/testsecurity.c index fe13b751b..415e3bf99 100644 --- a/tests/testsecurity.c +++ b/tests/testsecurity.c @@ -18,6 +18,7 @@ #include <stdio.h> #include <string.h> #ifdef _WIN32 +#include <winsock2.h> #include <windows.h> //#include <Wincrypt.h> #else commit 73a967e5696e0c5255394e57d85a2d32214b691d Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sun Aug 17 12:08:23 2025 +0200 Remove the remaining files of the DejaGnu tests The tests were disabled in commit cb1732fc2a355d21bbbfd82f299b066d49b8db1e. diff --git a/tests/config/unix.exp b/tests/config/unix.exp deleted file mode 100644 index ff023e709..000000000 --- a/tests/config/unix.exp +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright (C) 1997 - 2001 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# Please email any bugs, comments, and/or additions to this file to: -# ham...@li... - -set RIGCTL "../rigctl" -set verbose 0 - -if ![info exists prompt] then { - set prompt "Rig command: " -} -# -# rigctl_version -- extract and print the version number of rigctl -# - -proc rigctl_version {} { - global RIGCTL - global prompt - set tmp [exec $RIGCTL --version] - regexp "Hamlib version *(\[^\n\]*)\n.*" $tmp tmp version - clone_output "[which $RIGCTL] version $version\n" -} -# -# rigctl_load -- loads the program -# -proc rigctl_load { arg } { - # -} - -# -# rigctl_exit -- quit and cleanup -# -proc rigctl_exit {} { - send "quit\n" -} - -# -# rigctl_start -- start rigctl running -# -proc rigctl_start {} { - global RIGCTL - global prompt - global spawn_id - global verbose - - if { $verbose > 1 } { - send_user "starting $RIGCTL\n" - } - spawn $RIGCTL - expect { - -re "No such file.*" { perror "Can't start $RIGCTL"; exit 1 } - -re "$prompt$" { } - #FIXME - #-re "rig: dlsym\(initrigs_([^\)]*)\) failed.*" { perror "Can't find backend $expect_out(1,string)"; exit 1 } - timeout { perror "Failed to spawn $RIGCTL (timeout)"; exit 1 } - } -} - -rigctl_start -send "v\n" -expect { -re ""} -expect { -re "v*"} -expect { -re "VFO:*"} -expect { -re "Rig Command:"} -#send "f\n" -#expect { -re "Frequency:*"} -#interact -#send "m\n" -#expect { -re "Mode:*"} -#send "t\n" -#expect { -re "PTT:*"} -rigctl_exit diff --git a/tests/rigctl.test/rigctl.exp b/tests/rigctl.test/rigctl.exp deleted file mode 100644 index 8b13f2f57..000000000 --- a/tests/rigctl.test/rigctl.exp +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (C) 1997 - 2001 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# Please email any bugs, comments, and/or additions to this file to: -# ham...@li... - -set timeout 3 -# -# expectations that clean up in case of error. Note that '$test' is -# a purely local variable. -# -# The first of these is used to match any bad responses, and resynchronise -# things by finding a prompt. The second is a timeout error, and shouldn't -# ever be triggered. -# -expect_after { - -re "\[^\n\r\]*$prompt$" { - fail "$test (bad match)" - if { $verbose > 0 } { - regexp ".*\r\n(\[^\r\n\]+)(\[\r\n\])+$prompt$" \ - $expect_out(buffer) "" output - send_user "\tUnmatched output: \"$output\"\n" - } - } - timeout { - fail "$test (timeout)" - } -} -# -# Here are the tests -# -set test "help" -send "?\n" -expect { - -re "Commands \\(may not be available for this rig\\):.*$prompt$" { pass "$test" } -} - -set test "nocmd" -send "\n" -expect { - -re "\\? for help, q to quit\\..*$prompt$" { pass "$test" } -} - -set test "info" -send "\\get_info\n" -expect { - -re "Info:.*$prompt$" { pass "$test" } -} diff --git a/tests/testbcd.test/testbcd.exp b/tests/testbcd.test/testbcd.exp deleted file mode 100644 index 656bf6d35..000000000 --- a/tests/testbcd.test/testbcd.exp +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (C) 1997 - 2001 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# Please email any bugs, comments, and/or additions to this file to: -# ham...@li... - -set TESTBCD "$srcdir/testbcd" - -# -# Here are the tests -# - -# BCD: 44,34,33,22,12 -# BCD: 12,22,33,34,44 -proc test_bcd { test freq digits bcdle bcdbe } { - - global TESTBCD - set tmp [exec $TESTBCD $freq $digits] - - set pat ".*Little Endian mode\nFrequency: $freq\nBCD: $bcdle\nResult after recoding: $freq\n\nBig Endian mode\nFrequency: $freq\nBCD: $bcdbe\nResult after recoding: $freq$" - if [regexp $pat $tmp] { - pass "$test" - } else { - clone_output "Expected le: $bcdle, be: $bcdbe, got:\n$tmp" - fail "$test" - } -} - -test_bcd "10/10 digits" 1222333444 10 "44,34,33,22,12" "12,22,33,34,44" -test_bcd "9/10 digits" 999666333 10 "33,63,66,99,09" "09,99,66,63,33" -test_bcd "8/10 digits" 87666333 10 "33,63,66,87,00" "00,87,66,63,33" -test_bcd "1/10 digit" 1 10 "01,00,00,00,00" "00,00,00,00,01" - -# note the 10th digit which is undefined -test_bcd "9/9 digits" 999666333 9 "33,63,66,99,.9" "99,96,66,33,3." -test_bcd "8/9 digits" 87666333 9 "33,63,66,87,.0" "08,76,66,33,3." -test_bcd "1/9 digit" 1 9 "01,00,00,00,.0" "00,00,00,00,1." - diff --git a/tests/testfreq.test/testfreq.exp b/tests/testfreq.test/testfreq.exp deleted file mode 100644 index a636c3598..000000000 --- a/tests/testfreq.test/testfreq.exp +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (C) 1997 - 2001 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# Please email any bugs, comments, and/or additions to this file to: -# ham...@li... - -set TESTFREQ "$srcdir/testfreq" - -# -# Here are the tests -# - -proc test_freq { test } { - - global TESTFREQ - set tmp [exec $TESTFREQ] - - set pat ".*GHz.2. = 2000000000\nGHz.4. = 4000000000\nGHz.5. = 5000000000\nGHz.1.3. = 1300000000\nGHz.1.234567890. = 1234567890\nGHz.123.456789012. = 123456789012$" - if [regexp $pat $tmp] { - pass "$test" - } else { - clone_output "Expected GHz holding on >32bits, got:\n$tmp" - fail "$test" - puts $pat - } -} - -test_freq ">32bit freq's" - diff --git a/tests/testloc.test/testloc.exp b/tests/testloc.test/testloc.exp deleted file mode 100644 index 763e037d5..000000000 --- a/tests/testloc.test/testloc.exp +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (C) 1997 - 2001 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# Please email any bugs, comments, and/or additions to this file to: -# ham...@li... - -set TESTLOC "$srcdir/testloc" - -# -# Here are the tests -# - -# TODO: upcase locator -proc test_loc1 { test loc } { - - global TESTLOC - set tmp [exec $TESTLOC $loc] - - set pat "Locator1: $loc\n.*Recoded: $loc$" - if [regexp $pat $tmp] { - pass "$test" - } else { - clone_output "Expected locator: $loc, got:\n$tmp" - fail "$test" - } -} - -test_loc1 "Simple recorded loc" IN98EC -test_loc1 "Simple recorded loc" EM19OV -test_loc1 "Simple recorded loc" DM33DX -test_loc1 "Simple recorded loc" IO93LA -test_loc1 "Simple recorded loc" IO93MA -test_loc1 "Simple recorded loc" IO93NA - commit 6e3b8b223d086dac4c625536576dfef9b72f17b8 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sun Aug 17 09:44:35 2025 +0200 Remove the perl/ subdirectory It breaks "make dist", it was deprecated in favor of SWIG in commit 59b81dfa183566a1d507621cc9bca0cf774eb3dc and if only the contained some Makefiles. diff --git a/perl/Makefile.PL b/perl/Makefile.PL deleted file mode 100644 index b7f6e06b0..000000000 --- a/perl/Makefile.PL +++ /dev/null @@ -1,19 +0,0 @@ -use ExtUtils::MakeMaker; -# See lib/ExtUtils/MakeMaker.pm for details of how to influence -# the contents of the Makefile that is written. -WriteMakefile( - 'NAME' => 'Hamlib', - 'VERSION_FROM' => 'Hamlib.pm', # finds $VERSION - 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1 - ($] >= 5.005 ? ## Add these new keywords supported since 5.005 - (ABSTRACT_FROM => 'Hamlib.pm', # retrieve abstract from module - AUTHOR => 'S. Fillod <fi...@us...>') : ()), - # should use libtool somehow. Otherwise try -Wl,--rpath - #'LIBS' => ['-L../../src/.libs -lhamlib'], - 'DEFINE' => '', - #'INC' => '-I.', - 'dist' => {'COMPRESS'=>'gzip -9f', 'SUFFIX' => 'gz', - 'ZIP'=>'/usr/bin/zip','ZIPFLAGS'=>'-rl'}, - # Un-comment this if you add C files to link with later: - # 'OBJECT' => '$(O_FILES)', # link all the C files too -); diff --git a/perl/Makefile.am b/perl/Makefile.am deleted file mode 100644 index f0980b29d..000000000 --- a/perl/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ - -# note: VPATH building does not work yet - -Hamlib-pl.mk: $(top_srcdir)/perl/Makefile.PL - cp -u $(top_srcdir)/perl/{Changes,MANIFEST,README.md,Hamlib.pm,Hamlib.xs,Makefile.PL,test.pl,typemap} . 2> /dev/null || exit 0 - perl Makefile.PL MAKEFILE=Hamlib-pl.mk INST_MAN3DIR=$(mandir) \ - LIB=$(libdir) CCFLAGS=$(CFLAGS) INC="$(INCLUDES)" \ - LIBS="-L$(top_builddir)/src/.libs -lhamlib" - -all: Hamlib-pl.mk - make -f Hamlib-pl.mk - -test: all - make -f Hamlib-pl.mk test - -clean: Hamlib-pl.mk - make -f Hamlib-pl.mk clean - -distclean: Hamlib-pl.mk - make -f Hamlib-pl.mk distclean - -distcheck: Hamlib-pl.mk - make -f Hamlib-pl.mk distcheck - -install: Hamlib-pl.mk - make -f Hamlib-pl.mk install - -EXTRA_DIST = Changes MANIFEST README.md Hamlib.pm Hamlib.xs Makefile.PL \ - test.pl typemap - commit e3d1ed00b7018d938e69c23dc7bac3a669401508 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sun Aug 17 09:20:16 2025 +0200 Split and sort the list of DIST_SUBDIRS diff --git a/Makefile.am b/Makefile.am index f1eac5f41..9a84401b5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -33,10 +33,24 @@ SUBDIRS = macros include lib security \ ## Static list of distributed directories. DIST_SUBDIRS = \ + $(AMP_BACKEND_LIST) \ + $(BACKEND_LIST) \ + $(RIG_BACKEND_LIST) \ $(RIG_BACKEND_OPTIONAL_LIST) \ + $(ROT_BACKEND_LIST) \ $(ROT_BACKEND_OPTIONAL_LIST) \ - macros include lib src c++ bindings tests doc android scripts simulators\ - security $(BACKEND_LIST) $(RIG_BACKEND_LIST) $(ROT_BACKEND_LIST) $(AMP_BACKEND_LIST) + android \ + bindings \ + c++ \ + doc \ + include \ + lib \ + macros \ + scripts \ + security \ + simulators \ + src \ + tests # Install any third party macros into our tree for distribution ACLOCAL_AMFLAGS = -I macros --install commit 8f0c94dc773d7d3ae544d85ccff2247682362f4e Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Aug 16 22:43:49 2025 +0200 [simulators] Fix compiler warning Adds the same code used in other simulators. Fixes: simft897.c:26:9: warning: variable ‘n’ set but not used [-Wunused-but-set-variable] diff --git a/simulators/simft897.c b/simulators/simft897.c index 0af8f83c8..fdf855bfd 100644 --- a/simulators/simft897.c +++ b/simulators/simft897.c @@ -40,6 +40,7 @@ int main(int argc, char *argv[]) { printf("Not 5 bytes? bytes=%d\n", bytes); } + n = 0; switch (buf[4]) { @@ -104,6 +105,7 @@ int main(int argc, char *argv[]) default: printf("Unknown cmd=%02x\n", buf[4]); } + if (n < 0) {printf("Write failed - n = %d\n", n); } } return 0; commit 1aafbb3f2415f2e701440a988068ecbf2ffd63d0 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Aug 16 22:42:35 2025 +0200 [simulators] Add missing files to check_PROGRAMS diff --git a/simulators/.gitignore b/simulators/.gitignore index 58fab97e8..bdef75281 100644 --- a/simulators/.gitignore +++ b/simulators/.gitignore @@ -7,9 +7,11 @@ simft1000 simft450 simft710 simft736 +simft747gx simft817 simft818 simft847 +simft897 simft990 simft991 simftdx101 diff --git a/simulators/Makefile.am b/simulators/Makefile.am index 8776b4273..2dd759f64 100644 --- a/simulators/Makefile.am +++ b/simulators/Makefile.am @@ -18,9 +18,11 @@ check_PROGRAMS = \ simft450 \ simft710 \ simft736 \ + simft747gx \ simft817 \ simft818 \ simft847 \ + simft897 \ simft990 \ simft991 \ simftdx101 \ commit 271129705aa123f2db5a6f71b617c80d7affbf71 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Aug 16 22:39:40 2025 +0200 [simulators] Split and sort the list of check_PROGRAMS diff --git a/simulators/Makefile.am b/simulators/Makefile.am index 003e50e79..8776b4273 100644 --- a/simulators/Makefile.am +++ b/simulators/Makefile.am @@ -8,7 +8,65 @@ DISTCLEANFILES = bin_PROGRAMS = -check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 simftdx101 simxiegug90 simqrplabs simft818 simic275 simtrusdx simft1000 simtmd710 simts890 simxiegux108g simxiegux6100 simic910 simft450 simelecraftk4 simmicom simflex simft710 simic2730 simorion simpmr171 simic7700 simft990 simpstrotator simeasycomm simicr8600 +check_PROGRAMS = \ + simatd578 \ + simeasycomm \ + simelecraft \ + simelecraftk4 \ + simflex \ + simft1000 \ + simft450 \ + simft710 \ + simft736 \ + simft817 \ + simft818 \ + simft847 \ + simft990 \ + simft991 \ + simftdx101 \ + simftdx1200 \ + simftdx3000 \ + simftdx5000 \ + simic2730 \ + simic275 \ + simic7000 \ + simic705 \ + simic7100 \ + simic7200 \ + simic7300 \ + simic7600 \ + simic7610 \ + simic7700 \ + simic7851 \ + simic905 \ + simic910 \ + simic9100 \ + simic9700 \ + simicgeneric \ + simicr8600 \ + simid5100 \ + simjupiter \ + simkenwood \ + simmicom \ + simorion \ + simpmr171 \ + simpowersdr \ + simpstrotator \ + simqrplabs \ + simrotorez \ + simspid \ + simtmd700 \ + simtmd710 \ + simtrusdx \ + simts450 \ + simts590 \ + simts890 \ + simts950 \ + simts990 \ + simxiegug90 \ + simxiegux108g \ + simxiegux6100 \ + simyaesu # include generated include files ahead of any in sources #rigctl_CPPFLAGS = -I$(top_builddir)/tests -I$(top_builddir)/src -I$(srcdir) $(AM_CPPFLAGS) commit c91c3feac0fd592f307f74c6c30080d8a2031b88 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Aug 16 22:26:21 2025 +0200 [tests] Make testnet.c build diff --git a/tests/testnet.c b/tests/testnet.c index 1d1f1f45d..84411446a 100644 --- a/tests/testnet.c +++ b/tests/testnet.c @@ -9,9 +9,7 @@ #include <sys/types.h> #include <signal.h> -#define HAVE_NETINET_IN_H -#define HAVE_NETDB_H -#define HAVE_ARPA_INET_H +#include "config.h" #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> @@ -25,6 +23,8 @@ # include <arpa/inet.h> #endif +#include "../src/misc.h" + static int rig_network_addr(char *hoststr, char *portstr) { @@ -73,11 +73,11 @@ static int rig_network_addr(char *hoststr, char *portstr) return 0; } -static int test_host(char *hoststr, char host[256], char port[6]) +static int test_host(char *hoststr, char *host, char *port) { int status; char host2[256], port2[6]; - status = parse_hoststr(hoststr, host2, port2); + status = parse_hoststr(hoststr, strlen(hoststr), host2, port2); printf("---------------------\n"); commit edda52b40ebb0824a844553fcf75fe830236afe4 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Aug 16 22:11:27 2025 +0200 [tests] Fix search path for includes diff --git a/tests/Makefile.am b/tests/Makefile.am index f2dc77d3b..78744bf2c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -57,7 +57,7 @@ rigctlsync_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security if HAVE_LIBUSB rigtestlibusb_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) $(LIBUSB_CFLAGS) endif -#testsecurity_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src -I$(top_builddir)/security +testsecurity_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_srcdir)/security rigctl_LDADD = $(PTHREAD_LIBS) $(READLINE_LIBS) $(LDADD) rigctld_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) commit dadd6e1495f2e0f22f59347337827f19ec7d6f8a Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Aug 16 22:01:45 2025 +0200 [tests] Set return codes in case of success/failure of the tests diff --git a/tests/testsecurity.c b/tests/testsecurity.c index a306b2381..fe13b751b 100644 --- a/tests/testsecurity.c +++ b/tests/testsecurity.c @@ -106,6 +106,7 @@ int main() if (ciphertext_length == AESSTRINGCRYPT_ERROR) { printf("Error encrypting the string\n"); + return 1; } printf("Ciphertext length: %d\n", ciphertext_length); @@ -120,7 +121,10 @@ int main() if (plaintext_length == AESSTRINGCRYPT_ERROR) { printf("Error decrypting the string\n"); + return 1; } printf("Decrypted plaintext length: %d, %s\n", plaintext_length, plaintext); + + return 0; } commit 014b34e674b99ae7d3dcb221543267768541c4b0 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Aug 16 22:00:59 2025 +0200 [tests] Convert line endings from CR LF to LF diff --git a/tests/testsecurity.c b/tests/testsecurity.c index 4913fc1a0..a306b2381 100644 --- a/tests/testsecurity.c +++ b/tests/testsecurity.c @@ -1,126 +1,126 @@ -/* Borrowed for Hamlib from: - * String Crypt Test (Linux) - * Copyright (C) 2012, 2015 - * - * Author: Paul E. Jones <pa...@pa...> - * - * This software is licensed as "freeware." Permission to distribute - * this software in source and binary forms is hereby granted without a - * fee. THIS SOFTWARE IS PROVIDED 'AS IS' AND WITHOUT ANY EXPRESSED OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * THE AUTHOR SHALL NOT BE HELD LIABLE FOR ANY DAMAGES RESULTING FROM - * THE USE OF THIS SOFTWARE, EITHER DIRECTLY OR INDIRECTLY, INCLUDING, - * BUT NOT LIMITED TO, LOSS OF DATA OR DATA BEING RENDERED INACCURATE. - * - */ - -#include <stdio.h> -#include <string.h> -#ifdef _WIN32 -#include <windows.h> -//#include <Wincrypt.h> -#else -#include <unistd.h> -#endif - -#include "AESStringCrypt.h" -#include "password.h" -#include "../src/misc.h" - -#if defined(_WIN32) -// gmtime_r can be defined by mingw -#ifndef gmtime_r -static struct tm *gmtime_r(const time_t *t, struct tm *r) -{ - // gmtime is threadsafe in windows because it uses TLS - const struct tm *theTm = gmtime(t); - - if (theTm) - { - *r = *theTm; - return r; - } - else - { - return 0; - } -} -#endif // gmtime_r -#endif // _WIN32 - -// using tv_usec with a sleep gives a fairly good random number -static int my_rand(int max) -{ - time_t t; - struct timeval tv; - struct tm result; - - t = time(NULL); - gmtime_r(&t, &result); - - gettimeofday(&tv, NULL); - hl_usleep(100); - int val = tv.tv_usec % max; - return val; -} - -void rig_make_key(char key[33]) -{ - const char *all = - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123467890!@#$%^&*()_=~<>/?"; - int max = strlen(all); - int i; - - for (i = 0; i < 32; ++i) - { - key[i] = all[my_rand(max)]; - } - - key[32] = 0; -} - -int main() -{ - char key1[33]; - char key2[33]; - char plaintext[33]; - unsigned char ciphertext[1024]; - int ciphertext_length; - int plaintext_length; - memset(ciphertext, 0, sizeof(ciphertext)); - rig_make_key(key1); - rig_make_key(key2); - printf("key1=%s\n", key1); - printf("key2=%s\n", key2); - ciphertext_length = AESStringCrypt((unsigned char *) key1, - strlen(key1), - (unsigned char *) key2, - strlen(key2), - (unsigned char *) ciphertext); - - for (int i = 0; i < ciphertext_length; ++i) { printf("%02x", ciphertext[i]); } - - printf("\n"); - - if (ciphertext_length == AESSTRINGCRYPT_ERROR) - { - printf("Error encrypting the string\n"); - } - - printf("Ciphertext length: %d\n", ciphertext_length); - memset(plaintext, 0, sizeof(plaintext)); - printf("Decrypting...\n"); - plaintext_length = AESStringDecrypt((unsigned char *) key1, - strlen(key1), - (unsigned char *) ciphertext, - ciphertext_length, - (unsigned char *) plaintext); - - if (plaintext_length == AESSTRINGCRYPT_ERROR) - { - printf("Error decrypting the string\n"); - } - - printf("Decrypted plaintext length: %d, %s\n", plaintext_length, plaintext); -} +/* Borrowed for Hamlib from: + * String Crypt Test (Linux) + * Copyright (C) 2012, 2015 + * + * Author: Paul E. Jones <pa...@pa...> + * + * This software is licensed as "freeware." Permission to distribute + * this software in source and binary forms is hereby granted without a + * fee. THIS SOFTWARE IS PROVIDED 'AS IS' AND WITHOUT ANY EXPRESSED OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * THE AUTHOR SHALL NOT BE HELD LIABLE FOR ANY DAMAGES RESULTING FROM + * THE USE OF THIS SOFTWARE, EITHER DIRECTLY OR INDIRECTLY, INCLUDING, + * BUT NOT LIMITED TO, LOSS OF DATA OR DATA BEING RENDERED INACCURATE. + * + */ + +#include <stdio.h> +#include <string.h> +#ifdef _WIN32 +#include <windows.h> +//#include <Wincrypt.h> +#else +#include <unistd.h> +#endif + +#include "AESStringCrypt.h" +#include "password.h" +#include "../src/misc.h" + +#if defined(_WIN32) +// gmtime_r can be defined by mingw +#ifndef gmtime_r +static struct tm *gmtime_r(const time_t *t, struct tm *r) +{ + // gmtime is threadsafe in windows because it uses TLS + const struct tm *theTm = gmtime(t); + + if (theTm) + { + *r = *theTm; + return r; + } + else + { + return 0; + } +} +#endif // gmtime_r +#endif // _WIN32 + +// using tv_usec with a sleep gives a fairly good random number +static int my_rand(int max) +{ + time_t t; + struct timeval tv; + struct tm result; + + t = time(NULL); + gmtime_r(&t, &result); + + gettimeofday(&tv, NULL); + hl_usleep(100); + int val = tv.tv_usec % max; + return val; +} + +void rig_make_key(char key[33]) +{ + const char *all = + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123467890!@#$%^&*()_=~<>/?"; + int max = strlen(all); + int i; + + for (i = 0; i < 32; ++i) + { + key[i] = all[my_rand(max)]; + } + + key[32] = 0; +} + +int main() +{ + char key1[33]; + char key2[33]; + char plaintext[33]; + unsigned char ciphertext[1024]; + int ciphertext_length; + int plaintext_length; + memset(ciphertext, 0, sizeof(ciphertext)); + rig_make_key(key1); + rig_make_key(key2); + printf("key1=%s\n", key1); + printf("key2=%s\n", key2); + ciphertext_length = AESStringCrypt((unsigned char *) key1, + strlen(key1), + (unsigned char *) key2, + strlen(key2), + (unsigned char *) ciphertext); + + for (int i = 0; i < ciphertext_length; ++i) { printf("%02x", ciphertext[i]); } + + printf("\n"); + + if (ciphertext_length == AESSTRINGCRYPT_ERROR) + { + printf("Error encrypting the string\n"); + } + + printf("Ciphertext length: %d\n", ciphertext_length); + memset(plaintext, 0, sizeof(plaintext)); + printf("Decrypting...\n"); + plaintext_length = AESStringDecrypt((unsigned char *) key1, + strlen(key1), + (unsigned char *) ciphertext, + ciphertext_length, + (unsigned char *) plaintext); + + if (plaintext_length == AESSTRINGCRYPT_ERROR) + { + printf("Error decrypting the string\n"); + } + + printf("Decrypted plaintext length: %d, %s\n", plaintext_length, plaintext); +} commit 8dc20bb2705e8df9173e1419130ad02e390efa23 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Aug 16 21:23:44 2025 +0200 [tests] Remove non-working duplicated code It is almost an exact copy of testrigopen 1 line different and without includes so it's not compiling. diff --git a/tests/callback.c b/tests/callback.c deleted file mode 100644 index dfa1f5b34..000000000 --- a/tests/callback.c +++ /dev/null @@ -1,42 +0,0 @@ -int callback(const struct rig_caps *caps, rig_ptr_t rigp) -{ - RIG *rig = (RIG *) rigp; - - rig = rig_init(caps->rig_model); - - if (!rig) - { - fprintf(stderr, "Unknown rig num: %u\n", caps->rig_model); - fprintf(stderr, "Please check riglist.h\n"); - exit(1); /* whoops! something went wrong (mem alloc?) */ - } - - const char *port = "/dev/pts/3"; - strcpy(RIGPORT(rig)->pathname, port); - - printf("%20s:", caps->model_name); - fflush(stdout); - struct timeval start, end; - gettimeofday(&start, NULL); - rig_open(rig); - gettimeofday(&end, NULL); - double dstart = start.tv_sec + start.tv_usec / 1e6; - double dend = end.tv_sec + end.tv_usec / (double)1e6; - printf(" %.1f\n", dend - dstart); - - rig_close(rig); /* close port */ - rig_cleanup(rig); /* if you care about memory */ - return 1; -} - -int main(int argc, char *argv[]) -{ - RIG rig; - printf("testing rig timeouts when rig powered off\n"); - - /* Turn off backend debugging output */ - rig_set_debug_level(RIG_DEBUG_NONE); - rig_load_all_backends(); - rig_list_foreach(callback, &rig); - return 0; -} commit 26412650a66b33d329feb5c5235005eed383ff5c Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Thu Aug 14 15:26:36 2025 +0200 [tests] Add other existing test scripts Adds: amptest.sh and testcaps.sh Doesn't add cachetest.sh because it needs 2 instances of rigctld running. diff --git a/tests/Makefile.am b/tests/Makefile.am index 3315cb0d2..f2dc77d3b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -115,7 +115,8 @@ EXTRA_DIST = \ testrotctld.pl # Support 'make check' target for simple tests -check_SCRIPTS = test2038.sh testbcd.sh testcache.sh testcookie.sh testfreq.sh testgrid.sh testloc.sh testrig.sh testrigcaps.sh +# Omitting cachetest.sh because it needs 2 instances of rigctld running +check_SCRIPTS = amptest.sh test2038.sh testbcd.sh testcache.sh testcaps.sh testcookie.sh testfreq.sh testgrid.sh testloc.sh testrig.sh testrigcaps.sh TESTS = $(check_SCRIPTS) commit d4eee93c858c0fd13c5910e70504a1d9180a223e Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Aug 16 17:56:27 2025 +0200 [tests] Add missing files to EXTRA_DIST diff --git a/tests/Makefile.am b/tests/Makefile.am index 40ad3226e..3315cb0d2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -104,8 +104,13 @@ endif EXTRA_DIST = \ + Android.mk \ + amptest.sh \ + cachetest.sh \ + hamlib_tuner_control \ rig_split_lst.awk \ rigmatrix_head.html \ + testcaps.sh \ testctld.pl \ testrotctld.pl commit 53e27d6e8872a8754a33c87f0c07082481b095dc Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Aug 16 17:47:22 2025 +0200 [tests] Split and sort the list of EXTRA_DIST files diff --git a/tests/Makefile.am b/tests/Makefile.am index 5418dc41d..40ad3226e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -103,7 +103,11 @@ rigmatrix.html: rigmatrix_head.html rigmatrix listrigs endif -EXTRA_DIST = rigmatrix_head.html rig_split_lst.awk testctld.pl testrotctld.pl +EXTRA_DIST = \ + rig_split_lst.awk \ + rigmatrix_head.html \ + testctld.pl \ + testrotctld.pl # Support 'make check' target for simple tests check_SCRIPTS = test2038.sh testbcd.sh testcache.sh testcookie.sh testfreq.sh testgrid.sh testloc.sh testrig.sh testrigcaps.sh commit 8805748e748720356525206c15961707fa18a6ac Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Aug 16 16:04:29 2025 +0200 [simulators] Add missing files to EXTRA_DIST diff --git a/simulators/Makefile.am b/simulators/Makefile.am index b9d58619e..003e50e79 100644 --- a/simulators/Makefile.am +++ b/simulators/Makefile.am @@ -32,7 +32,7 @@ simkenwood_LDFLAGS = $(WINEXELDFLAGS) simyaesu_LDFLAGS = $(WINEXELDFLAGS) simid5100_LDFLAGS = $(WINEXELDFLAGS) -EXTRA_DIST = sim.h +EXTRA_DIST = sim.h simft990.dat # Support 'make check' target for simple tests #check_SCRIPTS = commit 69a9f15e3e1fd645bd90b651f53acf24100a7694 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Aug 16 16:00:44 2025 +0200 [security] Add missing files to EXTRA_DIST diff --git a/security/Makefile.am b/security/Makefile.am index f0ca51ceb..18f23a5a8 100644 --- a/security/Makefile.am +++ b/security/Makefile.am @@ -1,5 +1,5 @@ ACLOCAL_AMFLAGS = -I. -EXTRA_DIST = sctest.c +EXTRA_DIST = Android.mk sctest.c noinst_LTLIBRARIES = libsecurity.la commit 250d661a2a752d72249f3990a9936f4cb6c092e2 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Aug 16 15:21:04 2025 +0200 [rigs] Remove uneeded EXTRA_DIST files diff --git a/rigs/kenwood/Makefile.am b/rigs/kenwood/Makefile.am index 83a41adb5..c9fa89158 100644 --- a/rigs/kenwood/Makefile.am +++ b/rigs/kenwood/Makefile.am @@ -14,4 +14,4 @@ KENWOODSRC = kenwood.c kenwood.h th.c th.h ic10.c ic10.h elecraft.c elecraft.h \ noinst_LTLIBRARIES = libhamlib-kenwood.la libhamlib_kenwood_la_SOURCES = $(TSSRC) $(THSRC) $(IC10SRC) $(KENWOODSRC) -EXTRA_DIST = README.kenwood README.k2 README.k3 README.flex Android.mk +EXTRA_DIST = Android.mk diff --git a/rigs/yaesu/Makefile.am b/rigs/yaesu/Makefile.am index c1bdb576d..dc3dc51eb 100644 --- a/rigs/yaesu/Makefile.am +++ b/rigs/yaesu/Makefile.am @@ -17,4 +17,4 @@ NEWCATSRC = newcat.c newcat.h ft450.c ft450.h ft950.c ft950.h ft991.c ft991.h \ noinst_LTLIBRARIES = libhamlib-yaesu.la libhamlib_yaesu_la_SOURCES = yaesu.c yaesu.h level_gran_yaesu.h $(YAESUSRC) $(NEWCATSRC) -EXTRA_DIST = README.ft890 README.ft920 Android.mk +EXTRA_DIST = Android.mk commit 6a83b0d0547fd0f0e115f3a3553faf061fa3666f Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Aug 16 13:41:34 2025 +0200 [doc] Split and sort the list of EXTRA_DIST files diff --git a/doc/Makefile.am b/doc/Makefile.am index 26e791e5a..9b1081ec8 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,4 +1,9 @@ -EXTRA_DIST = hamlib.cfg index.doxygen hamlib.css footer.html hamlib.png +EXTRA_DIST = \ + footer.html \ + hamlib.cfg \ + hamlib.css \ + hamlib.png \ + index.doxygen dist_man_MANS = man1/ampctl.1 man1/ampctld.1 \ man1/rigctl.1 man1/rigctld.1 man1/rigmem.1 man1/rigsmtr.1 \ commit 201b4544b7c0bea829a19b877fa4a7422c7c23b1 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Aug 16 12:03:56 2025 +0200 Split and sort the list of EXTRA_DIST files diff --git a/Makefile.am b/Makefile.am index ff3c0e6d8..f1eac5f41 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,9 +6,18 @@ aclocal_DATA = hamlib.m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = hamlib.pc -EXTRA_DIST = PLAN LICENSE hamlib.m4 hamlib.pc.in README.md README.developer \ - README.betatester README.freqranges README.multicast README.osx \ - Android.mk +EXTRA_DIST = \ + Android.mk \ + README.betatester \ + LICENSE \ + PLAN \ + README.developer \ + README.freqranges \ + README.md \ + README.multicast \ + README.osx \ + hamlib.m4 \ + hamlib.pc.in doc_DATA = ChangeLog COPYING COPYING.LIB LICENSE \ README.md README.betatester README.developer commit 897e59ef0e2e5876af44dc3ec0f8e8125bfa369e Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Tue Aug 12 10:02:03 2025 +0200 Fix comment to be relevant to the parm diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index d56d0ebbd..902bb683c 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -1187,7 +1187,7 @@ enum rig_parm_e { RIG_PARM_SCREENSAVER = (1 << 8), /*!< \c SCREENSAVER -- rig specific timeouts */ RIG_PARM_AFIF = (1 << 9), /*!< \c AFIF for USB -- 0=AF audio, 1=IF audio -- see IC-7300/9700/705 */ RIG_PARM_BANDSELECT = (1 << 10), /*!< \c BANDSELECT -- e.g. BAND160M, BAND80M, BAND70CM, BAND2CM */ - RIG_PARM_KEYERTYPE = (1 << 11), /*!< \c KEYERTYPE -- 0,1,2,4 or STRAIGHT BUG PADDLE UNKNOWN */ + RIG_PARM_KEYERTYPE = (1 << 11), /*!< \c KEYERTYPE -- Has multiple Morse keyer types, see #rig_keyertype_e */ RIG_PARM_AFIF_LAN = (1 << 12), /*!< \c AFIF for LAN -- 0=AF audio , 1=IF audio -- see IC-9700 */ RIG_PARM_AFIF_WLAN = (1 << 13), /*!< \c AFIF_WLAN -- 0=AF audio, 1=IF audio -- see IC-705 */ RIG_PARM_AFIF_ACC = (1 << 14) /*!< \c AFIF_ACC -- 0=AF audio, 1=IF audio -- see IC-9700 */ commit 3c7b3dafcf40e8ab27871e6a91242a48d4d072bc Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Thu Aug 14 13:10:00 2025 +0200 Read the frequency just set and fix typos Since ampctl is using the dummy driver, the status is reset at every run and it can't read the value set during the previous run. diff --git a/tests/amptest.sh b/tests/amptest.sh index 30601d779..196826c0b 100755 --- a/tests/amptest.sh +++ b/tests/amptest.sh @@ -11,12 +11,11 @@ ./ampctl l PWRFORWARD l PWRFORWARD ./ampctl l PWRREFLECTED l PWRREFLECTED ./ampctl l PWRPEAK l PWRPEAK -# Powerstat 0=Off, 1=On, 2=Standbyd, 4=Operate, 8=Unknown +# Powerstat 0=Off, 1=On, 2=Standby, 4=Operate, 8=Unknown ./ampctl \set_powerstat 0 ./ampctl \set_powerstat 1 ./ampctl \set_powerstat 2 ./ampctl \set_powerstat 4 ./ampctl \set_powerstat 8 -# Sets/reads tuner frequenchy -./ampctl F 14074000 -./ampctl f +# Sets/reads tuner frequency +./ampctl F 14074000 f commit d4444d2247f4c2366981eebc9cb3a65305f4e034 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Thu Aug 14 13:08:30 2025 +0200 Modifiy amptest.sh to run ampctl from the build directory diff --git a/tests/amptest.sh b/tests/amptest.sh index 14c7cb748..30601d779 100755 --- a/tests/amptest.sh +++ b/tests/amptest.sh @@ -1,22 +1,22 @@ #!/bin/sh # for the dummy amp values toggle between two likely values one each call # Note FAULT is a string return -ampctl l FAULT l FAULT +./ampctl l FAULT l FAULT # Note SWR is a float return -ampctl l SWR l SWR +./ampctl l SWR l SWR # All other values are integer -ampctl l NH l NH -ampctl l PF l PF -ampctl l PWRINPUT l PWRINPUT -ampctl l PWRFORWARD l PWRFORWARD -ampctl l PWRREFLECTED l PWRREFLECTED -ampctl l PWRPEAK l PWRPEAK +./ampctl l NH l NH +./ampctl l PF l PF +./ampctl l PWRINPUT l PWRINPUT +./ampctl l PWRFORWARD l PWRFORWARD +./ampctl l PWRREFLECTED l PWRREFLECTED +./ampctl l PWRPEAK l PWRPEAK # Powerstat 0=Off, 1=On, 2=Standbyd, 4=Operate, 8=Unknown -ampctl \set_powerstat 0 -ampctl \set_powerstat 1 -ampctl \set_powerstat 2 -ampctl \set_powerstat 4 -ampctl \set_powerstat 8 +./ampctl \set_powerstat 0 +./ampctl \set_powerstat 1 +./ampctl \set_powerstat 2 +./ampctl \set_powerstat 4 +./ampctl \set_powerstat 8 # Sets/reads tuner frequenchy -ampctl F 14074000 -ampctl f +./ampctl F 14074000 +./ampctl f commit 3c214ed676db6a110a41130278d2507d99524805 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Thu Aug 14 12:52:54 2025 +0200 Make it easier to see what tests are missing Sorts the list of tests. diff --git a/tests/Makefile.am b/tests/Makefile.am index c120165ff..5418dc41d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -106,7 +106,7 @@ endif EXTRA_DIST = rigmatrix_head.html rig_split_lst.awk testctld.pl testrotctld.pl # Support 'make check' target for simple tests -check_SCRIPTS = testrig.sh testfreq.sh testbcd.sh testloc.sh testrigcaps.sh testcache.sh testcookie.sh testgrid.sh test2038.sh +check_SCRIPTS = test2038.sh testbcd.sh testcache.sh testcookie.sh testfreq.sh testgrid.sh testloc.sh testrig.sh testrigcaps.sh TESTS = $(check_SCRIPTS) commit d8b02a73e1e7479e0cd3af09ae163cfc3399c045 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Thu Aug 14 12:13:47 2025 +0200 Add more files to tests/.gitignore diff --git a/tests/.gitignore b/tests/.gitignore index 8afb1b8f1..c55a7bae7 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,5 +1,11 @@ ampctl ampctld +cachetest +cachetest2 +dumpmem +hamlibmodels +listrigs +rig_bench rigctl rigctlcom rigctld @@ -14,5 +20,27 @@ rigtestmcast rigtestmcastrx rotctl rotctld +test-suite.log +test2038 +test2038.sh +testbcd +testbcd.sh +testcache +testcache.sh +testcookie +testcookie.sh +testfreq +testfreq.sh +testgrid +testgrid.sh testlibusb +testloc +testloc.sh +testmW2power +testrig +testrig.sh +testrigcaps +testrigcaps.sh +testrigopen +testtrn tuner_control.log commit 3e43b513d6d048513d621e09b862c9d2971d88eb Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Thu Aug 14 12:09:01 2025 +0200 Move list of ignored file to tests/ directory Makes the tests/ directory more self-contained and the top-level .gitgnore shorter. diff --git a/.gitignore b/.gitignore index 05b663024..d03033754 100644 --- a/.gitignore +++ b/.gitignore @@ -69,21 +69,3 @@ scripts/build-w32.sh.* scripts/build-w64.sh.* src/hamlibdatetime.h src/libhamlib.def -tests/ampctl -tests/ampctld -tests/rigctl -tests/rigctlcom -tests/rigctld -tests/rigctlsync -tests/rigctltcp -tests/rigfreqwalk -tests/rigmem -tests/rigsmtr -tests/rigswr -tests/rigtestlibusb -tests/rigtestmcast -tests/rigtestmcastrx -tests/rotctl -tests/rotctld -tests/testlibusb -tuner_control.log diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 000000000..8afb1b8f1 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1,18 @@ +ampctl +ampctld +rigctl +rigctlcom +rigctld +rigctlsync +rigctltcp +rigfreqwalk +rigmem +rigsmtr +rigswr +rigtestlibusb +rigtestmcast +rigtestmcastrx +rotctl +rotctld +testlibusb +tuner_control.log commit b2828881b617986d33aa518459ff3b6451ba7415 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Thu Aug 14 11:54:57 2025 +0200 Make output of the TCL test less verbose Uses the function that gets only the error message corresponding to the argument passed. diff --git a/bindings/tcltest.tcl.in b/bindings/tcltest.tcl.in index 1996224c4..b8ec14952 100644 --- a/bindings/tcltest.tcl.in +++ b/bindings/tcltest.tcl.in @@ -56,7 +56,7 @@ puts "status:\t\t[my_rig cget -error_status]" puts "strength:\t[my_rig get_level_i $RIG_LEVEL_STRENGTH]" puts "status:\t\t[my_rig cget -error_status]" -puts "status(str):\t[rigerror [my_rig cget -error_status]]" +puts "status(str):\t[rigerror2 [my_rig cget -error_status]]" puts "\nSending Morse, '73'" my_rig send_morse $RIG_VFO_A "73" ----------------------------------------------------------------------- Summary of changes: .gitignore | 18 --- Makefile.am | 33 ++++- bindings/tcltest.tcl.in | 2 +- doc/Makefile.am | 7 +- include/hamlib/rig.h | 2 +- perl/Makefile.PL | 19 --- perl/Makefile.am | 30 ----- rigs/kenwood/Makefile.am | 2 +- rigs/yaesu/Makefile.am | 2 +- security/Makefile.am | 2 +- simulators/.gitignore | 2 + simulators/Makefile.am | 64 +++++++++- simulators/simft897.c | 2 + tests/.gitignore | 46 +++++++ tests/Makefile.am | 23 +++- tests/amptest.sh | 33 +++-- tests/callback.c | 42 ------- tests/config/unix.exp | 86 ------------- tests/example.c | 2 +- tests/rigctl.test/rigctl.exp | 61 ---------- tests/testbcd.test/testbcd.exp | 51 -------- tests/testfreq.test/testfreq.exp | 42 ------- tests/testloc.test/testloc.exp | 47 ------- tests/testnet.c | 10 +- tests/testsecurity.c | 257 ++++++++++++++++++++------------------- 25 files changed, 324 insertions(+), 561 deletions(-) delete mode 100644 perl/Makefile.PL delete mode 100644 perl/Makefile.am create mode 100644 tests/.gitignore delete mode 100644 tests/callback.c delete mode 100644 tests/config/unix.exp delete mode 100644 tests/rigctl.test/rigctl.exp delete mode 100644 tests/testbcd.test/testbcd.exp delete mode 100644 tests/testfreq.test/testfreq.exp delete mode 100644 tests/testloc.test/testloc.exp hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-18 21:50:42
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, wip_0 has been deleted was a3f8cdc1ab66c8db969e920493237b0f3c77783f - Log ----------------------------------------------------------------- a3f8cdc1ab66c8db969e920493237b0f3c77783f This commit was manufactured by cvs2svn to create tag 'wip_0'. ----------------------------------------------------------------------- hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-18 21:50:40
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, w1hkj_test has been deleted was 187cf3f0f3daf810c9970cc867aebcc7821f3bac - Log ----------------------------------------------------------------- 187cf3f0f3daf810c9970cc867aebcc7821f3bac elecraft.c: Quell compiler warning of buffer size ----------------------------------------------------------------------- hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-18 21:50:38
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, migration_from_cvs_to_svn_20090403 has been deleted was 575bd47e7f330ea92ee3cf878e4bd4ca3a0dc844 - Log ----------------------------------------------------------------- 575bd47e7f330ea92ee3cf878e4bd4ca3a0dc844 This commit was manufactured by cvs2svn to create tag 'tag_migration_from_cvs_to_svn_20090403'. ----------------------------------------------------------------------- hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-18 21:50:35
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, libusb-1-0 has been deleted was d8ebe0b86253d4d3cfc2ab1704d11c03961a7f1d - Log ----------------------------------------------------------------- d8ebe0b86253d4d3cfc2ab1704d11c03961a7f1d Merge branch 'master' into libusb-1-0 ----------------------------------------------------------------------- hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-18 21:50:31
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, kenwood_hamlib_1_2_9_branch has been deleted was 2322435aa60a2df744fcfb347e86f45cc1b60a88 - Log ----------------------------------------------------------------- 2322435aa60a2df744fcfb347e86f45cc1b60a88 fix warning, possible bug where char is unsigned ----------------------------------------------------------------------- hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-18 21:50:28
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, branch_ts2k has been deleted was 6030a2351146ddbfb47dfce3e60fef0a8f86bb55 - Log ----------------------------------------------------------------- 6030a2351146ddbfb47dfce3e60fef0a8f86bb55 Corrected function name from levels() to func(). Big oops! ----------------------------------------------------------------------- hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-18 21:49:04
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, aa6e_jupiter has been deleted was 52a1c08e38331f74c4ba3971e243a4ffe0466b1b - Log ----------------------------------------------------------------- 52a1c08e38331f74c4ba3971e243a4ffe0466b1b Remove STRENGTH from level list. ----------------------------------------------------------------------- hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-18 21:48:52
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, before_kenwood_overhaul_beginning_january_2009 has been deleted was 26408afc34656f3996c0e371a3bda27bfd8916b5 - Log ----------------------------------------------------------------- 26408afc34656f3996c0e371a3bda27bfd8916b5 This commit was manufactured by cvs2svn to create tag 'tag_before_kenwood_overhaul_beginning_january_2009'. ----------------------------------------------------------------------- hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-16 12:21:55
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via afda578d45098e77fe05be2044598f94c5a278ec (commit) via 3c391a696d5743620c9ff872e516ea621bfa5f65 (commit) via caf7346fc023313afb2c6c516ba9bf08bda1dcd8 (commit) from ee03370cdfe6eee8bdafb0d9bd043567af9f9d75 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit afda578d45098e77fe05be2044598f94c5a278ec Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Aug 16 11:49:50 2025 +0200 Fix typos Founda by duck.ai. diff --git a/README.freqranges b/README.freqranges index 9d5ca1228..664a631cb 100644 --- a/README.freqranges +++ b/README.freqranges @@ -4,7 +4,7 @@ region restrictions As of 2020-05-05 the behavior is: #1 Any range which shows ITU# or TBD has not been modified to this convention -#2 Ranges on the backends are being change to USA/EUR/KOR/TPE/ITR per the +#2 Ranges on the backends are being changed to USA/EUR/KOR/TPE/ITR per the IC-9700 convention. So if you see one of those monikers on a rig's freq range it should accurately reflect the rig's capabilities. diff --git a/README.md b/README.md index 9b4410138..ecc9f9cf8 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Daily snapshots are available at https://n0nb.users.sourceforge.net/ Development happens on the github master (often by merging feature branches) and each release has a release branch. -Many Amateur Radio Transceivers come with serial interfaces that allows +Many Amateur Radio Transceivers come with serial interfaces that allow software to control the radio. This project will endeavour to provide shared libraries that greatly simplify the application programmer's interaction with radio equipment and other controllable devices such as rotators, @@ -90,7 +90,7 @@ Note: if ./configure does not exist run ./bootstrap first sudo make install For debugging use this configure - ./configure CFLAGS=-g -O0 -fPIC --no-create --no-recursio + ./configure CFLAGS=-g -O0 -fPIC --no-create --no-recursion See the INSTALL file for more information. commit 3c391a696d5743620c9ff872e516ea621bfa5f65 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Wed Aug 13 17:57:32 2025 +0200 Fix misleading order in comment and add UNKNOWN diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 039ef6e9d..d56d0ebbd 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -1187,7 +1187,7 @@ enum rig_parm_e { RIG_PARM_SCREENSAVER = (1 << 8), /*!< \c SCREENSAVER -- rig specific timeouts */ RIG_PARM_AFIF = (1 << 9), /*!< \c AFIF for USB -- 0=AF audio, 1=IF audio -- see IC-7300/9700/705 */ RIG_PARM_BANDSELECT = (1 << 10), /*!< \c BANDSELECT -- e.g. BAND160M, BAND80M, BAND70CM, BAND2CM */ - RIG_PARM_KEYERTYPE = (1 << 11), /*!< \c KEYERTYPE -- 0,1,2 or STRAIGHT PADDLE BUG */ + RIG_PARM_KEYERTYPE = (1 << 11), /*!< \c KEYERTYPE -- 0,1,2,4 or STRAIGHT BUG PADDLE UNKNOWN */ RIG_PARM_AFIF_LAN = (1 << 12), /*!< \c AFIF for LAN -- 0=AF audio , 1=IF audio -- see IC-9700 */ RIG_PARM_AFIF_WLAN = (1 << 13), /*!< \c AFIF_WLAN -- 0=AF audio, 1=IF audio -- see IC-705 */ RIG_PARM_AFIF_ACC = (1 << 14) /*!< \c AFIF_ACC -- 0=AF audio, 1=IF audio -- see IC-9700 */ commit caf7346fc023313afb2c6c516ba9bf08bda1dcd8 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Tue Aug 12 10:02:03 2025 +0200 Fix typos diff --git a/AUTHORS b/AUTHORS index 36aa525a1..301edb505 100644 --- a/AUTHORS +++ b/AUTHORS @@ -173,10 +173,10 @@ M: C: Pascal Brisset -[yeasu: ft1000d] +[yaesu: ft1000d] M: Serge Pashenkov -[yeasu: ft100] +[yaesu: ft100] M: Alex V Flinsch, KC2IVL [yaesu: ft736] diff --git a/doc/man1/ampctld.1 b/doc/man1/ampctld.1 index b9bb10c9d..5be9b2d1e 100644 --- a/doc/man1/ampctld.1 +++ b/doc/man1/ampctld.1 @@ -60,7 +60,7 @@ commands with the requested values, one per line, when successful, otherwise, it responds with one line \(lqRPRT x\(rq, where \(oqx\(cq is a negative number indicating the error code. Commands that do not return values respond with the line \(lqRPRT x\(rq, where \(oqx\(cq is \(oq0\(cq when successful, -otherwise is a regative number indicating the error code. Each line is +otherwise is a negative number indicating the error code. Each line is terminated with a newline \(oq\\n\(cq character. This protocol is primarily for use by the .B NET ampctl diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 2a8847ec2..20652967c 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -67,7 +67,7 @@ commands with the requested values, one per line, when successful, otherwise, it responds with one line \(lqRPRT x\(rq, where \(oqx\(cq is a negative number indicating the error code. Commands that do not return values respond with the line \(lqRPRT x\(rq, where \(oqx\(cq is \(oq0\(cq when successful, -otherwise is a regative number indicating the error code. Each line is +otherwise is a negative number indicating the error code. Each line is terminated with a newline \(oq\\n\(cq character. This protocol is primarily for use by the .B NET rigctl diff --git a/doc/man1/rotctld.1 b/doc/man1/rotctld.1 index d1cd13ed1..7be6f0504 100644 --- a/doc/man1/rotctld.1 +++ b/doc/man1/rotctld.1 @@ -55,7 +55,7 @@ responds to \(lqget\(rq commands with the requested values, one per line, when successful, otherwise, it responds with one line \(lqRPRT x\(rq, where \(oqx\(cq is a negative number indicating the error code. Commands that do not return values respond with the line \(lqRPRT x\(rq, where \(oqx\(cq is -\(oq0\(cq when successful, otherwise is a regative number indicating the error +\(oq0\(cq when successful, otherwise is a negative number indicating the error code. Each line is terminated with a newline \(oq\\n\(cq character. This protocol is primarily for use by the .B NET rotctl diff --git a/doc/man7/hamlib-utilities.7 b/doc/man7/hamlib-utilities.7 index 866bdd689..5626c95bb 100644 --- a/doc/man7/hamlib-utilities.7 +++ b/doc/man7/hamlib-utilities.7 @@ -10,7 +10,7 @@ . .SH NAME . -hamlib-utilties \- radio and rotator control utilities of Hamlib +hamlib-utilities \- radio and rotator control utilities of Hamlib . . .SH DESCRIPTION diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index e04a28be8..039ef6e9d 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -629,7 +629,7 @@ typedef unsigned int vfo_t; /* * targetable bitfields, for internal use. - * In rig.c lack of a flag will case a VFO change if needed + * In rig.c lack of a flag will cause a VFO change if needed * So setting this flag will mean the backend handles any VFO needs * For many rigs RITXIT, PTT, MEM, and BANK are non-VFO commands so need these flags to avoid unnecessary VFO swapping */ @@ -971,7 +971,7 @@ typedef enum { RIG_ANN_RXMODE = (1 << 1), /*!< Announce receive mode */ RIG_ANN_CW = (1 << 2), /*!< CW */ RIG_ANN_ENG = (1 << 3), /*!< English */ - RIG_ANN_JAP = (1 << 4) /*!< Japan */ + RIG_ANN_JAP = (1 << 4) /*!< Japanese */ } ann_t; @@ -1188,7 +1188,7 @@ enum rig_parm_e { RIG_PARM_AFIF = (1 << 9), /*!< \c AFIF for USB -- 0=AF audio, 1=IF audio -- see IC-7300/9700/705 */ RIG_PARM_BANDSELECT = (1 << 10), /*!< \c BANDSELECT -- e.g. BAND160M, BAND80M, BAND70CM, BAND2CM */ RIG_PARM_KEYERTYPE = (1 << 11), /*!< \c KEYERTYPE -- 0,1,2 or STRAIGHT PADDLE BUG */ - RIG_PARM_AFIF_LAN = (1 << 12), /*!< \c AFIF for LAN -- 0=AF audi , 1=IF audio -- see IC-9700 */ + RIG_PARM_AFIF_LAN = (1 << 12), /*!< \c AFIF for LAN -- 0=AF audio , 1=IF audio -- see IC-9700 */ RIG_PARM_AFIF_WLAN = (1 << 13), /*!< \c AFIF_WLAN -- 0=AF audio, 1=IF audio -- see IC-705 */ RIG_PARM_AFIF_ACC = (1 << 14) /*!< \c AFIF_ACC -- 0=AF audio, 1=IF audio -- see IC-9700 */ }; diff --git a/lib/win32termios.h b/lib/win32termios.h index b93919bd8..b18a59ab4 100644 --- a/lib/win32termios.h +++ b/lib/win32termios.h @@ -19,7 +19,7 @@ | License along with this library; if not, write to the Free Software | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | -| This file was taken from rxtx-2.1-7pre16 and adaptated for Hamlib. +| This file was taken from rxtx-2.1-7pre16 and adapted for Hamlib. --------------------------------------------------------------------------*/ #ifndef _WIN32TERMIOS_H diff --git a/rigs/aor/aor.c b/rigs/aor/aor.c index 4fef2e859..06c75b43b 100644 --- a/rigs/aor/aor.c +++ b/rigs/aor/aor.c @@ -461,7 +461,7 @@ int aor_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (retval != RIG_OK) { return retval; } strncpy(mdbuf2, mdbuf + 4, 3); /* Extract first 'BW' part */ - mdbuf2[3] = '\0'; // in case strnpy produces and un-terminated string + mdbuf2[3] = '\0'; // in case strncpy produces and un-terminated string mdbuf2_len = strlen(mdbuf2); retval = aor_transaction(rig, mdbuf2, mdbuf2_len, NULL, NULL); diff --git a/rigs/dummy/flrig.README b/rigs/dummy/flrig.README index 47be8bfd6..1902b476c 100644 --- a/rigs/dummy/flrig.README +++ b/rigs/dummy/flrig.README @@ -1,5 +1,5 @@ As of version 1.0 20180508 this works very well with flrig-1.3.40.50 and WSJT-X split mode. -Log4OM can be run conconcurrently connecting to "rigctld -M 4". +Log4OM can be run concurrently connecting to "rigctld -M 4". Note that for that Log4OM instance only clients that use extended protocol can connect to the client (since Log4OM uses extended protocol). If you want to use a client that does not have extended protocol you must run another rigctld on a separate TCP port. The same thing holds for any vfo mode clients. So you could end up with 4 rigctld's. One for each combination of extended/vfo mode. diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index e22cadfe7..77d3ac80e 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -4814,7 +4814,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_AGC_TIME: - // some rigs have different level interpretaions for different modes + // some rigs have different level interpretations for different modes if (rs->current_mode == RIG_MODE_AM) { val->f = agc_level2[icom_val]; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index d6c9227aa..e9636a1db 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -157,7 +157,7 @@ struct cmdparams struct icom_spectrum_scope_caps { int spectrum_line_length; /*!< Number of bytes in a complete spectrum scope line */ - int single_frame_data_length; /*!< Number of bytes of specrtum data in a single CI-V frame when the data split to multiple frames */ + int single_frame_data_length; /*!< Number of bytes of spectrum data in a single CI-V frame when the data split to multiple frames */ int data_level_min; /*!< */ int data_level_max; double signal_strength_min; diff --git a/rigs/kenwood/elecraft.c b/rigs/kenwood/elecraft.c index 76336faa7..36043de61 100644 --- a/rigs/kenwood/elecraft.c +++ b/rigs/kenwood/elecraft.c @@ -174,7 +174,7 @@ int elecraft_open(RIG *rig) } } - priv->save_k2_ext_lvl = -1; // so we don't restore if not neeede + priv->save_k2_ext_lvl = -1; // so we don't restore if not needed if (rig->caps->rig_model != RIG_MODEL_XG3) // XG3 doesn't have extended { diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 8daeee7f1..9e45d120b 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3852,7 +3852,7 @@ int newcat_get_powerstat(RIG *rig, powerstat_t *status) } } - // Yeasu rigs in powered-off state require the PS command to be sent between 1 and 2 seconds after dummy data + // Yaesu rigs in powered-off state require the PS command to be sent between 1 and 2 seconds after dummy data hl_usleep(1100000); // Discard any unsolicited data rig_flush(rp); diff --git a/rotators/flir/README.md b/rotators/flir/README.md index 48896abe8..f3a7517e5 100644 --- a/rotators/flir/README.md +++ b/rotators/flir/README.md @@ -16,7 +16,7 @@ Tested only with PTU-D48 yet and with one rotor per chain only. 1. Connect the rotor via serial (RS232 or RS485) 2. Power up the rotor -3. The rotor must be calibrated after each power up. This can be accived +3. The rotor must be calibrated after each power up. This can be achieved either using the rotctl `Reset` command (R) or manually via serial terminal sending the `R\n` command. 4. To enable the rotor to fully turn +/- 180°, the softlock must be disabled. diff --git a/rotators/ioptron/README_ioptron b/rotators/ioptron/README_ioptron index ef610b66a..8e3ea5c58 100644 --- a/rotators/ioptron/README_ioptron +++ b/rotators/ioptron/README_ioptron @@ -2,7 +2,7 @@ This is a small backend for iOptron alt-az mounts. It implements get position, g A warning on iOptron command language. iOptron is in the process of moving from V2 to V3 of the command lamguage and presently (December 2018) uses a mix of the two. This back end should work with mounts with current firmware, but new firmware may change commands and break it. -Minor annoyance - the mount will automatically start siderial tracking after a slew. Adding a stop tracking command at the end of the goto set did not solve the problem. +Minor annoyance - the mount will automatically start sidereal tracking after a slew. Adding a stop tracking command at the end of the goto set did not solve the problem. Bigger annoyance - Be careful with the GEM mounts (iEQ30, iEQ45) in alt-az mode. The dec/el motor cord easily catches on the ra/az clutch knobs when slewing in az. I attached a small standoff to keep the cord out of the way. diff --git a/scripts/build-VB.NET.sh b/scripts/build-VB.NET.sh index ee2f292de..503659048 100644 --- a/scripts/build-VB.NET.sh +++ b/scripts/build-VB.NET.sh @@ -98,7 +98,7 @@ Covered are: - set/get VFO - get Riginfo - -rig_debug_level_e not verified (Function is Void, VB Dokumentation + -rig_debug_level_e not verified (Function is Void, VB Documentation says this is not possible to be marshaled, but Compiler is still accepting this) diff --git a/tests/rig_bench.c b/tests/rig_bench.c index e8336c380..89fb88f36 100644 --- a/tests/rig_bench.c +++ b/tests/rig_bench.c @@ -17,7 +17,7 @@ int main(int argc, const char *argv[]) { - RIG *my_rig; /* handle to rig (nstance) */ + RIG *my_rig; /* handle to rig (instance) */ int retcode; /* generic return code from functions */ rig_model_t myrig_model; unsigned i; diff --git a/tests/rigfreqwalk.c b/tests/rigfreqwalk.c index 65f14f364..85e1e4bd3 100644 --- a/tests/rigfreqwalk.c +++ b/tests/rigfreqwalk.c @@ -44,7 +44,7 @@ static double sigma(double arr[], int length) int main(int argc, const char *argv[]) { - RIG *my_rig; /* handle to rig (nstance) */ + RIG *my_rig; /* handle to rig (instance) */ int strength; /* S-Meter level */ int retcode; /* generic return code from functions */ diff --git a/tests/rigmem.c b/tests/rigmem.c index 84b8eaf68..084d59399 100644 --- a/tests/rigmem.c +++ b/tests/rigmem.c @@ -90,7 +90,7 @@ int all; int main(int argc, char *argv[]) { - RIG *rig; /* handle to rig (nstance) */ + RIG *rig; /* handle to rig (instance) */ rig_model_t my_model = RIG_MODEL_DUMMY; int retcode; /* generic return code from functions */ diff --git a/tests/rigswr.c b/tests/rigswr.c index 81294f6bd..766ed74f5 100644 --- a/tests/rigswr.c +++ b/tests/rigswr.c @@ -64,7 +64,7 @@ static struct option long_options[] = int main(int argc, char *argv[]) { - RIG *rig; /* handle to rig (nstance) */ + RIG *rig; /* handle to rig (instance) */ rig_model_t my_model = RIG_MODEL_DUMMY; int retcode; /* generic return code from functions */ diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c index 861bbf41c..62ab4bcf1 100644 --- a/tests/rotctl_parse.c +++ b/tests/rotctl_parse.c @@ -2930,7 +2930,7 @@ declare_proto_rot(pause) return RIG_OK; } -// short list for rigctl/rigctld display +// short list for rotctl/rotctld display int print_conf_list2(const struct confparams *cfp, rig_ptr_t data, FILE *fout) { ROT *rot = (ROT *) data; diff --git a/tests/testrig.c b/tests/testrig.c index b2979a009..a95e7612e 100644 --- a/tests/testrig.c +++ b/tests/testrig.c @@ -16,7 +16,7 @@ int main(int argc, const char *argv[]) { - RIG *my_rig; /* handle to rig (nstance) */ + RIG *my_rig; /* handle to rig (instance) */ freq_t freq; /* frequency */ rmode_t rmode; /* radio mode of operation */ pbwidth_t width; @@ -105,7 +105,7 @@ int main(int argc, const char *argv[]) */ /* - * Example of setting rig paameters + * Example of setting rig parameters * and some error checking on the return code. */ diff --git a/tests/testtrn.c b/tests/testtrn.c index 2333d8e0e..b0330955a 100644 --- a/tests/testtrn.c +++ b/tests/testtrn.c @@ -27,7 +27,7 @@ static int myfreq_event(RIG *rig, vfo_t vfo, freq_t freq, rig_ptr_t arg) int main(int argc, const char *argv[]) { - RIG *my_rig; /* handle to rig (nstance) */ + RIG *my_rig; /* handle to rig (instance) */ int retcode; /* generic return code from functions */ int i, count = 0; ----------------------------------------------------------------------- Summary of changes: AUTHORS | 4 ++-- README.freqranges | 2 +- README.md | 4 ++-- doc/man1/ampctld.1 | 2 +- doc/man1/rigctld.1 | 2 +- doc/man1/rotctld.1 | 2 +- doc/man7/hamlib-utilities.7 | 2 +- include/hamlib/rig.h | 8 ++++---- lib/win32termios.h | 2 +- rigs/aor/aor.c | 2 +- rigs/dummy/flrig.README | 2 +- rigs/icom/icom.c | 2 +- rigs/icom/icom.h | 2 +- rigs/kenwood/elecraft.c | 2 +- rigs/yaesu/newcat.c | 2 +- rotators/flir/README.md | 2 +- rotators/ioptron/README_ioptron | 2 +- scripts/build-VB.NET.sh | 2 +- tests/rig_bench.c | 2 +- tests/rigfreqwalk.c | 2 +- tests/rigmem.c | 2 +- tests/rigswr.c | 2 +- tests/rotctl_parse.c | 2 +- tests/testrig.c | 4 ++-- tests/testtrn.c | 2 +- 25 files changed, 31 insertions(+), 31 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-14 14:05:25
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via ee03370cdfe6eee8bdafb0d9bd043567af9f9d75 (commit) via 7549f66aa126fb829e92d59fe2f3feda5f2bf5b6 (commit) via 053178ccbd08f8e0473c61165c997011e97690d6 (commit) via 0e36d4faa48f0f7ee0e48aa81ac63bbc3e7d089a (commit) via 74558224a9d3baf151582d0cfd9b155c8f265423 (commit) via 2e5696b7e32bb9129f4419a5f9659803372d97b4 (commit) from 98f6da8ae325f7383a8b1d2a9026516aa6fcf414 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ee03370cdfe6eee8bdafb0d9bd043567af9f9d75 Merge: 98f6da8ae 7549f66aa Author: Nate Bargmann <n0...@n0...> Date: Thu Aug 14 08:11:27 2025 -0500 Merge GitHub PR #1846 commit 7549f66aa126fb829e92d59fe2f3feda5f2bf5b6 Author: George Baltz N3GB <Geo...@gm...> Date: Wed Aug 13 13:06:47 2025 -0400 Replace uthash.h(1.9.4) with latest release(2.3.0) From https://troydhanson.github.io/uthash/ Fixes diagnostics from cppcheck and -fanalyzer diff --git a/tests/uthash.h b/tests/uthash.h index 6724600b1..06c2eebdb 100644 --- a/tests/uthash.h +++ b/tests/uthash.h @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2011, Troy D. Hanson http://uthash.sourceforge.net +Copyright (c) 2003-2025, Troy D. Hanson https://troydhanson.github.io/uthash/ All rights reserved. Redistribution and use in source and binary forms, with or without @@ -22,162 +22,415 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef UTHASH_H -#define UTHASH_H +#define UTHASH_H -#include <string.h> /* memcmp,strlen */ +#define UTHASH_VERSION 2.3.0 + +#include <string.h> /* memcmp, memset, strlen */ #include <stddef.h> /* ptrdiff_t */ -#include <stdlib.h> /* exit() */ +#include <stdlib.h> /* exit */ + +#if defined(HASH_NO_STDINT) && HASH_NO_STDINT +/* The user doesn't have <stdint.h>, and must figure out their own way + to provide definitions for uint8_t and uint32_t. */ +#else +#include <stdint.h> /* uint8_t, uint32_t */ +#endif /* These macros use decltype or the earlier __typeof GNU extension. As decltype is only available in newer compilers (VS2010 or gcc 4.3+ when compiling c++ source) this code uses whatever method is needed or, for VS2008 where neither is available, uses casting workarounds. */ -#ifdef _MSC_VER /* MS compiler */ +#if !defined(DECLTYPE) && !defined(NO_DECLTYPE) +#if defined(_MSC_VER) /* MS compiler */ #if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */ #define DECLTYPE(x) (decltype(x)) #else /* VS2008 or older (or VS2010 in C mode) */ #define NO_DECLTYPE -#define DECLTYPE(x) #endif +#elif defined(__MCST__) /* Elbrus C Compiler */ +#define DECLTYPE(x) (__typeof(x)) +#elif defined(__BORLANDC__) || defined(__ICCARM__) || defined(__LCC__) || defined(__WATCOMC__) +#define NO_DECLTYPE #else /* GNU, Sun and other compilers */ #define DECLTYPE(x) (__typeof(x)) #endif +#endif #ifdef NO_DECLTYPE +#define DECLTYPE(x) #define DECLTYPE_ASSIGN(dst,src) \ do { \ char **_da_dst = (char**)(&(dst)); \ *_da_dst = (char*)(src); \ -} while(0) -#else +} while (0) +#else #define DECLTYPE_ASSIGN(dst,src) \ do { \ (dst) = DECLTYPE(dst)(src); \ -} while(0) +} while (0) #endif -/* a number of the hash function use uint32_t which isn't defined on win32 */ -#ifdef _MSC_VER -typedef unsigned int uint32_t; -typedef unsigned char uint8_t; -#else -#include <inttypes.h> /* uint32_t */ +#ifndef uthash_malloc +#define uthash_malloc(sz) malloc(sz) /* malloc fcn */ +#endif +#ifndef uthash_free +#define uthash_free(ptr,sz) free(ptr) /* free fcn */ +#endif +#ifndef uthash_bzero +#define uthash_bzero(a,n) memset(a,'\0',n) +#endif +#ifndef uthash_strlen +#define uthash_strlen(s) strlen(s) #endif -#define UTHASH_VERSION 1.9.4 +#ifndef HASH_FUNCTION +#define HASH_FUNCTION(keyptr,keylen,hashv) HASH_JEN(keyptr, keylen, hashv) +#endif -#define uthash_fatal(msg) exit(-1) /* fatal error (out of memory,etc) */ -#define uthash_malloc(sz) malloc(sz) /* malloc fcn */ -#define uthash_free(ptr,sz) free(ptr) /* free fcn */ +#ifndef HASH_KEYCMP +#define HASH_KEYCMP(a,b,n) memcmp(a,b,n) +#endif +#ifndef uthash_noexpand_fyi #define uthash_noexpand_fyi(tbl) /* can be defined to log noexpand */ +#endif +#ifndef uthash_expand_fyi #define uthash_expand_fyi(tbl) /* can be defined to log expands */ +#endif + +#ifndef HASH_NONFATAL_OOM +#define HASH_NONFATAL_OOM 0 +#endif + +#if HASH_NONFATAL_OOM +/* malloc failures can be recovered from */ + +#ifndef uthash_nonfatal_oom +#define uthash_nonfatal_oom(obj) do {} while (0) /* non-fatal OOM error */ +#endif + +#define HASH_RECORD_OOM(oomed) do { (oomed) = 1; } while (0) +#define IF_HASH_NONFATAL_OOM(x) x + +#else +/* malloc failures result in lost memory, hash tables are unusable */ + +#ifndef uthash_fatal +#define uthash_fatal(msg) exit(-1) /* fatal OOM error */ +#endif + +#define HASH_RECORD_OOM(oomed) uthash_fatal("out of memory") +#define IF_HASH_NONFATAL_OOM(x) + +#endif /* initial number of buckets */ -#define HASH_INITIAL_NUM_BUCKETS 32 /* initial number of buckets */ -#define HASH_INITIAL_NUM_BUCKETS_LOG2 5 /* lg2 of initial number of buckets */ -#define HASH_BKT_CAPACITY_THRESH 10 /* expand when bucket count reaches */ +#define HASH_INITIAL_NUM_BUCKETS 32U /* initial number of buckets */ +#define HASH_INITIAL_NUM_BUCKETS_LOG2 5U /* lg2 of initial number of buckets */ +#define HASH_BKT_CAPACITY_THRESH 10U /* expand when bucket count reaches */ -/* calculate the element whose hash handle address is hhe */ +/* calculate the element whose hash handle address is hhp */ #define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho))) +/* calculate the hash handle from element address elp */ +#define HH_FROM_ELMT(tbl,elp) ((UT_hash_handle*)(void*)(((char*)(elp)) + ((tbl)->hho))) + +#define HASH_ROLLBACK_BKT(hh, head, itemptrhh) \ +do { \ + struct UT_hash_handle *_hd_hh_item = (itemptrhh); \ + unsigned _hd_bkt; \ + HASH_TO_BKT(_hd_hh_item->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \ + (head)->hh.tbl->buckets[_hd_bkt].count++; \ + _hd_hh_item->hh_next = NULL; \ + _hd_hh_item->hh_prev = NULL; \ +} while (0) + +#define HASH_VALUE(keyptr,keylen,hashv) \ +do { \ + HASH_FUNCTION(keyptr, keylen, hashv); \ +} while (0) + +#define HASH_FIND_BYHASHVALUE(hh,head,keyptr,keylen,hashval,out) \ +do { \ + (out) = NULL; \ + if (head) { \ + unsigned _hf_bkt; \ + HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _hf_bkt); \ + if (HASH_BLOOM_TEST((head)->hh.tbl, hashval)) { \ + HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ], keyptr, keylen, hashval, out); \ + } \ + } \ +} while (0) #define HASH_FIND(hh,head,keyptr,keylen,out) \ do { \ - unsigned _hf_bkt,_hf_hashv; \ - out=NULL; \ + (out) = NULL; \ if (head) { \ - HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt); \ - if (HASH_BLOOM_TEST((head)->hh.tbl, _hf_hashv)) { \ - HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ], \ - keyptr,keylen,out); \ - } \ + unsigned _hf_hashv; \ + HASH_VALUE(keyptr, keylen, _hf_hashv); \ + HASH_FIND_BYHASHVALUE(hh, head, keyptr, keylen, _hf_hashv, out); \ } \ } while (0) #ifdef HASH_BLOOM -#define HASH_BLOOM_BITLEN (1ULL << HASH_BLOOM) -#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8) + ((HASH_BLOOM_BITLEN%8) ? 1:0) -#define HASH_BLOOM_MAKE(tbl) \ +#define HASH_BLOOM_BITLEN (1UL << HASH_BLOOM) +#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8UL) + (((HASH_BLOOM_BITLEN%8UL)!=0UL) ? 1UL : 0UL) +#define HASH_BLOOM_MAKE(tbl,oomed) \ do { \ (tbl)->bloom_nbits = HASH_BLOOM; \ (tbl)->bloom_bv = (uint8_t*)uthash_malloc(HASH_BLOOM_BYTELEN); \ - if (!((tbl)->bloom_bv)) { uthash_fatal( "out of memory"); } \ - memset((tbl)->bloom_bv, 0, HASH_BLOOM_BYTELEN); \ - (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE; \ -} while (0); + if (!(tbl)->bloom_bv) { \ + HASH_RECORD_OOM(oomed); \ + } else { \ + uthash_bzero((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \ + (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE; \ + } \ +} while (0) #define HASH_BLOOM_FREE(tbl) \ do { \ uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \ -} while (0); +} while (0) -#define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8] |= (1U << ((idx)%8))) -#define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8] & (1U << ((idx)%8))) +#define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8U] |= (1U << ((idx)%8U))) +#define HASH_BLOOM_BITTEST(bv,idx) ((bv[(idx)/8U] & (1U << ((idx)%8U))) != 0) #define HASH_BLOOM_ADD(tbl,hashv) \ - HASH_BLOOM_BITSET((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1))) + HASH_BLOOM_BITSET((tbl)->bloom_bv, ((hashv) & (uint32_t)((1UL << (tbl)->bloom_nbits) - 1U))) #define HASH_BLOOM_TEST(tbl,hashv) \ - HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1))) + HASH_BLOOM_BITTEST((tbl)->bloom_bv, ((hashv) & (uint32_t)((1UL << (tbl)->bloom_nbits) - 1U))) #else -#define HASH_BLOOM_MAKE(tbl) -#define HASH_BLOOM_FREE(tbl) -#define HASH_BLOOM_ADD(tbl,hashv) -#define HASH_BLOOM_TEST(tbl,hashv) (1) +#define HASH_BLOOM_MAKE(tbl,oomed) +#define HASH_BLOOM_FREE(tbl) +#define HASH_BLOOM_ADD(tbl,hashv) +#define HASH_BLOOM_TEST(tbl,hashv) 1 +#define HASH_BLOOM_BYTELEN 0U #endif -#define HASH_MAKE_TABLE(hh,head) \ -do { \ - (head)->hh.tbl = (UT_hash_table*)uthash_malloc( \ - sizeof(UT_hash_table)); \ - if (!((head)->hh.tbl)) { uthash_fatal( "out of memory"); } \ - memset((head)->hh.tbl, 0, sizeof(UT_hash_table)); \ - (head)->hh.tbl->tail = &((head)->hh); \ - (head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS; \ - (head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2; \ - (head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head); \ - (head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc( \ - HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ - if (! (head)->hh.tbl->buckets) { uthash_fatal( "out of memory"); } \ - memset((head)->hh.tbl->buckets, 0, \ - HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ - HASH_BLOOM_MAKE((head)->hh.tbl); \ - (head)->hh.tbl->signature = HASH_SIGNATURE; \ -} while(0) +#define HASH_MAKE_TABLE(hh,head,oomed) \ +do { \ + (head)->hh.tbl = (UT_hash_table*)uthash_malloc(sizeof(UT_hash_table)); \ + if (!(head)->hh.tbl) { \ + HASH_RECORD_OOM(oomed); \ + } else { \ + uthash_bzero((head)->hh.tbl, sizeof(UT_hash_table)); \ + (head)->hh.tbl->tail = &((head)->hh); \ + (head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS; \ + (head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2; \ + (head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head); \ + (head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc( \ + HASH_INITIAL_NUM_BUCKETS * sizeof(struct UT_hash_bucket)); \ + (head)->hh.tbl->signature = HASH_SIGNATURE; \ + if (!(head)->hh.tbl->buckets) { \ + HASH_RECORD_OOM(oomed); \ + uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ + } else { \ + uthash_bzero((head)->hh.tbl->buckets, \ + HASH_INITIAL_NUM_BUCKETS * sizeof(struct UT_hash_bucket)); \ + HASH_BLOOM_MAKE((head)->hh.tbl, oomed); \ + IF_HASH_NONFATAL_OOM( \ + if (oomed) { \ + uthash_free((head)->hh.tbl->buckets, \ + HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ + uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ + } \ + ) \ + } \ + } \ +} while (0) + +#define HASH_REPLACE_BYHASHVALUE_INORDER(hh,head,fieldname,keylen_in,hashval,add,replaced,cmpfcn) \ +do { \ + (replaced) = NULL; \ + HASH_FIND_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, replaced); \ + if (replaced) { \ + HASH_DELETE(hh, head, replaced); \ + } \ + HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, &((add)->fieldname), keylen_in, hashval, add, cmpfcn); \ +} while (0) + +#define HASH_REPLACE_BYHASHVALUE(hh,head,fieldname,keylen_in,hashval,add,replaced) \ +do { \ + (replaced) = NULL; \ + HASH_FIND_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, replaced); \ + if (replaced) { \ + HASH_DELETE(hh, head, replaced); \ + } \ + HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, add); \ +} while (0) + +#define HASH_REPLACE(hh,head,fieldname,keylen_in,add,replaced) \ +do { \ + unsigned _hr_hashv; \ + HASH_VALUE(&((add)->fieldname), keylen_in, _hr_hashv); \ + HASH_REPLACE_BYHASHVALUE(hh, head, fieldname, keylen_in, _hr_hashv, add, replaced); \ +} while (0) + +#define HASH_REPLACE_INORDER(hh,head,fieldname,keylen_in,add,replaced,cmpfcn) \ +do { \ + unsigned _hr_hashv; \ + HASH_VALUE(&((add)->fieldname), keylen_in, _hr_hashv); \ + HASH_REPLACE_BYHASHVALUE_INORDER(hh, head, fieldname, keylen_in, _hr_hashv, add, replaced, cmpfcn); \ +} while (0) + +#define HASH_APPEND_LIST(hh, head, add) \ +do { \ + (add)->hh.next = NULL; \ + (add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail); \ + (head)->hh.tbl->tail->next = (add); \ + (head)->hh.tbl->tail = &((add)->hh); \ +} while (0) + +#define HASH_AKBI_INNER_LOOP(hh,head,add,cmpfcn) \ +do { \ + do { \ + if (cmpfcn(DECLTYPE(head)(_hs_iter), add) > 0) { \ + break; \ + } \ + } while ((_hs_iter = HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->next)); \ +} while (0) + +#ifdef NO_DECLTYPE +#undef HASH_AKBI_INNER_LOOP +#define HASH_AKBI_INNER_LOOP(hh,head,add,cmpfcn) \ +do { \ + char *_hs_saved_head = (char*)(head); \ + do { \ + DECLTYPE_ASSIGN(head, _hs_iter); \ + if (cmpfcn(head, add) > 0) { \ + DECLTYPE_ASSIGN(head, _hs_saved_head); \ + break; \ + } \ + DECLTYPE_ASSIGN(head, _hs_saved_head); \ + } while ((_hs_iter = HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->next)); \ +} while (0) +#endif + +#if HASH_NONFATAL_OOM + +#define HASH_ADD_TO_TABLE(hh,head,keyptr,keylen_in,hashval,add,oomed) \ +do { \ + if (!(oomed)) { \ + unsigned _ha_bkt; \ + (head)->hh.tbl->num_items++; \ + HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _ha_bkt); \ + HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt], hh, &(add)->hh, oomed); \ + if (oomed) { \ + HASH_ROLLBACK_BKT(hh, head, &(add)->hh); \ + HASH_DELETE_HH(hh, head, &(add)->hh); \ + (add)->hh.tbl = NULL; \ + uthash_nonfatal_oom(add); \ + } else { \ + HASH_BLOOM_ADD((head)->hh.tbl, hashval); \ + HASH_EMIT_KEY(hh, head, keyptr, keylen_in); \ + } \ + } else { \ + (add)->hh.tbl = NULL; \ + uthash_nonfatal_oom(add); \ + } \ +} while (0) + +#else + +#define HASH_ADD_TO_TABLE(hh,head,keyptr,keylen_in,hashval,add,oomed) \ +do { \ + unsigned _ha_bkt; \ + (head)->hh.tbl->num_items++; \ + HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _ha_bkt); \ + HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt], hh, &(add)->hh, oomed); \ + HASH_BLOOM_ADD((head)->hh.tbl, hashval); \ + HASH_EMIT_KEY(hh, head, keyptr, keylen_in); \ +} while (0) + +#endif + + +#define HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh,head,keyptr,keylen_in,hashval,add,cmpfcn) \ +do { \ + IF_HASH_NONFATAL_OOM( int _ha_oomed = 0; ) \ + (add)->hh.hashv = (hashval); \ + (add)->hh.key = (char*) (keyptr); \ + (add)->hh.keylen = (unsigned) (keylen_in); \ + if (!(head)) { \ + (add)->hh.next = NULL; \ + (add)->hh.prev = NULL; \ + HASH_MAKE_TABLE(hh, add, _ha_oomed); \ + IF_HASH_NONFATAL_OOM( if (!_ha_oomed) { ) \ + (head) = (add); \ + IF_HASH_NONFATAL_OOM( } ) \ + } else { \ + void *_hs_iter = (head); \ + (add)->hh.tbl = (head)->hh.tbl; \ + HASH_AKBI_INNER_LOOP(hh, head, add, cmpfcn); \ + if (_hs_iter) { \ + (add)->hh.next = _hs_iter; \ + if (((add)->hh.prev = HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->prev)) { \ + HH_FROM_ELMT((head)->hh.tbl, (add)->hh.prev)->next = (add); \ + } else { \ + (head) = (add); \ + } \ + HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->prev = (add); \ + } else { \ + HASH_APPEND_LIST(hh, head, add); \ + } \ + } \ + HASH_ADD_TO_TABLE(hh, head, keyptr, keylen_in, hashval, add, _ha_oomed); \ + HASH_FSCK(hh, head, "HASH_ADD_KEYPTR_BYHASHVALUE_INORDER"); \ +} while (0) + +#define HASH_ADD_KEYPTR_INORDER(hh,head,keyptr,keylen_in,add,cmpfcn) \ +do { \ + unsigned _hs_hashv; \ + HASH_VALUE(keyptr, keylen_in, _hs_hashv); \ + HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, keyptr, keylen_in, _hs_hashv, add, cmpfcn); \ +} while (0) + +#define HASH_ADD_BYHASHVALUE_INORDER(hh,head,fieldname,keylen_in,hashval,add,cmpfcn) \ + HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, &((add)->fieldname), keylen_in, hashval, add, cmpfcn) + +#define HASH_ADD_INORDER(hh,head,fieldname,keylen_in,add,cmpfcn) \ + HASH_ADD_KEYPTR_INORDER(hh, head, &((add)->fieldname), keylen_in, add, cmpfcn) + +#define HASH_ADD_KEYPTR_BYHASHVALUE(hh,head,keyptr,keylen_in,hashval,add) \ +do { \ + IF_HASH_NONFATAL_OOM( int _ha_oomed = 0; ) \ + (add)->hh.hashv = (hashval); \ + (add)->hh.key = (const void*) (keyptr); \ + (add)->hh.keylen = (unsigned) (keylen_in); \ + if (!(head)) { \ + (add)->hh.next = NULL; \ + (add)->hh.prev = NULL; \ + HASH_MAKE_TABLE(hh, add, _ha_oomed); \ + IF_HASH_NONFATAL_OOM( if (!_ha_oomed) { ) \ + (head) = (add); \ + IF_HASH_NONFATAL_OOM( } ) \ + } else { \ + (add)->hh.tbl = (head)->hh.tbl; \ + HASH_APPEND_LIST(hh, head, add); \ + } \ + HASH_ADD_TO_TABLE(hh, head, keyptr, keylen_in, hashval, add, _ha_oomed); \ + HASH_FSCK(hh, head, "HASH_ADD_KEYPTR_BYHASHVALUE"); \ +} while (0) -#define HASH_ADD(hh,head,fieldname,keylen_in,add) \ - HASH_ADD_KEYPTR(hh,head,&((add)->fieldname),keylen_in,add) - #define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add) \ do { \ - unsigned _ha_bkt; \ - (add)->hh.next = NULL; \ - (add)->hh.key = (char*)keyptr; \ - (add)->hh.keylen = keylen_in; \ - if (!(head)) { \ - head = (add); \ - (head)->hh.prev = NULL; \ - HASH_MAKE_TABLE(hh,head); \ - } else { \ - (head)->hh.tbl->tail->next = (add); \ - (add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail); \ - (head)->hh.tbl->tail = &((add)->hh); \ - } \ - (head)->hh.tbl->num_items++; \ - (add)->hh.tbl = (head)->hh.tbl; \ - HASH_FCN(keyptr,keylen_in, (head)->hh.tbl->num_buckets, \ - (add)->hh.hashv, _ha_bkt); \ - HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt],&(add)->hh); \ - HASH_BLOOM_ADD((head)->hh.tbl,(add)->hh.hashv); \ - HASH_EMIT_KEY(hh,head,keyptr,keylen_in); \ - HASH_FSCK(hh,head); \ -} while(0) - -#define HASH_TO_BKT( hashv, num_bkts, bkt ) \ -do { \ - bkt = ((hashv) & ((num_bkts) - 1)); \ -} while(0) + unsigned _ha_hashv; \ + HASH_VALUE(keyptr, keylen_in, _ha_hashv); \ + HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, keyptr, keylen_in, _ha_hashv, add); \ +} while (0) + +#define HASH_ADD_BYHASHVALUE(hh,head,fieldname,keylen_in,hashval,add) \ + HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, add) + +#define HASH_ADD(hh,head,fieldname,keylen_in,add) \ + HASH_ADD_KEYPTR(hh, head, &((add)->fieldname), keylen_in, add) + +#define HASH_TO_BKT(hashv,num_bkts,bkt) \ +do { \ + bkt = ((hashv) & ((num_bkts) - 1U)); \ +} while (0) /* delete "delptr" from the hash table. * "the usual" patch-up process for the app-order doubly-linked-list. @@ -192,54 +445,65 @@ do { * scratch pointer rather than through the repointed (users) symbol. */ #define HASH_DELETE(hh,head,delptr) \ + HASH_DELETE_HH(hh, head, &(delptr)->hh) + +#define HASH_DELETE_HH(hh,head,delptrhh) \ do { \ - struct UT_hash_handle *_hd_hh_del; \ - if ( ((delptr)->hh.prev == NULL) && ((delptr)->hh.next == NULL) ) { \ - uthash_free((head)->hh.tbl->buckets, \ - (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \ - HASH_BLOOM_FREE((head)->hh.tbl); \ - uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ - head = NULL; \ + const struct UT_hash_handle *_hd_hh_del = (delptrhh); \ + if ((_hd_hh_del->prev == NULL) && (_hd_hh_del->next == NULL)) { \ + HASH_BLOOM_FREE((head)->hh.tbl); \ + uthash_free((head)->hh.tbl->buckets, \ + (head)->hh.tbl->num_buckets * sizeof(struct UT_hash_bucket)); \ + uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ + (head) = NULL; \ + } else { \ + unsigned _hd_bkt; \ + if (_hd_hh_del == (head)->hh.tbl->tail) { \ + (head)->hh.tbl->tail = HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->prev); \ + } \ + if (_hd_hh_del->prev != NULL) { \ + HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->prev)->next = _hd_hh_del->next; \ } else { \ - unsigned _hd_bkt; \ - _hd_hh_del = &((delptr)->hh); \ - if ((delptr) == ELMT_FROM_HH((head)->hh.tbl,(head)->hh.tbl->tail)) { \ - (head)->hh.tbl->tail = \ - (UT_hash_handle*)((char*)((delptr)->hh.prev) + \ - (head)->hh.tbl->hho); \ - } \ - if ((delptr)->hh.prev) { \ - ((UT_hash_handle*)((char*)((delptr)->hh.prev) + \ - (head)->hh.tbl->hho))->next = (delptr)->hh.next; \ - } else { \ - DECLTYPE_ASSIGN(head,(delptr)->hh.next); \ - } \ - if (_hd_hh_del->next) { \ - ((UT_hash_handle*)((char*)_hd_hh_del->next + \ - (head)->hh.tbl->hho))->prev = \ - _hd_hh_del->prev; \ - } \ - HASH_TO_BKT( _hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \ - HASH_DEL_IN_BKT(hh,(head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del); \ - (head)->hh.tbl->num_items--; \ + DECLTYPE_ASSIGN(head, _hd_hh_del->next); \ } \ - HASH_FSCK(hh,head); \ + if (_hd_hh_del->next != NULL) { \ + HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->next)->prev = _hd_hh_del->prev; \ + } \ + HASH_TO_BKT(_hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \ + HASH_DEL_IN_BKT((head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del); \ + (head)->hh.tbl->num_items--; \ + } \ + HASH_FSCK(hh, head, "HASH_DELETE_HH"); \ } while (0) - /* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */ #define HASH_FIND_STR(head,findstr,out) \ - HASH_FIND(hh,head,findstr,strlen(findstr),out) +do { \ + unsigned _uthash_hfstr_keylen = (unsigned)uthash_strlen(findstr); \ + HASH_FIND(hh, head, findstr, _uthash_hfstr_keylen, out); \ +} while (0) #define HASH_ADD_STR(head,strfield,add) \ - HASH_ADD(hh,head,strfield,strlen(add->strfield),add) +do { \ + unsigned _uthash_hastr_keylen = (unsigned)uthash_strlen((add)->strfield); \ + HASH_ADD(hh, head, strfield[0], _uthash_hastr_keylen, add); \ +} while (0) +#define HASH_REPLACE_STR(head,strfield,add,replaced) \ +do { \ + unsigned _uthash_hrstr_keylen = (unsigned)uthash_strlen((add)->strfield); \ + HASH_REPLACE(hh, head, strfield[0], _uthash_hrstr_keylen, add, replaced); \ +} while (0) #define HASH_FIND_INT(head,findint,out) \ HASH_FIND(hh,head,findint,sizeof(int),out) #define HASH_ADD_INT(head,intfield,add) \ HASH_ADD(hh,head,intfield,sizeof(int),add) +#define HASH_REPLACE_INT(head,intfield,add,replaced) \ + HASH_REPLACE(hh,head,intfield,sizeof(int),add,replaced) #define HASH_FIND_PTR(head,findptr,out) \ HASH_FIND(hh,head,findptr,sizeof(void *),out) #define HASH_ADD_PTR(head,ptrfield,add) \ HASH_ADD(hh,head,ptrfield,sizeof(void *),add) +#define HASH_REPLACE_PTR(head,ptrfield,add,replaced) \ + HASH_REPLACE(hh,head,ptrfield,sizeof(void *),add,replaced) #define HASH_DEL(head,delptr) \ HASH_DELETE(hh,head,delptr) @@ -247,120 +511,115 @@ do { * This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined. */ #ifdef HASH_DEBUG -#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0) -#define HASH_FSCK(hh,head) \ +#include <stdio.h> /* fprintf, stderr */ +#define HASH_OOPS(...) do { fprintf(stderr, __VA_ARGS__); exit(-1); } while (0) +#define HASH_FSCK(hh,head,where) \ do { \ + struct UT_hash_handle *_thh; \ + if (head) { \ unsigned _bkt_i; \ - unsigned _count, _bkt_count; \ + unsigned _count = 0; \ char *_prev; \ - struct UT_hash_handle *_thh; \ - if (head) { \ - _count = 0; \ - for( _bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; _bkt_i++) { \ - _bkt_count = 0; \ - _thh = (head)->hh.tbl->buckets[_bkt_i].hh_head; \ - _prev = NULL; \ - while (_thh) { \ - if (_prev != (char*)(_thh->hh_prev)) { \ - HASH_OOPS("invalid hh_prev %p, actual %p\n", \ - _thh->hh_prev, _prev ); \ - } \ - _bkt_count++; \ - _prev = (char*)(_thh); \ - _thh = _thh->hh_next; \ - } \ - _count += _bkt_count; \ - if ((head)->hh.tbl->buckets[_bkt_i].count != _bkt_count) { \ - HASH_OOPS("invalid bucket count %u, actual %u\n", \ - (head)->hh.tbl->buckets[_bkt_i].count, _bkt_count); \ - } \ - } \ - if (_count != (head)->hh.tbl->num_items) { \ - HASH_OOPS("invalid hh item count %u, actual %u\n", \ - (head)->hh.tbl->num_items, _count ); \ - } \ - /* traverse hh in app order; check next/prev integrity, count */ \ - _count = 0; \ - _prev = NULL; \ - _thh = &(head)->hh; \ - while (_thh) { \ - _count++; \ - if (_prev !=(char*)(_thh->prev)) { \ - HASH_OOPS("invalid prev %p, actual %p\n", \ - _thh->prev, _prev ); \ - } \ - _prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh); \ - _thh = ( _thh->next ? (UT_hash_handle*)((char*)(_thh->next) + \ - (head)->hh.tbl->hho) : NULL ); \ - } \ - if (_count != (head)->hh.tbl->num_items) { \ - HASH_OOPS("invalid app item count %u, actual %u\n", \ - (head)->hh.tbl->num_items, _count ); \ + for (_bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; ++_bkt_i) { \ + unsigned _bkt_count = 0; \ + _thh = (head)->hh.tbl->buckets[_bkt_i].hh_head; \ + _prev = NULL; \ + while (_thh) { \ + if (_prev != (char*)(_thh->hh_prev)) { \ + HASH_OOPS("%s: invalid hh_prev %p, actual %p\n", \ + (where), (void*)_thh->hh_prev, (void*)_prev); \ } \ + _bkt_count++; \ + _prev = (char*)(_thh); \ + _thh = _thh->hh_next; \ + } \ + _count += _bkt_count; \ + if ((head)->hh.tbl->buckets[_bkt_i].count != _bkt_count) { \ + HASH_OOPS("%s: invalid bucket count %u, actual %u\n", \ + (where), (head)->hh.tbl->buckets[_bkt_i].count, _bkt_count); \ + } \ } \ + if (_count != (head)->hh.tbl->num_items) { \ + HASH_OOPS("%s: invalid hh item count %u, actual %u\n", \ + (where), (head)->hh.tbl->num_items, _count); \ + } \ + _count = 0; \ + _prev = NULL; \ + _thh = &(head)->hh; \ + while (_thh) { \ + _count++; \ + if (_prev != (char*)_thh->prev) { \ + HASH_OOPS("%s: invalid prev %p, actual %p\n", \ + (where), (void*)_thh->prev, (void*)_prev); \ + } \ + _prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh); \ + _thh = (_thh->next ? HH_FROM_ELMT((head)->hh.tbl, _thh->next) : NULL); \ + } \ + if (_count != (head)->hh.tbl->num_items) { \ + HASH_OOPS("%s: invalid app item count %u, actual %u\n", \ + (where), (head)->hh.tbl->num_items, _count); \ + } \ + } \ } while (0) #else -#define HASH_FSCK(hh,head) +#define HASH_FSCK(hh,head,where) #endif -/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to +/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to * the descriptor to which this macro is defined for tuning the hash function. * The app can #include <unistd.h> to get the prototype for write(2). */ #ifdef HASH_EMIT_KEYS #define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) \ do { \ - unsigned _klen = fieldlen; \ - write(HASH_EMIT_KEYS, &_klen, sizeof(_klen)); \ - write(HASH_EMIT_KEYS, keyptr, fieldlen); \ + unsigned _klen = fieldlen; \ + write(HASH_EMIT_KEYS, &_klen, sizeof(_klen)); \ + write(HASH_EMIT_KEYS, keyptr, (unsigned long)fieldlen); \ } while (0) -#else -#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) -#endif - -/* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */ -#ifdef HASH_FUNCTION -#define HASH_FCN HASH_FUNCTION #else -#define HASH_FCN HASH_JEN +#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) #endif -/* The Bernstein hash function, used in Perl prior to v5.6 */ -#define HASH_BER(key,keylen,num_bkts,hashv,bkt) \ +/* The Bernstein hash function, used in Perl prior to v5.6. Note (x<<5+x)=x*33. */ +#define HASH_BER(key,keylen,hashv) \ do { \ - unsigned _hb_keylen=keylen; \ - char *_hb_key=(char*)(key); \ + unsigned _hb_keylen = (unsigned)keylen; \ + const unsigned char *_hb_key = (const unsigned char*)(key); \ (hashv) = 0; \ - while (_hb_keylen--) { (hashv) = ((hashv) * 33) + *_hb_key++; } \ - bkt = (hashv) & (num_bkts-1); \ + while (_hb_keylen-- != 0U) { \ + (hashv) = (((hashv) << 5) + (hashv)) + *_hb_key++; \ + } \ } while (0) -/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at - * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */ -#define HASH_SAX(key,keylen,num_bkts,hashv,bkt) \ +/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at + * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx + * (archive link: https://archive.is/Ivcan ) + */ +#define HASH_SAX(key,keylen,hashv) \ do { \ unsigned _sx_i; \ - char *_hs_key=(char*)(key); \ + const unsigned char *_hs_key = (const unsigned char*)(key); \ hashv = 0; \ - for(_sx_i=0; _sx_i < keylen; _sx_i++) \ - hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i]; \ - bkt = hashv & (num_bkts-1); \ + for (_sx_i=0; _sx_i < keylen; _sx_i++) { \ + hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i]; \ + } \ } while (0) - -#define HASH_FNV(key,keylen,num_bkts,hashv,bkt) \ +/* FNV-1a variation */ +#define HASH_FNV(key,keylen,hashv) \ do { \ unsigned _fn_i; \ - char *_hf_key=(char*)(key); \ - hashv = 2166136261UL; \ - for(_fn_i=0; _fn_i < keylen; _fn_i++) \ - hashv = (hashv * 16777619) ^ _hf_key[_fn_i]; \ - bkt = hashv & (num_bkts-1); \ -} while(0); - -#define HASH_OAT(key,keylen,num_bkts,hashv,bkt) \ + const unsigned char *_hf_key = (const unsigned char*)(key); \ + (hashv) = 2166136261U; \ + for (_fn_i=0; _fn_i < keylen; _fn_i++) { \ + hashv = hashv ^ _hf_key[_fn_i]; \ + hashv = hashv * 16777619U; \ + } \ +} while (0) + +#define HASH_OAT(key,keylen,hashv) \ do { \ unsigned _ho_i; \ - char *_ho_key=(char*)(key); \ + const unsigned char *_ho_key=(const unsigned char*)(key); \ hashv = 0; \ for(_ho_i=0; _ho_i < keylen; _ho_i++) { \ hashv += _ho_key[_ho_i]; \ @@ -370,8 +629,7 @@ do { hashv += (hashv << 3); \ hashv ^= (hashv >> 11); \ hashv += (hashv << 15); \ - bkt = hashv & (num_bkts-1); \ -} while(0) +} while (0) #define HASH_JEN_MIX(a,b,c) \ do { \ @@ -386,14 +644,14 @@ do { c -= a; c -= b; c ^= ( b >> 15 ); \ } while (0) -#define HASH_JEN(key,keylen,num_bkts,hashv,bkt) \ +#define HASH_JEN(key,keylen,hashv) \ do { \ unsigned _hj_i,_hj_j,_hj_k; \ - char *_hj_key=(char*)(key); \ - hashv = 0xfeedbeef; \ - _hj_i = _hj_j = 0x9e3779b9; \ - _hj_k = keylen; \ - while (_hj_k >= 12) { \ + unsigned const char *_hj_key=(unsigned const char*)(key); \ + hashv = 0xfeedbeefu; \ + _hj_i = _hj_j = 0x9e3779b9u; \ + _hj_k = (unsigned)(keylen); \ + while (_hj_k >= 12U) { \ _hj_i += (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 ) \ + ( (unsigned)_hj_key[2] << 16 ) \ + ( (unsigned)_hj_key[3] << 24 ) ); \ @@ -407,35 +665,25 @@ do { HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ \ _hj_key += 12; \ - _hj_k -= 12; \ + _hj_k -= 12U; \ } \ - hashv += keylen; \ + hashv += (unsigned)(keylen); \ switch ( _hj_k ) { \ - case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); \ - HL_FALLTHROUGH \ - case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); \ - HL_FALLTHROUGH \ - case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); \ - HL_FALLTHROUGH \ - case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); \ - HL_FALLTHROUGH \ - case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); \ - HL_FALLTHROUGH \ - case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); \ - HL_FALLTHROUGH \ - case 5: _hj_j += _hj_key[4]; \ - HL_FALLTHROUGH \ - case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); \ - HL_FALLTHROUGH \ - case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); \ - HL_FALLTHROUGH \ - case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); \ - HL_FALLTHROUGH \ - case 1: _hj_i += _hj_key[0]; \ + case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); /* FALLTHROUGH */ \ + case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); /* FALLTHROUGH */ \ + case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); /* FALLTHROUGH */ \ + case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); /* FALLTHROUGH */ \ + case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); /* FALLTHROUGH */ \ + case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); /* FALLTHROUGH */ \ + case 5: _hj_j += _hj_key[4]; /* FALLTHROUGH */ \ + case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); /* FALLTHROUGH */ \ + case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); /* FALLTHROUGH */ \ + case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); /* FALLTHROUGH */ \ + case 1: _hj_i += _hj_key[0]; /* FALLTHROUGH */ \ + default: ; \ } \ HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ - bkt = hashv & (num_bkts-1); \ -} while(0) +} while (0) /* The Paul Hsieh hash function */ #undef get16bits @@ -448,21 +696,21 @@ do { #define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8) \ +(uint32_t)(((const uint8_t *)(d))[0]) ) #endif -#define HASH_SFH(key,keylen,num_bkts,hashv,bkt) \ +#define HASH_SFH(key,keylen,hashv) \ do { \ - char *_sfh_key=(char*)(key); \ - uint32_t _sfh_tmp, _sfh_len = keylen; \ + unsigned const char *_sfh_key=(unsigned const char*)(key); \ + uint32_t _sfh_tmp, _sfh_len = (uint32_t)keylen; \ \ - int _sfh_rem = _sfh_len & 3; \ + unsigned _sfh_rem = _sfh_len & 3U; \ _sfh_len >>= 2; \ - hashv = 0xcafebabe; \ + hashv = 0xcafebabeu... [truncated message content] |
From: n0nb <n0...@us...> - 2025-08-14 13:06:59
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, Hamlib-4.6.3 has been updated via 02363078fc379b6772a9593954585f27a3518093 (commit) via 2de29624a0ad1a662c63fac3b6aa6733ce2da62f (commit) via 1b70351bf7892e34bc56b7ad1ea1b1d7ddfa4cf1 (commit) from 8aca7436b539406bf9df1f7543a606c73227865b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 02363078fc379b6772a9593954585f27a3518093 Author: Nate Bargmann <n0...@n0...> Date: Thu Aug 14 08:05:32 2025 -0500 Update Segfault-award for rigctl fix Thanks, Daniele. diff --git a/Segfault-award b/Segfault-award index 69234e7f6..2081711a8 100644 --- a/Segfault-award +++ b/Segfault-award @@ -7,6 +7,8 @@ A developer cannot apply for HSHR for segfaults on his/her own code. Here is the list of the brave fellows: +* Daniele Forsi, IU5HKX, v4.6.4, Fix segfault with set_parm KEYERTYPE. + * Daniele Forsi, IU5HKX, v4.6.4, Improper indexing in netrigctl_open(). * Christoph Berg DF7CB python with Hamlib.rig_parse(None) commit 2de29624a0ad1a662c63fac3b6aa6733ce2da62f Author: Nate Bargmann <n0...@n0...> Date: Thu Aug 14 08:04:20 2025 -0500 Update NEWS with seg fault fix in rigctl diff --git a/NEWS b/NEWS index 7f207bc23..65adb642d 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,8 @@ Version 4.6.5 * Update Kenwood CW buffer max message size, fix one byte buffer overrun in icom.c. (TNX George Baltz). * Fix Segmentation Fault in rigs/dummy/netrigctl.c. (TNX Daniele Forsi) + * Fix segfault with set_parm KEYERTYPE in rigctl_parse.c. (TNX Daniele + Forsi) Version 4.6.4 * 2025-07-18--Hamlib's 25th birthday!!! commit 1b70351bf7892e34bc56b7ad1ea1b1d7ddfa4cf1 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Wed Aug 13 14:25:54 2025 +0200 Fix segfault with set_parm KEYERTYPE Steps to reproduce: tests/rigctl -m 1 \ set_parm KEYERTYPE BUG Fixes: Thread 1 "rigctl" received signal SIGSEGV, Segmentation fault. __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:142 warning: 142 ../sysdeps/x86_64/multiarch/strlen-sse2.S: File o directory non esistente (gdb) bt #0 __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:142 #1 0x00007ffac346e300 in __printf_buffer (buf=buf@entry=0x7ffc3bcf40d0, format=0x7ffac38aef17 "%s", ap=0x7ffc3bcf4190, mode_flags=0) at ./stdio-common/vfprintf-process-arg.c:435 #2 0x00007ffac3491daf in __vsnprintf_internal (string=<optimized out>, maxlen=<optimized out>, format=<optimized out>, args=args@entry=0x7ffc3bcf4190, mode_flags=mode_flags@entry=0) at ./libio/vsnprintf.c:96 #3 0x00007ffac3469642 in __GI___snprintf (s=s@entry=0x7ffc3bcf4290 "", maxlen=maxlen@entry=32, format=format@entry=0x7ffac38aef17 "%s") at ./stdio-common/snprintf.c:31 #4 0x00007ffac370b7b9 in dummy_set_parm (rig=0x558fe1991b20, parm=2048, val=...) at dummy.c:1704 #5 0x0000558fb536afbe in rigctl_set_parm (rig=0x558fe1991b20, fout=0x7ffac35f25c0 <_IO_2_1_stdout_>, fin=<optimized out>, interactive=<optimized out>, prompt=<optimized out>, vfo_opt=<optimized out>, send_cmd_term=13 '\r', ext_resp=0, resp_sep=10 '\n', cmd=0x558fb5388000 <test_list+1440>, vfo=536870912, arg1=0x7ffc3bcf4e10 "KEYERTYPE", arg2=0x558fb537fdb1 "1", arg3=0x558fb537ece8 "") at rigctl_parse.c:3829 #6 0x0000558fb53727d6 in rigctl_parse (my_rig=<optimized out>, fin=<optimized out>, fout=<optimized out>, argv=argv@entry=0x7ffc3bcf6fd8, argc=argc@entry=3, sync_cb=sync_cb@entry=0x0, interactive=<optimized out>, prompt=<optimized out>, vfo_opt=<optimized out>, send_cmd_term=<optimized out>, ext_resp_ptr=<optimized out>, resp_sep_ptr=<optimized out>, use_password=<optimized out>) at rigctl_parse.c:1847 #7 0x0000558fb535cadc in main (argc=<optimized out>, argv=0x7ffc3bcf6fd8) at rigctl.c:801 (cherry picked from commit 12ba55834370d0b314079f6a67983c11bb26a3b9) diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index f67d7d179..79475a8ac 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -3794,11 +3794,13 @@ declare_proto_rig(set_parm) } else if (RIG_PARM_IS_STRING(parm)) { +#if 0 if (parm == RIG_PARM_KEYERTYPE) { val.i = atoi(arg2); } else +#endif { val.cs = arg2; } ----------------------------------------------------------------------- Summary of changes: NEWS | 2 ++ Segfault-award | 2 ++ tests/rigctl_parse.c | 2 ++ 3 files changed, 6 insertions(+) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-14 13:00:28
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 98f6da8ae325f7383a8b1d2a9026516aa6fcf414 (commit) via 2f2b703ccf9417ca07b7f1e54603514f89ebea31 (commit) via b5b9e136a14138a33c79f782b01e9e586dbc22ea (commit) via fb4d2c6455d6cbc6b832f9bbc9365bc691e137e3 (commit) via 301391211102efba2e01ecb5fbdd059a2a00071c (commit) via 12ba55834370d0b314079f6a67983c11bb26a3b9 (commit) via a81aab6e116ba34fb20aaf01ae06edbe725d9bff (commit) via 762caa85c0eb094f0b311aaba74fe686b5e1970c (commit) via ff5500b2d933195344cb458e689d26c58a7a5f32 (commit) from 4b6b5415f546a7dd0ffa3aaff09c7275449adbc5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 98f6da8ae325f7383a8b1d2a9026516aa6fcf414 Merge: 4b6b5415f 2f2b703cc Author: Nate Bargmann <n0...@n0...> Date: Wed Aug 13 20:43:09 2025 -0500 Merge GitHub PR #1845 commit 2f2b703ccf9417ca07b7f1e54603514f89ebea31 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Wed Aug 13 22:02:59 2025 +0200 Handle the question mark as second argument of set_parm KEYERTYPE in rigctl Test case: tests/rigctl -m 1 \ set_parm KEYERTYPE '?' \ set_parm BANDSELECT '?' STRAIGHT BUG PADDLE BANDUNUSED BAND70CM BAND33CM BAND23CM diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 8503317e6..711dd7502 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -3719,11 +3719,10 @@ declare_proto_rig(set_parm) parm = rig_parse_parm(arg1); - if (parm == RIG_PARM_BANDSELECT && !strcmp(arg2, "?")) + if ((parm == RIG_PARM_BANDSELECT || parm == RIG_PARM_KEYERTYPE) && !strcmp(arg2, "?")) { char s[SPRINTF_MAX_SIZE]; - rig_sprintf_parm_gran(s, sizeof(s) - 1, RIG_PARM_BANDSELECT, - rig->caps->parm_gran); + rig_sprintf_parm_gran(s, sizeof(s) - 1, parm, rig->caps->parm_gran); char *p = strchr(s, ')'); if (p) { *p = 0; } commit b5b9e136a14138a33c79f782b01e9e586dbc22ea Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Wed Aug 13 17:27:06 2025 +0200 Do not use strcmp() when we are going to get a RIG_PARM_* define anyway diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 2fef0aadc..8503317e6 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -3717,7 +3717,9 @@ declare_proto_rig(set_parm) RETURNFUNC2(RIG_OK); } - if (strcmp(arg1, "BANDSELECT") == 0 && !strcmp(arg2, "?")) + parm = rig_parse_parm(arg1); + + if (parm == RIG_PARM_BANDSELECT && !strcmp(arg2, "?")) { char s[SPRINTF_MAX_SIZE]; rig_sprintf_parm_gran(s, sizeof(s) - 1, RIG_PARM_BANDSELECT, @@ -3740,7 +3742,7 @@ declare_proto_rig(set_parm) else { RETURNFUNC2(-RIG_EINTERNAL); } } - if (strcmp(arg1, "KEYERTYPE") == 0 && strcmp(arg2, "?") != 0) + if (parm == RIG_PARM_KEYERTYPE && strcmp(arg2, "?") != 0) { if (strcmp(arg2, "STRAIGHT") == 0) {arg2 = "0";} else if (strcmp(arg2, "BUG") == 0) {arg2 = "1";} @@ -3748,8 +3750,6 @@ declare_proto_rig(set_parm) else {RETURNFUNC2(-RIG_EINVAL)} } - parm = rig_parse_parm(arg1); - if (!rig_has_set_parm(rig, parm)) { const struct confparams *cfp; commit fb4d2c6455d6cbc6b832f9bbc9365bc691e137e3 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Wed Aug 13 16:43:32 2025 +0200 Fix segfault when using the dummy driver Steps to reproduce: tests/rigctl -m 1 \ get_parm KEYERTYPE Fixes: Thread 1 "rigctl" received signal SIGSEGV, Segmentation fault. 0x0000556aff4f890d in rigctl_get_parm (rig=<optimized out>, fout=0x7f87517f25c0 <_IO_2_1_stdout_>, fin=<optimized out>, interactive=1, prompt=1, vfo_opt=<optimized out>, send_cmd_term=13 '\r', ext_resp=0, resp_sep=10 '\n', cmd=0x556aff516050 <test_list+1520>, vfo=536870912, arg1=0x7ffc5985b5c0 "KEYERTYPE", arg2=0x556aff50cce8 "", arg3=0x556aff50cce8 "") at rigctl_parse.c:3947 3947 if (strcmp(val.s, "0") == 0) {s = "STRAIGHT";} (gdb) bt #0 0x0000556aff4f890d in rigctl_get_parm (rig=<optimized out>, fout=0x7f87517f25c0 <_IO_2_1_stdout_>, fin=<optimized out>, interactive=1, prompt=1, vfo_opt=<optimized out>, send_cmd_term=13 '\r', ext_resp=0, resp_sep=10 '\n', cmd=0x556aff516050 <test_list+1520>, vfo=536870912, arg1=0x7ffc5985b5c0 "KEYERTYPE", arg2=0x556aff50cce8 "", arg3=0x556aff50cce8 "") at rigctl_parse.c:3947 #1 0x0000556aff5007f6 in rigctl_parse (my_rig=<optimized out>, fin=<optimized out>, fout=<optimized out>, argv=argv@entry=0x7ffc5985d788, argc=argc@entry=3, sync_cb=sync_cb@entry=0x0, interactive=<optimized out>, prompt=<optimized out>, vfo_opt=<optimized out>, send_cmd_term=<optimized out>, ext_resp_ptr=<optimized out>, resp_sep_ptr=<optimized out>, use_password=<optimized out>) at rigctl_parse.c:1847 #2 0x0000556aff4eaadc in main (argc=<optimized out>, argv=0x7ffc5985d788) at rigctl.c:801 diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 509031227..2fef0aadc 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -3944,7 +3944,8 @@ declare_proto_rig(get_parm) { const char *cs; - if (strcmp(val.cs, "0") == 0) {cs = "STRAIGHT";} + if (val.cs == NULL) {cs = "(null)";} + else if (strcmp(val.cs, "0") == 0) {cs = "STRAIGHT";} else if (strcmp(val.cs, "1") == 0) {cs = "BUG";} else if (strcmp(val.cs, "2") == 0) {cs = "PADDLE";} else {cs = "UNKNOWN";} commit 301391211102efba2e01ecb5fbdd059a2a00071c Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Wed Aug 13 16:21:57 2025 +0200 Make get_param read back the value passed to set_param Test case: tests/rigctl -m 1 \ set_parm KEYERTYPE BUG get_parm KEYERTYPE \ set_parm KEYERTYPE PADDLE get_parm KEYERTYPE \ set_parm KEYERTYPE STRAIGHT get_parm KEYERTYPE BUG PADDLE STRAIGHT diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 4bcb0b9d9..509031227 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -3942,12 +3942,14 @@ declare_proto_rig(get_parm) if (parm == RIG_PARM_KEYERTYPE) { - char *s = "STRAIGHT"; + const char *cs; - if (val.i == 1) { s = "BUG"; } - else if (val.i == 2) { s = "PADDLE"; } + if (strcmp(val.cs, "0") == 0) {cs = "STRAIGHT";} + else if (strcmp(val.cs, "1") == 0) {cs = "BUG";} + else if (strcmp(val.cs, "2") == 0) {cs = "PADDLE";} + else {cs = "UNKNOWN";} - fprintf(fout, "%s%c", s, resp_sep); + fprintf(fout, "%s%c", cs, resp_sep); } else if (RIG_PARM_IS_FLOAT(parm)) { commit 12ba55834370d0b314079f6a67983c11bb26a3b9 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Wed Aug 13 14:25:54 2025 +0200 Fix segfault with set_parm KEYERTYPE Steps to reproduce: tests/rigctl -m 1 \ set_parm KEYERTYPE BUG Fixes: Thread 1 "rigctl" received signal SIGSEGV, Segmentation fault. __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:142 warning: 142 ../sysdeps/x86_64/multiarch/strlen-sse2.S: File o directory non esistente (gdb) bt #0 __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:142 #1 0x00007ffac346e300 in __printf_buffer (buf=buf@entry=0x7ffc3bcf40d0, format=0x7ffac38aef17 "%s", ap=0x7ffc3bcf4190, mode_flags=0) at ./stdio-common/vfprintf-process-arg.c:435 #2 0x00007ffac3491daf in __vsnprintf_internal (string=<optimized out>, maxlen=<optimized out>, format=<optimized out>, args=args@entry=0x7ffc3bcf4190, mode_flags=mode_flags@entry=0) at ./libio/vsnprintf.c:96 #3 0x00007ffac3469642 in __GI___snprintf (s=s@entry=0x7ffc3bcf4290 "", maxlen=maxlen@entry=32, format=format@entry=0x7ffac38aef17 "%s") at ./stdio-common/snprintf.c:31 #4 0x00007ffac370b7b9 in dummy_set_parm (rig=0x558fe1991b20, parm=2048, val=...) at dummy.c:1704 #5 0x0000558fb536afbe in rigctl_set_parm (rig=0x558fe1991b20, fout=0x7ffac35f25c0 <_IO_2_1_stdout_>, fin=<optimized out>, interactive=<optimized out>, prompt=<optimized out>, vfo_opt=<optimized out>, send_cmd_term=13 '\r', ext_resp=0, resp_sep=10 '\n', cmd=0x558fb5388000 <test_list+1440>, vfo=536870912, arg1=0x7ffc3bcf4e10 "KEYERTYPE", arg2=0x558fb537fdb1 "1", arg3=0x558fb537ece8 "") at rigctl_parse.c:3829 #6 0x0000558fb53727d6 in rigctl_parse (my_rig=<optimized out>, fin=<optimized out>, fout=<optimized out>, argv=argv@entry=0x7ffc3bcf6fd8, argc=argc@entry=3, sync_cb=sync_cb@entry=0x0, interactive=<optimized out>, prompt=<optimized out>, vfo_opt=<optimized out>, send_cmd_term=<optimized out>, ext_resp_ptr=<optimized out>, resp_sep_ptr=<optimized out>, use_password=<optimized out>) at rigctl_parse.c:1847 #7 0x0000558fb535cadc in main (argc=<optimized out>, argv=0x7ffc3bcf6fd8) at rigctl.c:801 diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 849bc23ad..4bcb0b9d9 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -3812,11 +3812,13 @@ declare_proto_rig(set_parm) } else if (RIG_PARM_IS_STRING(parm)) { +#if 0 if (parm == RIG_PARM_KEYERTYPE) { val.i = atoi(arg2); } else +#endif { val.cs = arg2; } commit a81aab6e116ba34fb20aaf01ae06edbe725d9bff Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Wed Aug 13 14:20:14 2025 +0200 Return an error if the keyer type is unknown Instead of quietly doing nothing. diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 75c1c1bea..849bc23ad 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -3745,6 +3745,7 @@ declare_proto_rig(set_parm) if (strcmp(arg2, "STRAIGHT") == 0) {arg2 = "0";} else if (strcmp(arg2, "BUG") == 0) {arg2 = "1";} else if (strcmp(arg2, "PADDLE") == 0) {arg2 = "2";} + else {RETURNFUNC2(-RIG_EINVAL)} } parm = rig_parse_parm(arg1); commit 762caa85c0eb094f0b311aaba74fe686b5e1970c Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Wed Aug 13 12:54:58 2025 +0200 Remove stray char after printing value of KEYERTYPE Steps to reproduce: tests/rigctl -m 1 get_parm KEYERTYPE STRAIGHT v <-- this 'v' shouldn't be there diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 732745b3f..75c1c1bea 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -3944,7 +3944,7 @@ declare_proto_rig(get_parm) if (val.i == 1) { s = "BUG"; } else if (val.i == 2) { s = "PADDLE"; } - fprintf(fout, "%s%cv", s, resp_sep); + fprintf(fout, "%s%c", s, resp_sep); } else if (RIG_PARM_IS_FLOAT(parm)) { commit ff5500b2d933195344cb458e689d26c58a7a5f32 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Wed Aug 13 12:31:56 2025 +0200 Avoid segfaulting when val.cs is NULL This is the case for BANDSELECT and KEYERTYPE. Use SNPRINTF() which deals with NULLs printing (null) and it is used with the other datatypes.. Steps to reproduce: tests/rigctl -m 1 set_parm KEYERTYPE '?' tests/rigctl -m 1 set_parm BANDSELECT 1 Fixes: Thread 1 "rigctl" received signal SIGSEGV, Segmentation fault. __strcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:302 warning: 302 ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S: File o directory non esistente (gdb) bt #0 __strcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:302 #1 0x00007f8ab4d0b7ab in dummy_set_parm (rig=0x55d19b6cab20, parm=2048, val=...) at dummy.c:1704 #2 0x000055d175b8c03d in rigctl_set_parm (rig=0x55d19b6cab20, fout=0x7f8ab4bf25c0 <_IO_2_1_stdout_>, fin=<optimized out>, interactive=<optimized out>, prompt=<optimized out>, vfo_opt=<optimized out>, send_cmd_term=13 '\r', ext_resp=0, resp_sep=10 '\n', cmd=0x55d175ba9000 <test_list+1440>, vfo=536870912, arg1=0x7ffd730281e0 "KEYERTYPE", arg2=0x7ffd730283e0 "'?'", arg3=0x55d175b9fce8 "") at rigctl_parse.c:3828 #3 0x000055d175b93756 in rigctl_parse (my_rig=<optimized out>, fin=<optimized out>, fout=<optimized out>, argv=argv@entry=0x7ffd7302a3a8, argc=argc@entry=3, sync_cb=sync_cb@entry=0x0, interactive=<optimized out>, prompt=<optimized out>, vfo_opt=<optimized out>, send_cmd_term=<optimized out>, ext_resp_ptr=<optimized out>, resp_sep_ptr=<optimized out>, use_password=<optimized out>) at rigctl_parse.c:1847 #4 0x000055d175b7dadc in main (argc=<optimized out>, argv=0x7ffd7302a3a8) at rigctl.c:801 diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index 544de59cc..dc9b5c69a 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -1701,7 +1701,7 @@ static int dummy_set_parm(RIG *rig, setting_t parm, value_t val) if (RIG_PARM_IS_STRING(parm)) { - strcpy(pstr, val.cs); + SNPRINTF(pstr, sizeof(pstr), "%s", val.cs); } else { ----------------------------------------------------------------------- Summary of changes: rigs/dummy/dummy.c | 2 +- tests/rigctl_parse.c | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-13 13:07:15
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 4b6b5415f546a7dd0ffa3aaff09c7275449adbc5 (commit) via 663fd4f738f770c27a6928012e443b35c0ff5fe6 (commit) from 99047473585dcac9ccaff6a87015f974b73e9fd8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4b6b5415f546a7dd0ffa3aaff09c7275449adbc5 Merge: 990474735 663fd4f73 Author: Nate Bargmann <n0...@n0...> Date: Wed Aug 13 07:06:43 2025 -0500 Merge GitHub PR #1844 commit 663fd4f738f770c27a6928012e443b35c0ff5fe6 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Wed Aug 13 11:33:40 2025 +0200 Fix compiler warnings Fixes: hamlibpy_wrap.c: In function 'Rig_send_raw': hamlibpy_wrap.c:4668:30: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 4668 | send = PyUnicode_AsUTF8AndSize(send_obj, &send_len); | ^ hamlibpy_wrap.c:4679:30: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 4679 | term = PyUnicode_AsUTF8AndSize(term_obj, NULL); | ^ Thanks to @GeoBaltz diff --git a/bindings/rig.swg b/bindings/rig.swg index 808183d2a..7aca173ef 100644 --- a/bindings/rig.swg +++ b/bindings/rig.swg @@ -739,13 +739,16 @@ int *rig_spectrum_cb_python(RIG *rig, struct rig_spectrum_line *rig_spectrum_lin PyObject *send_raw(PyObject *send_obj, PyObject *term_obj=NULL) { char *send, *term; + PyObject *bytes_obj; size_t send_len; int reply_len = MAX_RETURNSTR; unsigned char reply_buffer[MAX_RETURNSTR]; int count; if (PyUnicode_Check(send_obj)) { - send = PyUnicode_AsUTF8AndSize(send_obj, &send_len); + bytes_obj = PyUnicode_AsUTF8String(send_obj); + PyBytes_AsStringAndSize(bytes_obj, &send, &send_len); + Py_XDECREF(bytes_obj); } else if (PyBytes_Check(send_obj)) { PyBytes_AsStringAndSize(send_obj, &send, &send_len); } else { @@ -756,7 +759,9 @@ int *rig_spectrum_cb_python(RIG *rig, struct rig_spectrum_line *rig_spectrum_lin // Using NULL for length in PyUnicode_AsUTF8AndSize() and PyBytes_AsStringAndSize() // because we can't accept '\0' because there is no length for term in rig_send_raw() if (PyUnicode_Check(term_obj)) { - term = PyUnicode_AsUTF8AndSize(term_obj, NULL); + bytes_obj = PyUnicode_AsUTF8String(term_obj); + PyBytes_AsStringAndSize(bytes_obj, &term, NULL); + Py_XDECREF(bytes_obj); } else if (PyBytes_Check(term_obj)) { PyBytes_AsStringAndSize(term_obj, &term, NULL); } else if (term_obj == Py_None) { ----------------------------------------------------------------------- Summary of changes: bindings/rig.swg | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-13 02:50:18
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 99047473585dcac9ccaff6a87015f974b73e9fd8 (commit) via 2a2f33673ea987c3f314e58c90b0231349aa683e (commit) via 4187e9f4a31a1c4c7d7e5d456e6012007bf0dfeb (commit) from f32b744ac98a1d9e3c7231c46b4ae3b5323b4628 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 99047473585dcac9ccaff6a87015f974b73e9fd8 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Tue Aug 12 23:24:32 2025 +0200 Handle the question mark as second argument of set_level in ampctl Test command: tests/ampctl -m 1 \ set_level FAULT '?' \ set_level NH '?' \ set_level PF '?' \ set_level PWRFORWARD '?' \ set_level PWRINPUT '?' \ set_level PWRPEAK '?' \ set_level PWRREFLECTED '?' \ set_level SWR '?' diff --git a/tests/ampctl_parse.c b/tests/ampctl_parse.c index e359b20b6..44705b8d5 100644 --- a/tests/ampctl_parse.c +++ b/tests/ampctl_parse.c @@ -1713,6 +1713,25 @@ declare_proto_amp(set_level) level = rig_parse_level(arg1); + if (!strcmp(arg2, "?")) + { + const gran_t *gran = STATE(amp)->level_gran; + int idx = rig_setting2idx(level); + + if (AMP_LEVEL_IS_FLOAT(level)) + { + fprintf(fout, "(%f..%f/%f)%c", gran[idx].min.f, + gran[idx].max.f, gran[idx].step.f, resp_sep); + } + else + { + fprintf(fout, "(%d..%d/%d)%c", gran[idx].min.i, + gran[idx].max.i, gran[idx].step.i, resp_sep); + } + + return RIG_OK; + } + // some Java apps send comma in international setups so substitute period char *p = strchr(arg2, ','); commit 2a2f33673ea987c3f314e58c90b0231349aa683e Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Tue Aug 12 20:38:48 2025 +0200 Handle the question mark as second argument of set_level in rotctl Test command: tests/rotctl -m 1 \ set_level MGC '?' \ set_level MGF '?' \ set_level MGL '?' \ set_level SPEED '?' diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c index 9c0553e2f..861bbf41c 100644 --- a/tests/rotctl_parse.c +++ b/tests/rotctl_parse.c @@ -1950,6 +1950,25 @@ declare_proto_rot(set_level) level = rot_parse_level(arg1); + if (!strcmp(arg2, "?")) + { + const gran_t *gran = STATE(rot)->level_gran; + int idx = rig_setting2idx(level); + + if (ROT_LEVEL_IS_FLOAT(level)) + { + fprintf(fout, "(%f..%f/%f)%c", gran[idx].min.f, + gran[idx].max.f, gran[idx].step.f, resp_sep); + } + else + { + fprintf(fout, "(%d..%d/%d)%c", gran[idx].min.i, + gran[idx].max.i, gran[idx].step.i, resp_sep); + } + + return RIG_OK; + } + if (!rot_has_set_level(rot, level)) { const struct confparams *cfp; commit 4187e9f4a31a1c4c7d7e5d456e6012007bf0dfeb Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Tue Aug 12 17:24:52 2025 +0200 Handle the question mark as second argument of set_level in rigctl Closes #720. Test command: tests/rigctl -m 1 \ set_level AF '?' set_level AGC '?' set_level AGC_TIME '?' \ set_level ANTIVOX '?' set_level APF '?' set_level ATT '?' \ set_level BAL '?' set_level BAND_SELECT '?' set_level BKINDL '?' \ set_level BKIN_DLYMS '?' set_level COMP '?' set_level CWPITCH '?' \ set_level IF '?' set_level KEYSPD '?' set_level METER '?' \ set_level MGC '?' set_level MGF '?' set_level MGL '?' \ set_level MICGAIN '?' set_level MONITOR_GAIN '?' set_level NB '?' \ set_level NOTCHF '?' set_level NOTCHF_RAW '?' set_level NR '?' \ set_level PBT_IN '?' set_level PBT_OUT '?' set_level PREAMP '?' \ set_level RF '?' set_level RFPOWER '?' set_level SLOPE_HIGH '?' \ set_level SLOPE_LOW '?' set_level SPECTRUM_ATT '?' set_level SPECTRUM_AVG '?' \ set_level SPECTRUM_EDGE_HIGH '?' set_level SPECTRUM_EDGE_LOW '?' set_level SPECTRUM_MODE '?' \ set_level SPECTRUM_REF '?' set_level SPECTRUM_SPAN '?' set_level SPECTRUM_SPEED '?' \ set_level SQL '?' set_level USB_AF '?' set_level USB_AF_INPUT '?' \ set_level VOXDELAY '?' set_level VOXGAIN '?' diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 4db850e87..732745b3f 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -3352,9 +3352,27 @@ declare_proto_rig(set_level) level = rig_parse_level(arg1); - if ((!strcmp(arg2, "?") || arg2[0] == 0) && level == RIG_LEVEL_METER) + if (!strcmp(arg2, "?")) { - fprintf(fout, "COMP ALC SWR ID/IC VDD DB PO TEMP%c", resp_sep); + if (level == RIG_LEVEL_METER) + { + fprintf(fout, "COMP ALC SWR ID/IC VDD DB PO TEMP%c", resp_sep); + } else { + const gran_t *gran = STATE(rig)->level_gran; + int idx = rig_setting2idx(level); + + if (RIG_LEVEL_IS_FLOAT(level)) + { + fprintf(fout, "(%f..%f/%f)%c", gran[idx].min.f, + gran[idx].max.f, gran[idx].step.f, resp_sep); + } + else + { + fprintf(fout, "(%d..%d/%d)%c", gran[idx].min.i, + gran[idx].max.i, gran[idx].step.i, resp_sep); + } + } + RETURNFUNC2(RIG_OK); } ----------------------------------------------------------------------- Summary of changes: tests/ampctl_parse.c | 19 +++++++++++++++++++ tests/rigctl_parse.c | 22 ++++++++++++++++++++-- tests/rotctl_parse.c | 19 +++++++++++++++++++ 3 files changed, 58 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2025-08-12 17:00:48
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via f32b744ac98a1d9e3c7231c46b4ae3b5323b4628 (commit) via 84fbe1df4a2357b00e48430f0206d2f7b641817d (commit) via 9e6ff6edccde4e3ebd346d7f07a2889a0c43735e (commit) from c51357388cb8b52456e2c8561f2f3f329d12cb86 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f32b744ac98a1d9e3c7231c46b4ae3b5323b4628 Author: Nate Bargmann <n0...@n0...> Date: Tue Aug 12 11:57:10 2025 -0500 Update Segfault-award for netrigctl_open() fix Congrats, Daniele! diff --git a/Segfault-award b/Segfault-award index e775238db..69234e7f6 100644 --- a/Segfault-award +++ b/Segfault-award @@ -7,6 +7,8 @@ A developer cannot apply for HSHR for segfaults on his/her own code. Here is the list of the brave fellows: +* Daniele Forsi, IU5HKX, v4.6.4, Improper indexing in netrigctl_open(). + * Christoph Berg DF7CB python with Hamlib.rig_parse(None) * Saku Nyland OH1KH v4.5.1, 10/2022, rigctld.c using ptt_type=RTS commit 84fbe1df4a2357b00e48430f0206d2f7b641817d Merge: c51357388 9e6ff6edc Author: Nate Bargmann <n0...@n0...> Date: Tue Aug 12 07:50:53 2025 -0500 Merge GitHub PR #1842 commit 9e6ff6edccde4e3ebd346d7f07a2889a0c43735e Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Tue Aug 12 14:01:30 2025 +0200 Fix segfault when executing the dump_caps command Need to convert the level number 0..63 to the level bit mask. Steps to reproduce tests/rigctld -m 1 & tests/rigctl -m 2 dump_caps Fixes: Thread 1 "rigctl" received signal SIGSEGV, Segmentation fault. [..] (gdb) bt #0 __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-sse2.S:174 #1 0x00007f532c46e300 in __printf_buffer (buf=buf@entry=0x7ffc320ad970, format=0x7f532c8aba22 "%s(%s) ", ap=0x7ffc320ada30, mode_flags=0) at ./stdio-common/vfprintf-process-arg.c:435 #2 0x00007f532c491daf in __vsnprintf_internal (string=<optimized out>, maxlen=<optimized out>, format=<optimized out>, args=args@entry=0x7ffc320ada30, mode_flags=mode_flags@entry=0) at ./libio/vsnprintf.c:96 #3 0x00007f532c469642 in __GI___snprintf ( s=s@entry=0x7ffc320aec94 "BANDSELECT(00000..0.000000/0.000000) NR(0.000000..0.000000/0.000000) PBT_IN(0.000000..0.000000/0.000000) PBT_OUT(0.000000..0.000000/0.000000) CWPITCH(0..0/10) RFPOWER(0.050000..1.000000/0.001957) MICG"..., maxlen=maxlen@entry=3948, format=format@entry=0x7f532c8aba22 "%s(%s) ") at ./stdio-common/snprintf.c:31 #4 0x00007f532c6dc14a in rig_sprintf_parm_gran ( str=str@entry=0x7ffc320aec00 "ANN(0..0/0) APO(0..0/0) BACKLIGHT(0..0/0) BEEP(0..1316880384/1315832322) TIME(0..0/0) BAT(0..0/0) KEYLIGHT(0..0/0) SCREENSAVER(0..4/0) AFIF(0..0/0) BANDSELECT(00000..0.000000/0.000000) NR(0.000000..0."..., nlen=nlen@entry=4096, parm=9223372036854775807, gran=gran@entry=0x55f1f3cac338) at sprintflst.c:646 #5 0x000055f1eb6cd487 in dumpstate (rig=rig@entry=0x55f1f3ca5b20, fout=fout@entry=0x7f532c5f25c0 <_IO_2_1_stdout_>) at dumpstate.c:408 #6 0x000055f1eb6b4b81 in rigctl_dump_caps (rig=0x55f1f3ca5b20, fout=0x7f532c5f25c0 <_IO_2_1_stdout_>, fin=<optimized out>, interactive=<optimized out>, prompt=<optimized out>, vfo_opt=<optimized out>, send_cmd_term=13 '\r', ext_resp=0, resp_sep=10 '\n', cmd=0x55f1eb6dc0e0 <test_list+5760>, vfo=536870912, arg1=0x0, arg2=0x55f1eb6d1ce8 "", arg3=0x55f1eb6d1ce8 "") at rigctl_parse.c:4622 #7 0x000055f1eb6c65f6 in rigctl_parse (my_rig=<optimized out>, fin=<optimized out>, fout=<optimized out>, argv=argv@entry=0x7ffc320b2138, argc=argc@entry=3, sync_cb=sync_cb@entry=0x0, interactive=<optimized out>, prompt=<optimized out>, vfo_opt=<optimized out>, send_cmd_term=<optimized out>, ext_resp_ptr=<optimized out>, resp_sep_ptr=<optimized out>, use_password=<optimized out>) at rigctl_parse.c:1847 #8 0x000055f1eb6b0adc in main (argc=<optimized out>, argv=0x7ffc320b2138) at rigctl.c:801 diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 9e39365ea..b5551ca14 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -861,8 +861,9 @@ static int netrigctl_open(RIG *rig) for (i = 0; p != NULL && i < RIG_SETTING_MAX; ++i) { - int level; - sscanf(p, "%d", &level); + int idx, level; + sscanf(p, "%d", &idx); + level = rig_idx2setting(idx); rig->caps->parm_gran[i].step.s = 0; ----------------------------------------------------------------------- Summary of changes: Segfault-award | 2 ++ rigs/dummy/netrigctl.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |