Hi Ken,
Even though it's a bit of hack, I like it.
And most readers can just take how the list of X() work without having
to investigate the gubbins.
But ... it still somehow sticks in my craw the idea of returning an
array index. It just seems wrong to me, somehow. So I'm going to
change your second #define for X to be:
#define X(sw, minchars, id) { sw, minchars, id },
That seems very redundant. :-) Like having
const int foo[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
since you're cementing the relationship between the enum and array index
through X(). If the two were being haphazardly maintained and at risk
of divergance then I could see the point.
The blank line after MARK_SWITCHES's definition is significant.
How come? It looks like you could either have the blank line after
the definition, or simply omit the last \. Of course, I could be
missing something :-)
No, you're not. As you say, it's significant; either it remains or the
final \ goes. But doing the latter makes future edits, sorting, and
diffs a pain, so keeping it is better IMHO.
Cheers, Ralph.
_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers