diff options
author | Haru <haru@dotalux.com> | 2015-08-11 01:47:15 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-08-15 00:51:44 +0200 |
commit | 22bd368e5d4d8d61a7189d03f52c3afd90c0729e (patch) | |
tree | b8617bdfe901c41ff006d160b5bbceadb52f7bfb /src/common/core.c | |
parent | bbf42063d78e393c2fc7a74b105aca6fb6357414 (diff) | |
download | hercules-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.c')
-rw-r--r-- | src/common/core.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/common/core.c b/src/common/core.c index 2f89d004e..7f5a1da53 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -41,11 +41,8 @@ /// Called when a terminate signal is received. void (*shutdown_callback)(void) = NULL; -int runflag = CORE_ST_RUN; -int arg_c = 0; -char **arg_v = NULL; - -char *SERVER_NAME = NULL; +struct core_interface core_s; +struct core_interface *core = &core_s; #ifndef MINICORE // minimalist Core // Added by Gabuzomeu @@ -90,7 +87,7 @@ static BOOL WINAPI console_handler(DWORD c_event) { if( shutdown_callback != NULL ) shutdown_callback(); else - runflag = CORE_ST_STOP;// auto-shutdown + core->runflag = CORE_ST_STOP;// auto-shutdown break; default: return FALSE; @@ -118,7 +115,7 @@ static void sig_proc(int sn) { if( shutdown_callback != NULL ) shutdown_callback(); else - runflag = CORE_ST_STOP;// auto-shutdown + core->runflag = CORE_ST_STOP;// auto-shutdown break; case SIGSEGV: case SIGFPE: @@ -389,8 +386,9 @@ int main (int argc, char **argv) { SERVER_NAME = ++p1; p2 = p1; } - arg_c = argc; - arg_v = argv; + core->arg_c = argc; + core->arg_v = argv; + core->runflag = CORE_ST_RUN; } core_defaults(); @@ -442,7 +440,7 @@ int main (int argc, char **argv) { do_init(argc,argv); // Main runtime cycle - while (runflag != CORE_ST_STOP) { + while (core->runflag != CORE_ST_STOP) { int next = timer->perform(timer->gettick_nocache()); sockt->perform(next); } |