Previous: listserv, Up: Generators


5.2 Writing your own generator

src/sample.c demonstrates how to write a new script generator, exporting:

— Function: char** supported_lists ()

Called to initialize the module. Returns a NULL-terminated list of mailing lists, which can be managed by the generator module. The list of lists is freed by the generator module.

— Function: char** get_scripts (char* listname)

Generates the scripts for the mailing list listname and returns returns a NULL-terminated pair of the script names and script content. E.g. for the script ABC-L, the return value might look like {"ABC-L", "#script for ABC-L", "ABC-L-request", "#script for proceeding the mails for ABC-L-request", NULL}.

— Function: void upload ()

(optional) Called to free the allocated resources.