00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _EGG_MODULE_H
00029 #define _EGG_MODULE_H
00030
00031
00032
00033 #include "mod/modvals.h"
00034
00035 #ifndef MAKING_NUMMODS
00036
00037
00038 void do_module_report(int, int, char *);
00039 int module_register(char *, Function *, int, int);
00040 const char *module_load(char *);
00041 char *module_unload(char *, char *);
00042 module_entry *module_find(char *, int, int);
00043 Function *module_depend(char *, char *, int, int);
00044 int module_undepend(char *);
00045 char *mod_strdup(const char *, const char *, const char *, int);
00046 void *mod_malloc(int, const char *, const char *, int);
00047 void *mod_realloc(void *, int, const char *, const char *, int);
00048 void mod_free(void *, const char *, const char *, int);
00049 void add_hook(int, Function);
00050 void del_hook(int, Function);
00051 void *get_next_hook(int, void *);
00052
00053 extern struct hook_entry {
00054 struct hook_entry *next;
00055 Function func;
00056 } *hook_list[REAL_HOOKS];
00057
00058 #define call_hook(x) do { \
00059 register struct hook_entry *p, *pn; \
00060 \
00061 for (p = hook_list[x]; p; p = pn) { \
00062 pn = p->next; \
00063 p->func(); \
00064 } \
00065 } while (0)
00066
00067 int call_hook_cccc(int, char *, char *, char *, char *);
00068
00069 #endif
00070
00071 typedef struct _dependancy {
00072 struct _module_entry *needed;
00073 struct _module_entry *needing;
00074 struct _dependancy *next;
00075 int major;
00076 int minor;
00077 } dependancy;
00078 extern dependancy *dependancy_list;
00079
00080 #endif