xlua: make NEQP work for any year

Instead of hard-coding a year, check the year specified by the user on the
command line.

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
xlua: use each_with_each in POTA contest script

There are more uses for each_with_each in the POTA script, but this will do
for now as a proof-of-concept.

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
xlua: add each_with_each util function

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
xlua: generalize split_on_commas util function to split on any separator

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
contest: properly error out when exporting without an export handler

If a contest script doesn't define an export event handler, we must have an
empty lua stack on return from script_event_export, we need to set the error
string properly, and we must return an non-zero to indicate a failure.

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
common: handle Alaska ITU zone lookup

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
common: handle all lower 48 US states in ITU zone lookup

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
xlua: NEQP 2024 update

This change...

1. updates CT multipliers to match the new 2024 list
2. swaps the state and county in the abbreviation (e.g., MIDMA is now MAMID)
3. adds dup checking

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
xlua: add read-only cabrillo_mode qso field

This is easier than getting the hlog mode and then trying to map it to
Cabrillo mode.

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
xlua: add read-only adif_{,sub}mode qso fields

This is more convenient than getting the hlog mode and then trying to map it
to ADIF mode/submode.

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
common: add cabrillo mode and lookup function

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
common: rename mode lookup functions to better indicate the subsystem

They used to be the "ADIF mode" functions.  But the code is turning into a
more generic "mode" lookup set of functions.

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
common: rename adif mode mapping code into a generic mode mapping

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
common: don't use sa_len sockaddr member as it doesn't exist on Linux

A better way to check for broadcast addresses being unused is to check the
sa_family for AF_UNSPEC.

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
tag-and-sign.sh: archive the tagged version not the signature rev

Instead of generating the tarball for the current checked out directory's
rev (., which is the commit with the signature for the tag commit), generate
the tarball for the revision pointed to by the newly created tag.

This way, the .hg_archival.txt will contain a tag distance of 0 instead of 2
(the tag commit + the signature commit).

The only downside is that the tarball's .hgtags and .hgsigs will not contain
the just-generated tag and signature.  In practice, that doesn't matter
since both the tag and the signature refer to commit hashes - and those
aren't relevant with just a tarball.

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
cmake: handle .hg_archival.txt for revision at a tag

There is no 'latesttag' or 'latesttagdistance' when the archive is for a
revision at a tag.

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Added signature for changeset 82bc723051df

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Added tag v0.23-rc3 for changeset f31cafa62757

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
tag-and-sign.sh: add license header

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
cmake: rework version & hg commit getting

hg archive generated tarballs include a .hg_archival.txt file which includes
the commit hash, latest tag, and distance from latest tag.  These values can
be combined to create a string much like the template-based version string.

Additionally, this commit renames the HG_COMMIT define to HG_COMMIT_STR and
adds a new HG_COMMIT_BIN which is a C array of bytes representing the same
information as HG_COMMIT_STR.  (In other words, HG_COMMIT_STR is the
hexdumped version of HG_COMMIT_BIN.)

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Next