# HG changeset patch # User Josef 'Jeff' Sipek # Date 1688417396 14400 # Mon Jul 03 16:49:56 2023 -0400 # Node ID ecf430d9eee448b17677beedbd491d66dd16a427 # Parent e31b1300d4dfbfb9ea08fda96dc93a395c5488d7 hlog: add 'section' command to set ARRL/RAC section abbreviation Signed-off-by: Josef 'Jeff' Sipek diff --git a/README b/README --- a/README +++ b/README @@ -184,6 +184,7 @@ cm - set (short) comment for this QSO seqs - set sent contest serial (e.g., 123) seqr - set received contest serial (e.g., 456) + section - set received section abbreviation (e.g., EMA) In general, the more common commands try to be short, so one is not forced to type long strings in the middle of a contact. As a result, many commands diff --git a/hlog/hlog.c b/hlog/hlog.c --- a/hlog/hlog.c +++ b/hlog/hlog.c @@ -236,6 +236,7 @@ static enum cmd_result cmd_pota(char *arg, char *error, size_t errorlen); static enum cmd_result cmd_sota(char *arg, char *error, size_t errorlen); static enum cmd_result cmd_wwff(char *arg, char *error, size_t errorlen); +static enum cmd_result cmd_section(char *arg, char *error, size_t errorlen); static struct val *state_get_date(void); static struct val *state_get_start_time(void); @@ -335,6 +336,7 @@ { "pota", cmd_pota, true, 0 }, { "sota", cmd_sota, true, 0 }, { "wwff", cmd_wwff, true, 0 }, + { "section",cmd_section, true, 0 }, }; static WINDOW *header_win; @@ -1388,6 +1390,20 @@ return __cmd_sig(arg, error, errorlen, "WWFF", "rx_wwff"); } +static enum cmd_result cmd_section(char *arg, char *error, size_t errorlen) +{ + int ret; + + ret = qso_set_section(¤t->qso->rx, arg); + if (ret) { + snprintf(error, errorlen, "Failed to set section: %s", + xstrerror(ret)); + return ret; + } + + return CR_OK; +} + static void print_field(WINDOW *win, int row, int col, const char *str, size_t width, bool dirty) {