www.pudn.com > 传奇3源代码.rar > core.c
// $Id: core.c,v 1.3 2003/06/29 05:49:50 lemit Exp $ // original : core.c 2003/02/26 18:03:12 Rev 1.7 #include#include #include #include #include "core.h" #include "socket.h" #include "timer.h" #ifdef MEMWATCH #include "memwatch.h" #endif static void (*term_func)(void)=NULL; /*====================================== * CORE : Set function *-------------------------------------- */ void set_termfunc(void (*termfunc)(void)) { term_func = termfunc; } /*====================================== * CORE : Signal Sub Function *-------------------------------------- */ static void sig_proc(int sn) { int i; switch(sn){ case SIGINT: case SIGTERM: if(term_func) term_func(); for(i=0;i