Steven said:
yes, this is what i want. it seems ( from you reply ) there is no
solution in C.
The C solution is given in the very next paragraph of Keith's reply
(below.)
it's however, easy in many other advanced language.
Well then... if those languages are available to your project, use
them.
Being a C programmer doesn't limit you to C. Any programmer worth their
salt is going to use the best tool for the job. That tool isn't always
C.
Both the parallel maintenance and source code generation methods have
been
discussed before in comp.lang.c. Neither is especially elegant, but
neither is
particularly difficult either.
That said, you seem to be in the camp...
I have a problem A, I think the solution is B.
I don't know how to do B, so I'll ask about B.
You should really be asking about A, showing B as your attempt.
That way, not only might you receive comments on B, you might
actually get better alternatives on how to solve your real problem A.