Go backward to Basics of adding C code.
Go up to Basics of adding C code.
Go forward to The symbol table.

General procedure
-----------------

  
How do you add your own code to Soar?  The general procedure is as follows:

  1. Copy all the Soar source code into a directory of your own. 
     
  2. Write a file containing the C source code for your own functions.
     
  3. Edit hooks.c, adding lines to one or more hook routines to make them
     call the functions you just wrote, or to tell Soar to automatically call
     your functions at certain times.  Which hook routines to edit depends on
     when you want your functions to get called.  For the kinds of code
     additions discussed below, you'll always be adding lines to
     system_startup_hook().  There are lots of other hook functions
     available, though, and you can add code to those as well.
     
     
  4. Compile and link everything.  Edit the Soar makefile to include your
     file in the system build, and then type "make".