Next: for-each main procedure options, Previous: handler procedure type, Up: Generating main procedures [Contents][Index]
code for handler procedure
With the MYHANDLER-code
attribute, you provide the code for
your handler procedure in the option definition file. Note that the
spelling of this attribute depends on the name provided with the
handler-proc
attribute, so we represent it here with
MYHANDLER
as a place holder. As an example, your main()
procedure specification might look something like this:
main = { main-type = for-each; handler-proc = MYHANDLER; MYHANDLER-code = <<- EndOfMyCode /* whatever you want to do */ EndOfMyCode; };
and instead of an emitted external reference, a procedure will be emitted that looks like this:
static int MYHANDLER( char const* pz_entry ) { int res = 0; <<MYHANDLER-code goes here>> return res; }