X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fmk_module_init.sh;h=ae1cd375133a4c594c57fc073610fed36459eab6;hb=4b4dc864ede7c5d8d956febe4a0afb422b78e7c4;hp=61fe9318afba03dae8685ea3e123562aa33ecb18;hpb=adc9f3079beac31291ee9c94d7db00575aa4694e;p=citadel.git diff --git a/webcit/mk_module_init.sh b/webcit/mk_module_init.sh index 61fe9318a..ae1cd3751 100755 --- a/webcit/mk_module_init.sh +++ b/webcit/mk_module_init.sh @@ -34,6 +34,7 @@ rm -f $C_FILE $H_FILE # server lifetime: START_FUNCS=`grep ServerStartModule_ *.c |sed "s;.*:;;" |sort -u` INIT_FUNCS=`grep InitModule_ *.c |sed "s;.*:;;" |sort -u` +INIT2_FUNCS=`grep InitModule2_ *.c |sed "s;.*:;;" |sort -u` FINALIZE_FUNCS=`grep FinalizeModule_ *.c |sed "s;.*:;;" |sort -u` SHUTDOWN_FUNCS=`grep ServerShutdownModule_ *.c |sed "s;.*:;;" |sort -u` @@ -43,6 +44,8 @@ SESS_ATTACH_FUNCS=`grep SessionAttachModule_ *.c |sed "s;.*:;;" |sort -u` SESS_DETACH_FUNCS=`grep SessionDetachModule_ *.c |sed "s;.*:;;" |sort -u` SESS_DESTROY_FUNCS=`grep SessionDestroyModule_ *.c |sed "s;.*:;;" |sort -u` +HTTP_NEW_FUNCS=`grep HttpNewModule_ *.c |sed "s;.*:;;" |sort -u` +HTTP_DETACH_FUNCS=`grep HttpDetachModule_ *.c |sed "s;.*:;;" |sort -u` HTTP_DESTROY_FUNCS=`grep HttpDestroyModule_ *.c |sed "s;.*:;;" |sort -u` @@ -66,6 +69,7 @@ extern size_t nSizErrmsg; * server lifetime: */ void initialise_modules (void); +void initialise2_modules (void); void start_modules (void); void shutdown_modules (void); @@ -78,6 +82,8 @@ void session_attach_modules (wcsession *sess); void session_detach_modules (wcsession *sess); void session_destroy_modules (wcsession **sess); +void http_new_modules (ParsedHttpHdrs *httpreq); +void http_detach_modules (ParsedHttpHdrs *httpreq); void http_destroy_modules (ParsedHttpHdrs *httpreq); @@ -151,7 +157,7 @@ HOOKNAME=`echo $HOOK |sed "s;ServerStartModule_;;"` # Add this entry point to the .c file cat <> $C_FILE #ifdef DBG_PRINNT_HOOKS_AT_START - lprintf (CTDL_INFO, "Starting $HOOKNAME\n"); + syslog(CTDL_INFO, "Starting $HOOKNAME\n"); #endif $HOOK(); EOF @@ -183,7 +189,7 @@ for HOOK in $INIT_FUNCS; do # Add this entry point to the .c file cat <> $C_FILE #ifdef DBG_PRINNT_HOOKS_AT_START - lprintf (CTDL_INFO, "Initializing $HOOKNAME\n"); + syslog(CTDL_INFO, "Initializing $HOOKNAME\n"); #endif $HOOK(); EOF @@ -193,6 +199,36 @@ extern void $HOOK(void); EOF done +#******************************************************************************** +# server module ******** initialisation ******** second stage. +#******************************************************************************** +cat <> $H_FILE + +/* Server Init Hooks: */ +EOF + +cat <>$C_FILE +} + + +void initialise2_modules (void) +{ + +EOF +for HOOK in $INIT2_FUNCS; do + HOOKNAME=`echo $HOOK |sed "s;InitModule2_;;"` +# Add this entry point to the .c file + cat <> $C_FILE +#ifdef DBG_PRINNT_HOOKS_AT_START + syslog(CTDL_INFO, "Initializing $HOOKNAME\n"); +#endif + $HOOK(); +EOF +# Add this entry point to the .h file + cat <> $H_FILE +extern void $HOOK(void); +EOF +done @@ -216,7 +252,7 @@ HOOKNAME=`echo $HOOK |sed "s;ServerShutdownModule_;;"` # Add this entry point to the .c file cat <> $C_FILE #ifdef DBG_PRINNT_HOOKS_AT_START - lprintf (CTDL_INFO, "Shutting down $HOOKNAME\n"); + syslog(CTDL_INFO, "Shutting down $HOOKNAME\n"); #endif $HOOK(); EOF @@ -249,7 +285,7 @@ HOOKNAME=`echo $HOOK |sed "s;SessionNewModule_;;"` # Add this entry point to the .c file cat <> $C_FILE #ifdef DBG_PRINNT_HOOKS_AT_START - lprintf (CTDL_INFO, "Initializing $HOOKNAME\n"); + syslog(CTDL_INFO, "Initializing $HOOKNAME\n"); #endif $HOOK(sess); EOF @@ -281,7 +317,7 @@ HOOKNAME=`echo $HOOK |sed "s;SessionAttachModule_;;"` # Add this entry point to the .c file cat <> $C_FILE #ifdef DBG_PRINNT_HOOKS_AT_START - lprintf (CTDL_INFO, "Attaching Session; $HOOKNAME\n"); + syslog(CTDL_INFO, "Attaching Session; $HOOKNAME\n"); #endif $HOOK(sess); EOF @@ -313,7 +349,7 @@ HOOKNAME=`echo $HOOK |sed "s;SessionDetachModule_;;"` # Add this entry point to the .c file cat <> $C_FILE #ifdef DBG_PRINNT_HOOKS_AT_START - lprintf (CTDL_INFO, "Initializing $HOOKNAME\n"); + syslog(CTDL_INFO, "Initializing $HOOKNAME\n"); #endif $HOOK(sess); EOF @@ -346,7 +382,7 @@ HOOKNAME=`echo $HOOK |sed "s;SessionDestroyModule_;;"` # Add this entry point to the .c file cat <> $C_FILE #ifdef DBG_PRINNT_HOOKS_AT_START - lprintf (CTDL_INFO, "Initializing $HOOKNAME\n"); + syslog(CTDL_INFO, "Initializing $HOOKNAME\n"); #endif $HOOK(*sess); EOF @@ -369,6 +405,63 @@ EOF +#******************************************************************************** +# NEW-Httprequest module logic. +#******************************************************************************** +cat <> $C_FILE + +void http_new_modules (ParsedHttpHdrs *httpreq) +{ +EOF + +for HOOK in $HTTP_NEW_FUNCS; do +HOOKNAME=`echo $HOOK |sed "s;HttpNewModule_;;"` +# Add this entry point to the .c file +cat <> $C_FILE +#ifdef DBG_PRINNT_HOOKS_AT_START + syslog(CTDL_INFO, "NEW $HOOKNAME\n"); +#endif + $HOOK(httpreq); +EOF +# Add this entry point to the .h file +cat <> $H_FILE +extern void $HOOK(ParsedHttpHdrs *httpreq); +EOF +done + +cat <>$C_FILE +} +EOF + +#******************************************************************************** +# DETACH-Httprequest module logic. +#******************************************************************************** +cat <> $C_FILE + +void http_detach_modules (ParsedHttpHdrs *httpreq) +{ +EOF + +for HOOK in $HTTP_DETACH_FUNCS; do +HOOKNAME=`echo $HOOK |sed "s;HttpDetachModule_;;"` +# Add this entry point to the .c file +cat <> $C_FILE +#ifdef DBG_PRINNT_HOOKS_AT_START + syslog(CTDL_INFO, "Detaching $HOOKNAME\n"); +#endif + $HOOK(httpreq); +EOF +# Add this entry point to the .h file +cat <> $H_FILE +extern void $HOOK(ParsedHttpHdrs *httpreq); +EOF +done + +cat <>$C_FILE +} +EOF + + #******************************************************************************** # DESTROY-Httprequest module logic. #******************************************************************************** @@ -383,7 +476,7 @@ HOOKNAME=`echo $HOOK |sed "s;HttpDestroyModule_;;"` # Add this entry point to the .c file cat <> $C_FILE #ifdef DBG_PRINNT_HOOKS_AT_START - lprintf (CTDL_INFO, "Destructing $HOOKNAME\n"); + syslog(CTDL_INFO, "Destructing $HOOKNAME\n"); #endif $HOOK(httpreq); EOF