#define MAPI_RATBOX 1
-#if defined(HAVE_SHL_LOAD)
-#include <dl.h>
-#endif
-#if !defined(STATIC_MODULES) && defined(HAVE_DLFCN_H)
-#include <dlfcn.h>
-#endif
+#include <ltdl.h>
#include "msg.h"
-#include "memory.h"
#include "hook.h"
struct module
{
char *name;
const char *version;
- void *address;
+ lt_dlhandle address;
int core;
int mapi_version;
void * mapi_header; /* actually struct mapi_mheader_av<mapi_version> */
};
-struct module_path
-{
- char path[MAXPATHLEN];
-};
-
#define MAPI_MAGIC_HDR 0x4D410000
#define MAPI_V1 (MAPI_MAGIC_HDR | 0x1)
const char * mapi_module_version; /* Module's version (freeform) */
};
-#ifndef STATIC_MODULES
-# define DECLARE_MODULE_AV1(name,reg,unreg,cl,hl,hfnlist, v) \
+#define DECLARE_MODULE_AV1(name,reg,unreg,cl,hl,hfnlist, v) \
struct mapi_mheader_av1 _mheader = { MAPI_V1, reg, unreg, cl, hl, hfnlist, v}
-#else
-# define DECLARE_MODULE_AV1(name,reg,unreg,cl,hl,hfnlist, v) \
- struct mapi_mheader_av1 name ## _mheader = { MAPI_V1, reg, unreg, cl, hl, hfnlist, v}
-void load_static_modules(void);
-#endif
/* add a path */
void mod_add_path(const char *path);
extern int load_one_module(const char *, int);
extern int load_a_module(const char *, int, int);
extern int findmodule_byname(const char *);
-extern char *irc_basename(const char *);
extern void modules_init(void);
#endif /* INCLUDED_modules_h */