diff options
Diffstat (limited to 'src/common/console.c')
-rw-r--r-- | src/common/console.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/common/console.c b/src/common/console.c index a9ea0386f..66f8d914a 100644 --- a/src/common/console.c +++ b/src/common/console.c @@ -17,6 +17,7 @@ #include "../common/mutex.h" #include "../common/timer.h" #include "../common/strlib.h" + #include "../common/sql.h" #endif #include <stdio.h> @@ -106,6 +107,13 @@ CPCMD(malloc_usage) { unsigned int val = (unsigned int)iMalloc->usage(); ShowInfo("malloc_usage: %.2f MB\n",(double)(val)/1024); } +CPCMD(skip) { + if( !line ) { + ShowDebug("usage example: sql update skip 2013-02-14--16-15.sql\n"); + return; + } + Sql_HerculesUpdateSkip(console->SQL, line); +} #define CP_DEF_C(x) { #x , NULL , NULL, NULL } #define CP_DEF_C2(x,y) { #x , NULL , #y, NULL } #define CP_DEF_S(x,y) { #x , console_parse_ ## x , #y, NULL } @@ -123,6 +131,9 @@ void console_load_defaults(void) { CP_DEF_S(mem_report,server), CP_DEF_S(malloc_usage,server), CP_DEF_S(exit,server), + CP_DEF_C(sql), + CP_DEF_C2(update,sql), + CP_DEF_S(skip,update), }; unsigned int i, len = ARRAYLENGTH(default_list); struct CParseEntry *cmd; @@ -375,6 +386,9 @@ void console_parse_init(void) { iTimer->add_timer_interval(iTimer->gettick() + 1000, console->parse_timer, 0, 0, 500);/* start listening in 1s; re-try every 0.5s */ } +void console_setSQL(Sql *SQL) { + console->SQL = SQL; +} #endif /* CONSOLE_INPUT */ void console_init (void) { @@ -413,5 +427,7 @@ void console_defaults(void) { console->load_defaults = console_load_defaults; console->parse_list_subs = console_parse_list_subs; console->addCommand = console_parse_create; + console->setSQL = console_setSQL; + console->SQL = NULL; #endif } |