nmh-workers
[Top] [All Lists]

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

2013-01-08 10:20:56
Hi Ken,

I'm not sure that helps in this situation here, though.  We have three
distinct bits of information that need to be matched up: the option
name, the minimum abbreviation length, and the value that needs to be
returned.  I'm not sure:

      X("noaudit", 0, NAUDSW)

is better than:

      { "noaudit", 0, NAUDSW },

That's missing out the duplication needed by the enum definition in the
second part.

With X(), returning the index remains sufficient because the enum will
always match the array so there's no need to also store the index in the
struct.  The two expansions of X(), enum and array, could be in a
central #include.

Without X(), you have the chore of keeping the enum and array in the
same order for source-neatness even though the code doesn't need it
because it's returning the new struct member.

I'm easy either way, just presenting the pros and cons.

Cheers, Ralph.

_______________________________________________
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>