2015-03-27 15:44:40 +00:00
|
|
|
#ifndef MODULE_H
|
|
|
|
#define MODULE_H
|
|
|
|
|
|
|
|
#include "irc.h"
|
2024-02-13 10:56:23 +00:00
|
|
|
#include "events.h"
|
2015-03-27 15:44:40 +00:00
|
|
|
|
2024-02-13 23:47:20 +00:00
|
|
|
|
2024-02-13 07:22:10 +00:00
|
|
|
struct module {
|
2024-02-17 08:21:22 +00:00
|
|
|
char name[25];
|
|
|
|
char author[50];
|
|
|
|
char version[10];
|
|
|
|
char description[256];
|
2024-02-13 23:47:20 +00:00
|
|
|
|
2024-02-17 08:21:22 +00:00
|
|
|
char fname[256];
|
2024-02-13 23:47:20 +00:00
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
HMODULE handle;
|
|
|
|
FARPROC init;
|
|
|
|
FARPROC unload;
|
|
|
|
#else
|
|
|
|
void *handle;
|
|
|
|
void (*init)();
|
|
|
|
void (*unload)();
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
struct mods {
|
|
|
|
int count;
|
|
|
|
struct module *modules;
|
2024-02-13 07:22:10 +00:00
|
|
|
};
|
2015-03-27 15:44:40 +00:00
|
|
|
|
2024-02-24 01:57:59 +00:00
|
|
|
extern struct mods *mods;
|
|
|
|
|
2024-02-13 23:47:20 +00:00
|
|
|
void init_mods();
|
|
|
|
void load_module(struct irc_conn *bot, char *where, char *stype, char *file);
|
2024-02-17 06:03:20 +00:00
|
|
|
void unload_module(struct irc_conn *bot, char *where, char *file);
|
2024-02-17 08:21:22 +00:00
|
|
|
void list_modules(struct irc_conn *bot, char *where);
|
2024-02-25 17:09:24 +00:00
|
|
|
void set_bot(struct irc_conn *b);
|
2024-03-06 08:50:22 +00:00
|
|
|
void set_bot_db(struct db_table *db);
|
2024-02-17 08:21:22 +00:00
|
|
|
MY_API void register_module(char *name, char *author, char *version, char *description);
|
|
|
|
MY_API void unregister_module(char *name);
|
|
|
|
MY_API struct mods *get_mods();
|
2024-02-25 17:09:24 +00:00
|
|
|
MY_API struct irc_conn *get_bot();
|
2024-03-06 08:50:22 +00:00
|
|
|
MY_API struct db_table *get_bot_db();
|
|
|
|
|
2024-02-13 07:22:10 +00:00
|
|
|
|
|
|
|
#endif
|