On Jul 6, 2006, at 2:47 PM, Marvin Humphrey wrote:

I can think of some functions I'd like to add

In the initial prototype, it's not possible to write a Charmonizer executable. We need to add a couple functions to make that possible: CH_run_module(), and CH_finish().

Here's how a Charmonizer app that writes lucyport.h might look:

  CH_api_version('0');

  /* start _charmonize.c */
  CH_append_raw(CH_q

      #include <stdio.h>

      #define TYPEDEF_PREFIX "lucy_"
      #define CONSTANT_PREFIX "LUCY_"
      #define MACRO_PREFIX "Lucy_"

      int main()
      {
printf("/* Header file auto-generated by Charmonizer. */\n \n");

    CH_q
  );

  /* most of these haven't been written yet */
  CH_run_module('modules/integers.charm');
  CH_run_module('modules/floats.charm');
  CH_run_module('modules/large_files.charm');
  CH_run_module('modules/malloc_macros.charm');

  /* close _charmonize.c */
  CH_append_raw(CH_q
      return 0;
    }
    CH_q
  );

  /* run _charmonize.c and capture output to lucyport.h */
  CH_finish('lucyport.h');

Portable file path handling is a problem, but I think we can punt on that and just have our various build scripts write the Charmonizer script dynamically.

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/

Reply via email to