xbot/lib/module.h

44 lines
843 B
C
Raw Normal View History

#ifndef MODULE_H
#define MODULE_H
#include "irc.h"
2024-02-13 02:56:23 -08:00
#include "events.h"
#ifdef _WIN32
#include <windows.h>
#endif
2024-02-12 23:22:10 -08:00
struct module {
2024-02-17 00:21:22 -08:00
char name[25];
char author[50];
char version[10];
char description[256];
2024-02-17 00:21:22 -08:00
char fname[256];
#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-12 23:22:10 -08:00
};
void init_mods();
void load_module(struct irc_conn *bot, char *where, char *stype, char *file);
2024-02-16 22:03:20 -08:00
void unload_module(struct irc_conn *bot, char *where, char *file);
2024-02-17 00:21:22 -08:00
void list_modules(struct irc_conn *bot, char *where);
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-12 23:22:10 -08:00
#endif