The Module Interface

The server can load additional functionality through modules. Module loading related functions and module interface will be described in this section.

All the data structures and functions mentioned in this section can be found in files sr_module.h and sr_module.c.

Structure sr_module

Each loaded module is represented by an instance of sr_module structure. All the instances are linked. There is a global variable modules defined in file sr_module.c which is head of linked-list of all loaded modules.

Detailed description of the structure follows:

struct sr_module{
    char* path;
    void* handle;
    struct module_exports* exports;
    struct sr_module* next;
};

Fields and their description: