3 # Script to generate $C_FILE
8 #MINUS_e=X`$ECHO -n -e`
9 #if [ $MINUS_e != "X" ] ; then
15 #MINUS_E=X`$ECHO -n -E`
16 #if [ $MINUS_E != "X" ] ; then
24 C_FILE="$CUR_DIR/modules_init.c"
25 H_FILE="$CUR_DIR/modules_init.h"
26 MOD_FILE="$CUR_DIR/Make_modules"
27 SRC_FILE="$CUR_DIR/Make_sources"
28 U_FILE="$CUR_DIR/modules_upgrade.c"
30 /usr/bin/printf "Scanning extension modules for entry points.\n"
35 START_FUNCS=`grep ServerStartModule_ *.c |sed "s;.*:;;" |sort -u`
36 INIT_FUNCS=`grep InitModule_ *.c |sed "s;.*:;;" |sort -u`
37 FINALIZE_FUNCS=`grep FinalizeModule_ *.c |sed "s;.*:;;" |sort -u`
38 SHUTDOWN_FUNCS=`grep ServerShutdownModule_ *.c |sed "s;.*:;;" |sort -u`
41 SESS_NEW_FUNCS=`grep SessionNewModule_ *.c |sed "s;.*:;;" |sort -u`
42 SESS_ATTACH_FUNCS=`grep SessionAttachModule_ *.c |sed "s;.*:;;" |sort -u`
43 SESS_DETACH_FUNCS=`grep SessionDetachModule_ *.c |sed "s;.*:;;" |sort -u`
44 SESS_DESTROY_FUNCS=`grep SessionDestroyModule_ *.c |sed "s;.*:;;" |sort -u`
46 HTTP_DESTROY_FUNCS=`grep HttpDestroyModule_ *.c |sed "s;.*:;;" |sort -u`
49 #SESS_NEW_FUNCS=`grep SessionNewModule_ *.c |sed "s;.*:;;" |sort -u`
52 #start the header file
56 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
60 #ifndef MODULES_INIT_H
61 #define MODULES_INIT_H
62 extern size_t nSizErrmsg;
68 void initialise_modules (void);
69 void start_modules (void);
70 void shutdown_modules (void);
76 void session_new_modules (wcsession *sess);
77 void session_attach_modules (wcsession *sess);
78 void session_detach_modules (wcsession *sess);
79 void session_destroy_modules (wcsession **sess);
81 void http_destroy_modules (ParsedHttpHdrs *httpreq);
92 #start of the files which inturn removes any existing file
95 # start the Makefile included file for $SERV_MODULES
99 # This file is to be included by Makefile to dynamically add modules to the build process
100 # THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
105 # start the Makefile included file for $SOURCES
109 # This file is to be included by Makefile to dynamically add modules to the build process
110 # THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
119 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
129 #include <sys/types.h>
131 #include <libcitadel.h>
133 #include "modules_init.h"
134 #include "webserver.h"
136 void LogPrintMessages(long err);
137 extern long DetailErrorFlags;
139 void start_modules (void)
142 #********************************************************************************
143 # server ******** start ******** module logic.
144 #********************************************************************************
147 /* Server Start Hooks: */
149 for HOOK in $START_FUNCS; do
150 HOOKNAME=`echo $HOOK |sed "s;ServerStartModule_;;"`
151 # Add this entry point to the .c file
153 #ifdef DBG_PRINNT_HOOKS_AT_START
154 lprintf (CTDL_INFO, "Starting $HOOKNAME\n");
158 # Add this entry point to the .h file
160 extern void $HOOK(void);
165 #********************************************************************************
166 # server module ******** initialisation ******** logic.
167 #********************************************************************************
170 /* Server Init Hooks: */
177 void initialise_modules (void)
181 for HOOK in $INIT_FUNCS; do
182 HOOKNAME=`echo $HOOK |sed "s;InitModule_;;"`
183 # Add this entry point to the .c file
185 #ifdef DBG_PRINNT_HOOKS_AT_START
186 lprintf (CTDL_INFO, "Initializing $HOOKNAME\n");
190 # Add this entry point to the .h file
192 extern void $HOOK(void);
199 #********************************************************************************
200 # server module ***** shutdown ***** logic.
201 #********************************************************************************
204 /* Server shutdown Hooks: */
210 void shutdown_modules (void)
214 for HOOK in $SHUTDOWN_FUNCS; do
215 HOOKNAME=`echo $HOOK |sed "s;ServerShutdownModule_;;"`
216 # Add this entry point to the .c file
218 #ifdef DBG_PRINNT_HOOKS_AT_START
219 lprintf (CTDL_INFO, "Shutting down $HOOKNAME\n");
223 # Add this entry point to the .h file
225 extern void $HOOK(void);
232 #********************************************************************************
233 # NEW-session module logic.
234 #********************************************************************************
237 /* Session New Hooks: */
243 void session_new_modules (wcsession *sess)
247 for HOOK in $SESS_NEW_FUNCS; do
248 HOOKNAME=`echo $HOOK |sed "s;SessionNewModule_;;"`
249 # Add this entry point to the .c file
251 #ifdef DBG_PRINNT_HOOKS_AT_START
252 lprintf (CTDL_INFO, "Initializing $HOOKNAME\n");
256 # Add this entry point to the .h file
258 extern void $HOOK(wcsession *sess);
264 #********************************************************************************
265 # ATTACH-Session module logic.
266 #********************************************************************************
269 /* Session Attach Hooks: */
275 void session_attach_modules (wcsession *sess)
279 for HOOK in $SESS_ATTACH_FUNCS; do
280 HOOKNAME=`echo $HOOK |sed "s;SessionAttachModule_;;"`
281 # Add this entry point to the .c file
283 #ifdef DBG_PRINNT_HOOKS_AT_START
284 lprintf (CTDL_INFO, "Attaching Session; $HOOKNAME\n");
288 # Add this entry point to the .h file
290 extern void $HOOK(wcsession *sess);
296 #********************************************************************************
297 # DETACH-Session module logic.
298 #********************************************************************************
301 /* Session detach Hooks: */
307 void session_detach_modules (wcsession *sess)
311 for HOOK in $SESS_DETACH_FUNCS; do
312 HOOKNAME=`echo $HOOK |sed "s;SessionDetachModule_;;"`
313 # Add this entry point to the .c file
315 #ifdef DBG_PRINNT_HOOKS_AT_START
316 lprintf (CTDL_INFO, "Initializing $HOOKNAME\n");
320 # Add this entry point to the .h file
322 extern void $HOOK(wcsession *sess);
329 #********************************************************************************
330 # DESTROY-Session module logic.
331 #********************************************************************************
334 /* Session destroy Hooks: */
340 void session_destroy_modules (wcsession **sess)
344 for HOOK in $SESS_DESTROY_FUNCS; do
345 HOOKNAME=`echo $HOOK |sed "s;SessionDestroyModule_;;"`
346 # Add this entry point to the .c file
348 #ifdef DBG_PRINNT_HOOKS_AT_START
349 lprintf (CTDL_INFO, "Initializing $HOOKNAME\n");
353 # Add this entry point to the .h file
355 extern void $HOOK(wcsession *sess);
372 #********************************************************************************
373 # DESTROY-Httprequest module logic.
374 #********************************************************************************
377 void http_destroy_modules (ParsedHttpHdrs *httpreq)
381 for HOOK in $HTTP_DESTROY_FUNCS; do
382 HOOKNAME=`echo $HOOK |sed "s;HttpDestroyModule_;;"`
383 # Add this entry point to the .c file
385 #ifdef DBG_PRINNT_HOOKS_AT_START
386 lprintf (CTDL_INFO, "Destructing $HOOKNAME\n");
390 # Add this entry point to the .h file
392 extern void $HOOK(ParsedHttpHdrs *httpreq);
408 #endif /* MODULES_INIT_H */