Each pure input, inputoutput, and return signal produces a function of the form

  void <module-name>_I_<signal-name>()
  { 
    <presence-variable> = 1;
  }

Each valued input and inputoutput signal produces

  void <module-name>_I_<signal-name>(<signal-type> arg)
  {
    <presence-variable> = 1;
    <value-variable> = arg;
  }

Each combine input and inputoutput signal produces

  void <module-name>_I_<signal-name>(<signal-type> arg)
  {
    if (<presence-variable>) {
      <value-variable> = <value-variable> <combine-function> arg;
    } else {
      <presence-variable> = 1;
      <value-variable> = arg;
    }
  }

<presence-variable> and <value-variable> are declared static in the file.

Each sensor produces code of the form

  #ifndef <module-name>_S_<sensor-name>
  extern <sensor-type> <module-name>_S_<sensor-name>();
  #endif

i.e., it's expecting a function or a #defined object with the given
name that returns the value of the sensor.

Each pure output and inputoutput calls a function of the form

  void <module-name>_O_<signal-name>(<signal-type>)

The code generator produces a function

  void __<module-name>__reset_input()

that clears all the signal presence variables.

The

  int <module-name>_reset()

function resets the module's state and calls the __reset_input() function.

The state is stored in static variables and initialized.
The state of input signals is also stored in static variables, but
not initialized.

The interface spec. says

  The reset function should be called before any reaction is performed if there
  are initialized interface signals in PROG.

A function declaration, e.g.,

  function foo(boolean) : integer;

becomes the code

  #ifndef _NO_EXTERN_DEFINITIONS
  #  ifndef _NO_FUNCTION_DEFINITIONS
  #    ifndef _foo_DEFINED
  #      ifndef foo
  extern integer foo(boolean);
  #      endif
  #    endif
  #  endif
  #endif

This causes some problems if foo() is defined with different types in
different modules in the same program.

Multiple modules in the same source file generate multiple reaction functions,
variables, etc.

----------------------------------------------------------------------
The -simul flag, to allow the output to link with the csimul package, changes
the following:

Output actions change:

   #define __TestEmit1_A1 \
   TestEmit1_O_A()

becomes
   
   static void __TestEmit1_A1 () {
   #ifdef __OUTPUT
   TestEmit1_O_A();
   #endif
   __AppendToList(__TestEmit1_EmittedList,0);
   }
   static int __TestEmit1_Check1 [] = {1,0,0};

__AppendToList is in the simulation library.

There is a lot of added code.
