diff options
author | jaBote <j@bot.e> | 2013-05-03 01:45:50 +0200 |
---|---|---|
committer | jaBote <j@bot.e> | 2013-05-03 01:45:50 +0200 |
commit | 1e5e8f5f42abb2cd42ad7ecf8e07439b8a1c570b (patch) | |
tree | c8825cc2dc141d91fe1fcc52739a0e79a89c80e9 /src/common/HPMi.h | |
parent | f41dea469a52213acfde4f4ea5e8d7bbbd869bed (diff) | |
parent | 274bfc3b06616ea03c467d8eed23fae61c72fe18 (diff) | |
download | hercules-1e5e8f5f42abb2cd42ad7ecf8e07439b8a1c570b.tar.gz hercules-1e5e8f5f42abb2cd42ad7ecf8e07439b8a1c570b.tar.bz2 hercules-1e5e8f5f42abb2cd42ad7ecf8e07439b8a1c570b.tar.xz hercules-1e5e8f5f42abb2cd42ad7ecf8e07439b8a1c570b.zip |
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/common/HPMi.h')
-rw-r--r-- | src/common/HPMi.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/common/HPMi.h b/src/common/HPMi.h new file mode 100644 index 000000000..517d9125d --- /dev/null +++ b/src/common/HPMi.h @@ -0,0 +1,67 @@ +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// See the LICENSE file + +#ifndef _HPMi_H_ +#define _HPMi_H_ + +#include "../common/cbasetypes.h" +#include "../common/core.h" +#include "../common/console.h" + +struct script_state; +struct AtCommandInfo; + +#ifdef WIN32 + #define HPExport __declspec(dllexport) +#else + #define HPExport +#endif + +#ifndef _SHOWMSG_H_ + HPExport void (*ShowMessage) (const char *, ...); + HPExport void (*ShowStatus) (const char *, ...); + HPExport void (*ShowSQL) (const char *, ...); + HPExport void (*ShowInfo) (const char *, ...); + HPExport void (*ShowNotice) (const char *, ...); + HPExport void (*ShowWarning) (const char *, ...); + HPExport void (*ShowDebug) (const char *, ...); + HPExport void (*ShowError) (const char *, ...); + HPExport void (*ShowFatalError) (const char *, ...); +#endif + +/* after */ +#include "../common/showmsg.h" + +#define HPM_VERSION "0.1" + +struct hplugin_info { + char* name; + enum server_types type; + char* version; + char* req_version; +}; + +HPExport void *(*import_symbol) (char *name); +#define GET_SYMBOL(n) import_symbol(n) + +#define SERVER_TYPE_ALL SERVER_TYPE_LOGIN|SERVER_TYPE_CHAR|SERVER_TYPE_MAP + +enum hp_event_types { + HPET_INIT,/* server starts */ + HPET_FINAL,/* server is shutting down */ + HPET_READY,/* server is ready (online) */ + HPET_MAX, +}; + +/* Hercules Plugin Mananger Include Interface */ +struct HPMi_interface { + void (*event[HPET_MAX]) (void); + bool (*addCommand) (char *name, bool (*func)(const int fd, struct map_session_data* sd, const char* command, const char* message,struct AtCommandInfo *info)); + bool (*addScript) (char *name, char *args, bool (*func)(struct script_state *st)); + void (*addCPCommand) (char *name, CParseFunc func); +} HPMi_s; +#ifndef _HPM_H_ + struct HPMi_interface *HPMi; +#endif + +#endif /* _HPMi_H_ */
\ No newline at end of file |