Anatomy of the C extensions

C extension source code is in the csrc directory of megapkg.

Each extension has a master header file that defines the structures that the extension uses. For example: csrc/pwm/pwm.h

 ~/svn/megapkg/csrc/pwm$ cat pwm_compile.c
 #include "pwm.h"
 #include "pwm_proto.h"
 #include "pwm.c"

pwm_proto.h is automatically generated by FedBld23.tcl (the version number of FedBld may change). pwm.c contains the code that can be edited in Emacs, or with: tclkit FedBld23.tcl pwm.csrcdb

Whenever possible it's desirable to use static when defining a function that doesn't include a prefix, such as pwm_, so that symbol conflicts are less likely to occur. static should also be used with global variables in pwm.h and other header files to prevent such conflicts.


See also: Editing Whim Sources