X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/9b24cbdecc72337e825764f39cdf59ca23f41788..ce376a21ccc6ffa404e8b77b18e6db4c1d336f0a:/include/modules.h diff --git a/include/modules.h b/include/modules.h index 0b83bd60..41d0f658 100644 --- a/include/modules.h +++ b/include/modules.h @@ -28,8 +28,9 @@ #include "defaults.h" #include "setup.h" #include "parse.h" +#include "client.h" /* for IDLEN */ -#define MAPI_CHARYBDIS 2 +#define MAPI_SOLANUM 2 #include @@ -42,10 +43,12 @@ struct module const char *version; const char *description; lt_dlhandle address; - int core; - int origin; + int core; /* This is int for backwards compat reasons */ + int origin; /* Ditto */ + char *path; int mapi_version; void *mapi_header; /* actually struct mapi_mheader_av */ + rb_dlink_node node; }; #define MAPI_MAGIC_HDR 0x4D410000 @@ -68,9 +71,9 @@ typedef struct { const char *hapi_name; hookfn fn; + enum hook_priority priority; } mapi_hfn_list_av1; - #define MAPI_CAP_CLIENT 1 #define MAPI_CAP_SERVER 2 @@ -94,8 +97,8 @@ struct mapi_mheader_av1 }; #define MAPI_ORIGIN_UNKNOWN 0 /* Unknown provenance (AV1 etc.) */ -#define MAPI_ORIGIN_EXTENSION 1 /* Charybdis extension */ -#define MAPI_ORIGIN_CORE 2 /* Charybdis core module */ +#define MAPI_ORIGIN_EXTENSION 1 /* Solanum extension */ +#define MAPI_ORIGIN_CORE 2 /* Solanum core module */ struct mapi_mheader_av2 { @@ -117,23 +120,36 @@ struct mapi_mheader_av2 #define DECLARE_MODULE_AV2(name, reg, unreg, cl, hl, hfnlist, caplist, v, desc) \ struct mapi_mheader_av2 _mheader = { MAPI_V2, reg, unreg, cl, hl, hfnlist, caplist, v, desc, DATECODE} +struct modreload +{ + char module[BUFSIZE]; + char id[IDLEN]; +}; + /* add a path */ void mod_add_path(const char *path); void mod_clear_paths(void); +/* cap-notify utilities */ +extern void mod_remember_clicaps(void); +extern void mod_notify_clicaps(void); + /* load a module */ extern void load_module(char *path); /* load all modules */ -extern void load_all_modules(int warn); +extern void load_all_modules(bool warn); /* load core modules */ -extern void load_core_modules(int); +extern void load_core_modules(bool); + +extern bool unload_one_module(const char *, bool); +extern bool load_one_module(const char *, int, bool); +extern bool load_a_module(const char *, bool, int, bool); +extern struct module *findmodule_byname(const char *); +extern void init_modules(void); -extern int unload_one_module(const char *, int); -extern int load_one_module(const char *, int, int); -extern int load_a_module(const char *, int, int, int); -extern int findmodule_byname(const char *); -extern void modules_init(void); +extern rb_dlink_list module_list; +extern rb_dlink_list mod_paths; #endif /* INCLUDED_modules_h */