next up previous contents
Next: set_init_callback() Up: The C API Previous: Overview of This Tutorial   Contents

The Absolute Minimum

In order to be recognized as a module by Pike, the least a module must define are the two functions:

void pike_module_init()
void pike_module_exit()
As one can tell by the name, pike_module_init() is the function run when the module is being initialized. In pike_module_init() the whole module is so to say defined. By using (for instance) the functions and macros listed below, every component of the module (class, method, variable) can be defined within the Pike language and mapped to its corresponding C level implementation.

The pike_module_exit() function is as the name indicates run when the module exits. Therefore it can contain clean up that is to be done upon exit.



2003-03-04