Custom C/C++ code may be added to the generated code and header file using <code> tags on the top level within <extension>.

Code can be added to either the generated code or hader file by setting the role attribute to code (default) or header.

The position attribute controls whether the code will be inserted near the top or bottom (default) of the generated file.

Code fragments that go to the same file and position are inserted by order of appearance in the XML source.

<extension>
 ...
 <code role="code" position="top">
  /* this is a global variable used throughout this extension */
  void *global_master_pointer = NULL;
 </code>
 ...
</extension>
If you have to add large ammounts of custom code you should put it into seperate files and add these in the dependencies section (described on the next slide).