On 06/13/2013 09:37 AM, Bruce Korb wrote:
On 06/10/13 22:41, Paul Eggert wrote:
Maybe someone else can come up with something even better.
This:
#define SIG_OFFSET_AFTER_START 0
static char const sig_strings[] =
#ifdef SIGHUP
#define SIG_HUP_OFFSET SIG_OFFSET_AFTER_START
#define SIG_OFFSET_AFTER_HUP (SIG_OFFSET_AFTER_START + 4)
"HUP\0"
#else
#define SIG_OFFSET_AFTER_HUP SIG_OFFSET_AFTER_START
#endif
#ifdef SIGINT
#define SIG_INT_OFFSET SIG_OFFSET_AFTER_HUP
#define SIG_OFFSET_AFTER_INT (SIG_OFFSET_AFTER_HUP + 4)
"INT\0"
#else
#define SIG_OFFSET_AFTER_INT SIG_OFFSET_AFTER_HUP
#endif
[...]
static unsigned int sig_offsets[] = {
#ifdef SIGHUP
[SIGHUP] = SIG_HUP_OFFSET,
#endif
#ifdef SIGINT
[SIGINT] = SIG_INT_OFFSET,
#endif
derived from the attached files?
That's pretty nice Bruce. Please explain how this will be used in the
build process, just so I understand. It's probably obvious to someone
who uses AC tools a lot. If I'm following, the first stage is that
autoconf (?) will look through all definitions for those beginning with
SIG and then create further definitions similar to the above which can
be compiled. The definition "sig = HUP, INT, QUIT, ..." can
then be included in something like:
static char const sig_strings[] = {
sig
};
?
It feels that we are working toward creating a table that doesn't group
according to the signal number (i.e., synonyms), but instead just lists
all SIG defines (and from there the user can figure things out using the
already existing functions). I'm alright with that. I suppose that is
a more initial expectation for how such a thing would be organized.
Dan