summaryrefslogtreecommitdiff
path: root/src/common/core.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-08-11 01:47:15 +0200
committerHaru <haru@dotalux.com>2015-08-15 00:51:44 +0200
commit22bd368e5d4d8d61a7189d03f52c3afd90c0729e (patch)
treeb8617bdfe901c41ff006d160b5bbceadb52f7bfb /src/common/core.h
parentbbf42063d78e393c2fc7a74b105aca6fb6357414 (diff)
downloadhercules-22bd368e5d4d8d61a7189d03f52c3afd90c0729e.tar.gz
hercules-22bd368e5d4d8d61a7189d03f52c3afd90c0729e.tar.bz2
hercules-22bd368e5d4d8d61a7189d03f52c3afd90c0729e.tar.xz
hercules-22bd368e5d4d8d61a7189d03f52c3afd90c0729e.zip
Added core HPM interface
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/core.h')
-rw-r--r--src/common/core.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/common/core.h b/src/common/core.h
index b0f0449a3..c92bf4fa6 100644
--- a/src/common/core.h
+++ b/src/common/core.h
@@ -57,28 +57,30 @@ struct cmdline_interface {
const char *(*arg_source) (struct CmdlineArgData *arg);
};
+struct core_interface {
+ int arg_c;
+ char **arg_v;
+ /// @see E_CORE_ST
+ int runflag;
+ char *server_name;
+ enum server_types server_type;
+
+ /// Called when a terminate signal is received. (Ctrl+C pressed)
+ /// If NULL, runflag is set to CORE_ST_STOP instead.
+ void (*shutdown_callback)(void);
+};
+
#define CMDLINEARG(x) bool cmdline_arg_ ## x (const char *name, const char *params)
+#define SERVER_NAME (core->server_name)
+#define SERVER_TYPE (core->server_type)
#ifdef HERCULES_CORE
-extern int arg_c;
-extern char **arg_v;
-
-/// @see E_CORE_ST
-extern int runflag;
-extern char *SERVER_NAME;
-
-enum server_types SERVER_TYPE;
-
extern void cmdline_args_init_local(void);
extern int do_init(int,char**);
extern void set_server_type(void);
extern void do_abort(void);
extern int do_final(void);
-/// Called when a terminate signal is received. (Ctrl+C pressed)
-/// If NULL, runflag is set to CORE_ST_STOP instead.
-extern void (*shutdown_callback)(void);
-
/// Special plugin ID assigned to the Hercules core
#define HPM_PID_CORE ((unsigned int)-1)
@@ -88,6 +90,7 @@ extern void (*shutdown_callback)(void);
void cmdline_defaults(void);
#endif // HERCULES_CORE
+HPShared struct core_interface *core;
HPShared struct cmdline_interface *cmdline;
#endif /* COMMON_CORE_H */