From e57336c9c7e9a00a99fde8573479c756efafa037 Mon Sep 17 00:00:00 2001 From: codemastr Date: Mon, 19 Nov 2001 20:30:30 +0000 Subject: [PATCH] Changed some function names --- Changes | 3 +++ include/events.h | 2 +- include/modules.h | 15 +++++++++++---- src/modules.c | 6 +++--- src/modules/scan_http.c | 4 ++-- src/modules/scan_socks.c | 4 ++-- src/modules/web/httpd.c | 12 ++++++------ 7 files changed, 28 insertions(+), 18 deletions(-) diff --git a/Changes b/Changes index 1c9f64434..07ebc09cb 100644 --- a/Changes +++ b/Changes @@ -942,3 +942,6 @@ seen. gmtime warning still there - Updated makefile.win32 for the Auth system - Redid the event system somewhat - Fixed a little event issue involving data types. +- Changed the name of the hook functions from add_Hook, del_Hook, + add_HookX, del_HookX to HookAdd, HookDel, HookAddEx, HookDelEx + so the names are more standard. diff --git a/include/events.h b/include/events.h index 57b8bb645..fe4d4148f 100644 --- a/include/events.h +++ b/include/events.h @@ -39,7 +39,7 @@ Event *EventDel(Event *event); Event *EventFind(char *name); -void EventModEvery(Event *event, int every); +void EventModEvery(Event *event, long every); void DoEvents(void); diff --git a/include/modules.h b/include/modules.h index c960eeab3..a2d265efe 100644 --- a/include/modules.h +++ b/include/modules.h @@ -86,11 +86,18 @@ int load_module(char *module, int module_load); int unload_module(char *name); vFP module_sym(char *name); -#define add_Hook(hooktype, func) add_HookX(hooktype, func, NULL) -#define del_Hook(hooktype, func) del_HookX(hooktype, func, NULL) -void add_HookX(int hooktype, int (*intfunc)(), void (*voidfunc)()); -void del_HookX(int hooktype, int (*intfunc)(), void (*voidfunc)()); + +#define add_Hook(hooktype, func) HookAddEx(hooktype, func, NULL) +#define del_Hook(hooktype, func) HookDelEx(hooktype, func, NULL) +#define HookAdd(hooktype, func) HookAddEx(hooktype, func, NULL) +#define HookDel(hooktype, func) HookDelEx(hooktype, func, NULL) + +#define add_HookX(hooktype, func1, func2) HookAddEx(hooktype, func1, func2) +#define del_HookX(hooktype, func1, func2) HookDelEx(hooktype, func1, func2) + +void HookAddEx(int hooktype, int (*intfunc)(), void (*voidfunc)()); +void HookDelEx(int hooktype, int (*intfunc)(), void (*voidfunc)()); #define RunHook0(hooktype) for (global_i = Hooks[hooktype]; global_i; global_i = global_i->next)(*(global_i->func.intfunc))() #define RunHook(hooktype,x) for (global_i = Hooks[hooktype]; global_i; global_i = global_i->next) (*(global_i->func.intfunc))(x) diff --git a/src/modules.c b/src/modules.c index 62a1fa195..9854a4990 100644 --- a/src/modules.c +++ b/src/modules.c @@ -477,7 +477,7 @@ int m_module(aClient *cptr, aClient *sptr, int parc, char *parv[]) return 1; } -void add_HookX(int hooktype, int (*func)(), void (*vfunc)()) +void HookAddEx(int hooktype, int (*func)(), void (*vfunc)()) { Hook *p; @@ -489,7 +489,7 @@ void add_HookX(int hooktype, int (*func)(), void (*vfunc)()) add_ConfigItem((ConfigItem *) p, (ConfigItem **) &Hooks[hooktype]); } -void del_HookX(int hooktype, int (*func)(), void (*vfunc)()) +void HookDelEx(int hooktype, int (*func)(), void (*vfunc)()) { Hook *p; @@ -524,4 +524,4 @@ EVENT(e_unload_module_delayed) sendto_realops("Unloaded module %s", name); } return; -} \ No newline at end of file +} diff --git a/src/modules/scan_http.c b/src/modules/scan_http.c index bd3e450a9..1ba31ec3c 100644 --- a/src/modules/scan_http.c +++ b/src/modules/scan_http.c @@ -112,7 +112,7 @@ int scan_http_init(int module_load) /* * Add scanning hooks */ - add_HookX(HOOKTYPE_SCAN_HOST, NULL, scan_http_scan); + HookAddEx(HOOKTYPE_SCAN_HOST, NULL, scan_http_scan); } /* Is first run when server is 100% ready */ @@ -132,7 +132,7 @@ DLLFUNC void mod_unload(void) void scan_http_unload(void) #endif { - del_HookX(HOOKTYPE_SCAN_HOST, NULL, scan_http_scan); + HookDelEx(HOOKTYPE_SCAN_HOST, NULL, scan_http_scan); } #define HICHAR(s) (((unsigned short) s) >> 8) diff --git a/src/modules/scan_socks.c b/src/modules/scan_socks.c index e42bc4b54..b1d68a547 100644 --- a/src/modules/scan_socks.c +++ b/src/modules/scan_socks.c @@ -109,7 +109,7 @@ int scan_socks_init(int module_load) /* * Add scanning hooks */ - add_HookX(HOOKTYPE_SCAN_HOST, NULL, scan_socks_scan); + HookAddEx(HOOKTYPE_SCAN_HOST, NULL, scan_socks_scan); } /* Is first run when server is 100% ready */ @@ -129,7 +129,7 @@ DLLFUNC void mod_unload(void) void scan_socks_unload(void) #endif { - del_HookX(HOOKTYPE_SCAN_HOST, NULL, scan_socks_scan); + HookDelEx(HOOKTYPE_SCAN_HOST, NULL, scan_socks_scan); } #define HICHAR(s) (((unsigned short) s) >> 8) diff --git a/src/modules/web/httpd.c b/src/modules/web/httpd.c index 999451784..9aa929791 100644 --- a/src/modules/web/httpd.c +++ b/src/modules/web/httpd.c @@ -96,9 +96,9 @@ DLLFUNC int mod_init(int module_load) int httpd_init(int module_load) #endif { - add_HookX(HOOKTYPE_HTTPD_URL, h_u_stats, NULL); - add_HookX(HOOKTYPE_HTTPD_URL, h_u_vfs, NULL); - add_HookX(HOOKTYPE_HTTPD_URL, h_u_phtml, NULL); + HookAddEx(HOOKTYPE_HTTPD_URL, h_u_stats, NULL); + HookAddEx(HOOKTYPE_HTTPD_URL, h_u_vfs, NULL); + HookAddEx(HOOKTYPE_HTTPD_URL, h_u_phtml, NULL); return 1; } @@ -148,9 +148,9 @@ DLLFUNC void mod_unload(void) void httpd_unload(void) #endif { - del_HookX(HOOKTYPE_HTTPD_URL, h_u_stats, NULL); - del_HookX(HOOKTYPE_HTTPD_URL, h_u_vfs, NULL); - del_HookX(HOOKTYPE_HTTPD_URL, h_u_phtml, NULL); + HookDelEx(HOOKTYPE_HTTPD_URL, h_u_stats, NULL); + HookDelEx(HOOKTYPE_HTTPD_URL, h_u_vfs, NULL); + HookDelEx(HOOKTYPE_HTTPD_URL, h_u_phtml, NULL); }