On 06/05/13 09:57, Daniel J Sebald wrote:
> 
> 
> Well, taking this all into consideration, perhaps the easiest thing to do is 
> construct a table at runtime on the heap:

I'd rather avoid the runtime overhead.

How about something like this?

enum { HUP_OFFSET = 0 };
#define HUP_STRING "string for SIGHUP"

enum { INT_OFFSET = HUP_OFFSET + sizeof HUP_STRING };
#define INT_STRING "string for SIGINT"

enum { QUIT_OFFSET = INT_OFFSET + sizeof INT_STRING };
#define QUIT_STRING "string for SIGQUIT"

A bit awkward, but no repeated strings; and I've seen worse.

Reply via email to