Marvin Humphrey wrote on 12/11/09 9:19 PM:

PS: Oh, and if you can muster the energy, please keep a brainlog as you try to
figure this out.  It would be a valuable refactoring aid.

* I want to basically add this logic to the generated charmony.h file:

#ifdef _HAVE_STDINT_
#include <stdint.h>
#else
typedef .. // add our basic int types here based on Probe/Integer.c
#endif

where do I make this change in Charmonizer so that the code is generated 
correctly?

* I have 2 file names to go on from the email thread (upon which I must rely because I can't remember anything anymore. early onset senility. Now, what was I doing? Oh yes.) Charmonizer/Probe/Integer.c and charmony.h

 % find . -name 'charmony.h'

one hit, in perl/charmony.h -- but that file clearly says it is generated by Charmonizer, so Charmonizer/Probe/Integer.c is my likely bet.

* open Integer.c and Integer.h to poke around. My first instinct is to add the #include <stdint.h> at the top to go with the other standard includes there, but since part of the task assumes that file is not always available, I'll need to avoid my first instinct.

* ah, here is some text I recognize from charmony.h in Integers_run(). This must be the generator. Write to lucy list to confirm before I dive in.

[… time passes …]

Marvin replies with perfectly clear advice on the functions to use. Exactly what I need. Also, started this brainlog.

* Knowing which functions to use makes this very easy. The hardest part becomes where in Integers_run() is most appropriate place to put the new code. I settle on a spot right below the comment about writing affirmations and typedefs, with the assumption that Some Day in the Future, the stdint defs will replace all the chy_* stuff.

* cd perl && make clean && make test

* /me drinks the Charmonizer kool-aid. I get it now. Very nice. It's sort of like the next evolution of autoconf, with the added love of letting you generate C via Clownfish.






--
Peter Karman  .  http://peknet.com/  .  [email protected]

Reply via email to