Creating a module

You won't generally interact directly with server_module_t structure. A macro is provided to simplify the population of the structure. This also abstracts the interaction so we may alter the structure in future releases as long as the macro usage is unchanged. A summarized version of the macro definition follows:

#define SERVER_MODULE(nam, va, vb, vc, desc) \
server_module_t SERVER_MODULE_ENTRY_SYMBOL = {\
        #nam,\
        desc,\
        va, vb, vc,\
        SERVER_VERSION_MAJOR, SERVER_VERSION_MINOR, SERVER_VERSION_MICRO,\
        nam ## _authors,\
        nam ## _config,\
        nam ## _construct,\
        nam ## _prestart,\
        nam ## _operator,\
        nam ## _report\
};

Note that the macro assumes that you will have nam_authors, nam_config, nam_construct, nam_prestart, nam_operator, nam_report all defined properly within your module.



Subsections

2007-12-06