nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] nmh internals: argument processing

2013-01-09 09:17:42
Hope this clairifies, ask if anything's unclear.

Yes, it does; thank you!  Actually, I think I do like this; I started
doing this conversion for a few files yesterday, and it did strike me
as a bit inelegant to have to do the enum separately from the struct swit
array.  Even though it's a bit of hack, I like it.

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 },

I added the `array' parameter to DEFINE_SWITCH_ARRAY();  before I just
always called the array `switches'.  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 :-)

The LEN_MARK enumerate is to avoid the trailing comma in an enum;
illegal in C89.  The name is embedded to make it unique and it's useful
on other occasions, e.g. not having to NULL-terminate the array.

Thanks for explaining; I was wondering about that!

--Ken

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>