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 -a ServerStartModule_ *.c |sed "s;.*:;;" |sort -u`
36 INIT_FUNCS=`grep -a InitModule_ *.c |sed "s;.*:;;" |sort -u`
37 INIT2_FUNCS=`grep -a InitModule2_ *.c |sed "s;.*:;;" |sort -u`
38 FINALIZE_FUNCS=`grep -a FinalizeModule_ *.c |sed "s;.*:;;" |sort -u`
39 SHUTDOWN_FUNCS=`grep -a ServerShutdownModule_ *.c |sed "s;.*:;;" |sort -u`
42 SESS_NEW_FUNCS=`grep -a SessionNewModule_ *.c |sed "s;.*:;;" |sort -u`
43 SESS_ATTACH_FUNCS=`grep -a SessionAttachModule_ *.c |sed "s;.*:;;" |sort -u`
44 SESS_DETACH_FUNCS=`grep -a SessionDetachModule_ *.c |sed "s;.*:;;" |sort -u`
45 SESS_DESTROY_FUNCS=`grep -a SessionDestroyModule_ *.c |sed "s;.*:;;" |sort -u`
47 HTTP_NEW_FUNCS=`grep -a HttpNewModule_ *.c |sed "s;.*:;;" |sort -u`
48 HTTP_DETACH_FUNCS=`grep -a HttpDetachModule_ *.c |sed "s;.*:;;" |sort -u`
49 HTTP_DESTROY_FUNCS=`grep -a HttpDestroyModule_ *.c |sed "s;.*:;;" |sort -u`
52 #SESS_NEW_FUNCS=`grep -a SessionNewModule_ *.c |sed "s;.*:;;" |sort -u`
55 #start the header file
59 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
63 #ifndef MODULES_INIT_H
64 #define MODULES_INIT_H
65 extern size_t nSizErrmsg;
71 void initialise_modules (void);
72 void initialise2_modules (void);
73 void start_modules (void);
74 void shutdown_modules (void);
80 void session_new_modules (wcsession *sess);
81 void session_attach_modules (wcsession *sess);
82 void session_detach_modules (wcsession *sess);
83 void session_destroy_modules (wcsession **sess);
85 void http_new_modules (ParsedHttpHdrs *httpreq);
86 void http_detach_modules (ParsedHttpHdrs *httpreq);
87 void http_destroy_modules (ParsedHttpHdrs *httpreq);
98 #start of the files which inturn removes any existing file
101 # start the Makefile included file for $SERV_MODULES
105 # This file is to be included by Makefile to dynamically add modules to the build process
106 # THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
111 # start the Makefile included file for $SOURCES
115 # This file is to be included by Makefile to dynamically add modules to the build process
116 # THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
125 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
135 #include <sys/types.h>
137 #include <libcitadel.h>
139 #include "modules_init.h"
140 #include "webserver.h"
142 void LogPrintMessages(long err);
143 extern long DetailErrorFlags;
145 void start_modules (void)
148 #********************************************************************************
149 # server ******** start ******** module logic.
150 #********************************************************************************
153 /* Server Start Hooks: */
155 for HOOK in $START_FUNCS; do
156 HOOKNAME=`echo $HOOK |sed "s;ServerStartModule_;;"`
157 # Add this entry point to the .c file
159 #ifdef DBG_PRINNT_HOOKS_AT_START
160 syslog(LOG_DEBUG, "Starting $HOOKNAME\n");
164 # Add this entry point to the .h file
166 extern void $HOOK(void);
171 #********************************************************************************
172 # server module ******** initialisation ******** logic.
173 #********************************************************************************
176 /* Server Init Hooks: */
183 void initialise_modules (void)
187 for HOOK in $INIT_FUNCS; do
188 HOOKNAME=`echo $HOOK |sed "s;InitModule_;;"`
189 # Add this entry point to the .c file
191 #ifdef DBG_PRINNT_HOOKS_AT_START
192 syslog(LOG_DEBUG, "Initializing $HOOKNAME\n");
196 # Add this entry point to the .h file
198 extern void $HOOK(void);
202 #********************************************************************************
203 # server module ******** initialisation ******** second stage.
204 #********************************************************************************
207 /* Server Init Hooks: */
214 void initialise2_modules (void)
218 for HOOK in $INIT2_FUNCS; do
219 HOOKNAME=`echo $HOOK |sed "s;InitModule2_;;"`
220 # Add this entry point to the .c file
222 #ifdef DBG_PRINNT_HOOKS_AT_START
223 syslog(LOG_DEBUG, "Initializing $HOOKNAME\n");
227 # Add this entry point to the .h file
229 extern void $HOOK(void);
235 #********************************************************************************
236 # server module ***** shutdown ***** logic.
237 #********************************************************************************
240 /* Server shutdown Hooks: */
246 void shutdown_modules (void)
250 for HOOK in $SHUTDOWN_FUNCS; do
251 HOOKNAME=`echo $HOOK |sed "s;ServerShutdownModule_;;"`
252 # Add this entry point to the .c file
254 #ifdef DBG_PRINNT_HOOKS_AT_START
255 syslog(LOG_DEBUG, "Shutting down $HOOKNAME\n");
259 # Add this entry point to the .h file
261 extern void $HOOK(void);
268 #********************************************************************************
269 # NEW-session module logic.
270 #********************************************************************************
273 /* Session New Hooks: */
279 void session_new_modules (wcsession *sess)
283 for HOOK in $SESS_NEW_FUNCS; do
284 HOOKNAME=`echo $HOOK |sed "s;SessionNewModule_;;"`
285 # Add this entry point to the .c file
287 #ifdef DBG_PRINNT_HOOKS_AT_START
288 syslog(LOG_DEBUG, "Initializing $HOOKNAME\n");
292 # Add this entry point to the .h file
294 extern void $HOOK(wcsession *sess);
300 #********************************************************************************
301 # ATTACH-Session module logic.
302 #********************************************************************************
305 /* Session Attach Hooks: */
311 void session_attach_modules (wcsession *sess)
315 for HOOK in $SESS_ATTACH_FUNCS; do
316 HOOKNAME=`echo $HOOK |sed "s;SessionAttachModule_;;"`
317 # Add this entry point to the .c file
319 #ifdef DBG_PRINNT_HOOKS_AT_START
320 syslog(LOG_DEBUG, "Attaching Session; $HOOKNAME\n");
324 # Add this entry point to the .h file
326 extern void $HOOK(wcsession *sess);
332 #********************************************************************************
333 # DETACH-Session module logic.
334 #********************************************************************************
337 /* Session detach Hooks: */
343 void session_detach_modules (wcsession *sess)
347 for HOOK in $SESS_DETACH_FUNCS; do
348 HOOKNAME=`echo $HOOK |sed "s;SessionDetachModule_;;"`
349 # Add this entry point to the .c file
351 #ifdef DBG_PRINNT_HOOKS_AT_START
352 syslog(LOG_DEBUG, "Initializing $HOOKNAME\n");
356 # Add this entry point to the .h file
358 extern void $HOOK(wcsession *sess);
365 #********************************************************************************
366 # DESTROY-Session module logic.
367 #********************************************************************************
370 /* Session destroy Hooks: */
376 void session_destroy_modules (wcsession **sess)
380 for HOOK in $SESS_DESTROY_FUNCS; do
381 HOOKNAME=`echo $HOOK |sed "s;SessionDestroyModule_;;"`
382 # Add this entry point to the .c file
384 #ifdef DBG_PRINNT_HOOKS_AT_START
385 syslog(LOG_DEBUG, "Initializing $HOOKNAME\n");
389 # Add this entry point to the .h file
391 extern void $HOOK(wcsession *sess);
408 #********************************************************************************
409 # NEW-Httprequest module logic.
410 #********************************************************************************
413 void http_new_modules (ParsedHttpHdrs *httpreq)
417 for HOOK in $HTTP_NEW_FUNCS; do
418 HOOKNAME=`echo $HOOK |sed "s;HttpNewModule_;;"`
419 # Add this entry point to the .c file
421 #ifdef DBG_PRINNT_HOOKS_AT_START
422 syslog(LOG_DEBUG, "NEW $HOOKNAME\n");
426 # Add this entry point to the .h file
428 extern void $HOOK(ParsedHttpHdrs *httpreq);
436 #********************************************************************************
437 # DETACH-Httprequest module logic.
438 #********************************************************************************
441 void http_detach_modules (ParsedHttpHdrs *httpreq)
445 for HOOK in $HTTP_DETACH_FUNCS; do
446 HOOKNAME=`echo $HOOK |sed "s;HttpDetachModule_;;"`
447 # Add this entry point to the .c file
449 #ifdef DBG_PRINNT_HOOKS_AT_START
450 syslog(LOG_DEBUG, "Detaching $HOOKNAME\n");
454 # Add this entry point to the .h file
456 extern void $HOOK(ParsedHttpHdrs *httpreq);
465 #********************************************************************************
466 # DESTROY-Httprequest module logic.
467 #********************************************************************************
470 void http_destroy_modules (ParsedHttpHdrs *httpreq)
474 for HOOK in $HTTP_DESTROY_FUNCS; do
475 HOOKNAME=`echo $HOOK |sed "s;HttpDestroyModule_;;"`
476 # Add this entry point to the .c file
478 #ifdef DBG_PRINNT_HOOKS_AT_START
479 syslog(LOG_DEBUG, "Destructing $HOOKNAME\n");
483 # Add this entry point to the .h file
485 extern void $HOOK(ParsedHttpHdrs *httpreq);
501 #endif /* MODULES_INIT_H */