src/module.h
author Tero Marttila <terom@fixme.fi>
Sun, 15 Mar 2009 23:22:57 +0200
branchmodules
changeset 57 ce1accba5fc7
parent 56 942370000450
child 65 d7508879ad01
permissions -rw-r--r--
slight cleanup to move module funcs to a 'struct module_funcs'
54
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     1
#ifndef MODULE_H
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     2
#define MODULE_H
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     3
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     4
/**
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     5
 * @file
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     6
 *
55
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
     7
 * Dynamically loadable modules for use with nexus.
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
     8
 *
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
     9
 * The modules are loaded using dlopen(), and hence should be standard dynamic libraries. Module initialization happens
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    10
 * using a module_init_func_t named "<name>_init", which should return some kind of context pointer, which can later be
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    11
 * used to perform other operations on the module.
54
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    12
 */
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    13
#include "nexus.h"
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    14
#include "error.h"
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    15
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    16
#include <sys/queue.h>
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    17
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    18
/**
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    19
 * Information required to load/identify a module.
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    20
 */
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    21
struct module_info {
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    22
    /** Human-readable name */
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    23
    const char *name;
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    24
    
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    25
    /** Filesystem path to the .so */
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    26
    const char *path;
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    27
};
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    28
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    29
/**
57
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    30
 * A module's behaviour is defined as a set of function pointers, which is dynamically resolved from the module DSO,
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    31
 * using the <mod_name>_funcs symbol.
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    32
 */
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    33
struct module_funcs {
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    34
    /**
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    35
     * Initialize the module, returning an opaque context pointer that is stored in the module state, and supplied for
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    36
     * subsequent calls. The supplied nexus arg can be used to access the global state.
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    37
     *
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    38
     * @param nexus a pointer to the nexus struct containing the global state
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    39
     * @param ctx_ptr the context pointer should be returned via this
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    40
     * @param err returned error info
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    41
     */
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    42
    err_t (*init) (struct nexus *nexus, void **ctx_ptr, struct error_info *err);
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    43
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    44
    /**
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    45
     * Set a configuration option with the given name and value, given by the user. Configuration settings are not
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    46
     * regarded as unique-per-name, but rather, several invocations of 'conf' with the same name and different values
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    47
     * could set up a multitude of things.
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    48
     *
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    49
     * XXX: make value a non-modifyable string
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    50
     *
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    51
     * @param ctx the module's context pointer as returned by init
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    52
     * @param name the name of the configuration setting
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    53
     * @param value the value of the configuration setting
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    54
     * @param err returned error info
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    55
     */
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    56
    err_t (*conf) (void *ctx, const char *name, char *value, struct error_info *err);
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    57
};
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    58
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    59
/**
54
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    60
 * A loaded module.
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    61
 */
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    62
struct module {
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    63
    /** The identifying info for the module */
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    64
    struct module_info info;
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    65
55
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    66
    /** The dlopen handle */
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    67
    void *handle;
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    68
57
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    69
    /** The resolved function table */
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    70
    struct module_funcs *funcs;
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 56
diff changeset
    71
54
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    72
    /** The module context object */
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    73
    void *ctx;
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    74
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    75
    /** Our entry in the list of modules */
55
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    76
    TAILQ_ENTRY(module) modules_list;
54
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    77
};
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    78
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    79
/**
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    80
 * A set of loaded modules, and functionality to load more
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    81
 */
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    82
struct modules {
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    83
    /** The nexus in use */
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    84
    struct nexus *nexus;
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    85
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    86
    /** List of loaded modules */
55
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    87
    TAILQ_HEAD(module_ctx_modules, module) list;
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    88
};
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    89
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    90
/**
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    91
 * Possible error codes
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    92
 */
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    93
enum module_error_code {
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    94
    _ERR_MODULE_BEGIN = _ERR_MODULE,
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    95
    
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    96
    ERR_MODULE_OPEN,        ///< dlopen() failed
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    97
    ERR_MODULE_NAME,        ///< invalid module_info.name
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    98
    ERR_MODULE_SYM,         ///< invalid symbol
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
    99
    ERR_MODULE_INIT_FUNC,   ///< invalid module_init_func_t
56
942370000450 compiling, working, but still ugly module code
Tero Marttila <terom@fixme.fi>
parents: 55
diff changeset
   100
    ERR_MODULE_CONF,        ///< value error in configuration data
54
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   101
};
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   102
55
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   103
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   104
/**
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   105
 * Maximum length of a module name
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   106
 */
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   107
#define MODULE_NAME_MAX 24
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   108
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   109
/**
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   110
 * Maximum length of module symbol suffix
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   111
 */
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   112
#define MODULE_SUFFIX_MAX 16
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   113
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   114
/**
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   115
 * Maximum length of symbol name name, including terminating NUL
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   116
 */
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   117
#define MODULE_SYMBOL_MAX (MODULE_NAME_MAX + 1 + MODULE_SUFFIX_MAX + 1)
54
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   118
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   119
/**
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   120
 * Create a new modules state
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   121
 */
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   122
err_t modules_create (struct modules **modules_ptr, struct nexus *nexus);
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   123
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   124
/**
55
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   125
 * Load a new module
54
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   126
 */
56
942370000450 compiling, working, but still ugly module code
Tero Marttila <terom@fixme.fi>
parents: 55
diff changeset
   127
err_t module_load (struct modules *modules, struct module **module_ptr, const struct module_info *info, struct error_info *err);
55
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   128
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   129
/**
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   130
 * Set a module configuration option
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   131
 */
56
942370000450 compiling, working, but still ugly module code
Tero Marttila <terom@fixme.fi>
parents: 55
diff changeset
   132
err_t module_conf (struct module *module, const char *name, char *value, struct error_info *err);
54
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   133
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   134
/**
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   135
 * Unload a module
55
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   136
 *
6f7f6ae729d0 'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents: 54
diff changeset
   137
 * XXX: not implemented
54
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   138
 */
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   139
err_t module_unload (struct module *module);
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   140
9f74e924b01a initial modules code
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   141
#endif