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_NEW_FUNCS=`grep HttpNewModule_ *.c |sed "s;.*:;;" |sort -u`
47 HTTP_DETACH_FUNCS=`grep HttpDetachModule_ *.c |sed "s;.*:;;" |sort -u`
48 HTTP_DESTROY_FUNCS=`grep HttpDestroyModule_ *.c |sed "s;.*:;;" |sort -u`
51 #SESS_NEW_FUNCS=`grep SessionNewModule_ *.c |sed "s;.*:;;" |sort -u`
54 #start the header file
58 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
62 #ifndef MODULES_INIT_H
63 #define MODULES_INIT_H
64 extern size_t nSizErrmsg;
70 void initialise_modules (void);
71 void start_modules (void);
72 void shutdown_modules (void);
78 void session_new_modules (wcsession *sess);
79 void session_attach_modules (wcsession *sess);
80 void session_detach_modules (wcsession *sess);
81 void session_destroy_modules (wcsession **sess);
83 void http_new_modules (ParsedHttpHdrs *httpreq);
84 void http_detach_modules (ParsedHttpHdrs *httpreq);
85 void http_destroy_modules (ParsedHttpHdrs *httpreq);
96 #start of the files which inturn removes any existing file
99 # start the Makefile included file for $SERV_MODULES
103 # This file is to be included by Makefile to dynamically add modules to the build process
104 # THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
109 # start the Makefile included file for $SOURCES
113 # This file is to be included by Makefile to dynamically add modules to the build process
114 # THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
123 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
133 #include <sys/types.h>
135 #include <libcitadel.h>
137 #include "modules_init.h"
138 #include "webserver.h"
140 void LogPrintMessages(long err);
141 extern long DetailErrorFlags;
143 void start_modules (void)
146 #********************************************************************************
147 # server ******** start ******** module logic.
148 #********************************************************************************
151 /* Server Start Hooks: */
153 for HOOK in $START_FUNCS; do
154 HOOKNAME=`echo $HOOK |sed "s;ServerStartModule_;;"`
155 # Add this entry point to the .c file
157 #ifdef DBG_PRINNT_HOOKS_AT_START
158 syslog(CTDL_INFO, "Starting $HOOKNAME\n");
162 # Add this entry point to the .h file
164 extern void $HOOK(void);
169 #********************************************************************************
170 # server module ******** initialisation ******** logic.
171 #********************************************************************************
174 /* Server Init Hooks: */
181 void initialise_modules (void)
185 for HOOK in $INIT_FUNCS; do
186 HOOKNAME=`echo $HOOK |sed "s;InitModule_;;"`
187 # Add this entry point to the .c file
189 #ifdef DBG_PRINNT_HOOKS_AT_START
190 syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
194 # Add this entry point to the .h file
196 extern void $HOOK(void);
203 #********************************************************************************
204 # server module ***** shutdown ***** logic.
205 #********************************************************************************
208 /* Server shutdown Hooks: */
214 void shutdown_modules (void)
218 for HOOK in $SHUTDOWN_FUNCS; do
219 HOOKNAME=`echo $HOOK |sed "s;ServerShutdownModule_;;"`
220 # Add this entry point to the .c file
222 #ifdef DBG_PRINNT_HOOKS_AT_START
223 syslog(CTDL_INFO, "Shutting down $HOOKNAME\n");
227 # Add this entry point to the .h file
229 extern void $HOOK(void);
236 #********************************************************************************
237 # NEW-session module logic.
238 #********************************************************************************
241 /* Session New Hooks: */
247 void session_new_modules (wcsession *sess)
251 for HOOK in $SESS_NEW_FUNCS; do
252 HOOKNAME=`echo $HOOK |sed "s;SessionNewModule_;;"`
253 # Add this entry point to the .c file
255 #ifdef DBG_PRINNT_HOOKS_AT_START
256 syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
260 # Add this entry point to the .h file
262 extern void $HOOK(wcsession *sess);
268 #********************************************************************************
269 # ATTACH-Session module logic.
270 #********************************************************************************
273 /* Session Attach Hooks: */
279 void session_attach_modules (wcsession *sess)
283 for HOOK in $SESS_ATTACH_FUNCS; do
284 HOOKNAME=`echo $HOOK |sed "s;SessionAttachModule_;;"`
285 # Add this entry point to the .c file
287 #ifdef DBG_PRINNT_HOOKS_AT_START
288 syslog(CTDL_INFO, "Attaching Session; $HOOKNAME\n");
292 # Add this entry point to the .h file
294 extern void $HOOK(wcsession *sess);
300 #********************************************************************************
301 # DETACH-Session module logic.
302 #********************************************************************************
305 /* Session detach Hooks: */
311 void session_detach_modules (wcsession *sess)
315 for HOOK in $SESS_DETACH_FUNCS; do
316 HOOKNAME=`echo $HOOK |sed "s;SessionDetachModule_;;"`
317 # Add this entry point to the .c file
319 #ifdef DBG_PRINNT_HOOKS_AT_START
320 syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
324 # Add this entry point to the .h file
326 extern void $HOOK(wcsession *sess);
333 #********************************************************************************
334 # DESTROY-Session module logic.
335 #********************************************************************************
338 /* Session destroy Hooks: */
344 void session_destroy_modules (wcsession **sess)
348 for HOOK in $SESS_DESTROY_FUNCS; do
349 HOOKNAME=`echo $HOOK |sed "s;SessionDestroyModule_;;"`
350 # Add this entry point to the .c file
352 #ifdef DBG_PRINNT_HOOKS_AT_START
353 syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
357 # Add this entry point to the .h file
359 extern void $HOOK(wcsession *sess);
376 #********************************************************************************
377 # NEW-Httprequest module logic.
378 #********************************************************************************
381 void http_new_modules (ParsedHttpHdrs *httpreq)
385 for HOOK in $HTTP_NEW_FUNCS; do
386 HOOKNAME=`echo $HOOK |sed "s;HttpNewModule_;;"`
387 # Add this entry point to the .c file
389 #ifdef DBG_PRINNT_HOOKS_AT_START
390 syslog(CTDL_INFO, "NEW $HOOKNAME\n");
394 # Add this entry point to the .h file
396 extern void $HOOK(ParsedHttpHdrs *httpreq);
404 #********************************************************************************
405 # DETACH-Httprequest module logic.
406 #********************************************************************************
409 void http_detach_modules (ParsedHttpHdrs *httpreq)
413 for HOOK in $HTTP_DETACH_FUNCS; do
414 HOOKNAME=`echo $HOOK |sed "s;HttpDetachModule_;;"`
415 # Add this entry point to the .c file
417 #ifdef DBG_PRINNT_HOOKS_AT_START
418 syslog(CTDL_INFO, "Detaching $HOOKNAME\n");
422 # Add this entry point to the .h file
424 extern void $HOOK(ParsedHttpHdrs *httpreq);
433 #********************************************************************************
434 # DESTROY-Httprequest module logic.
435 #********************************************************************************
438 void http_destroy_modules (ParsedHttpHdrs *httpreq)
442 for HOOK in $HTTP_DESTROY_FUNCS; do
443 HOOKNAME=`echo $HOOK |sed "s;HttpDestroyModule_;;"`
444 # Add this entry point to the .c file
446 #ifdef DBG_PRINNT_HOOKS_AT_START
447 syslog(CTDL_INFO, "Destructing $HOOKNAME\n");
451 # Add this entry point to the .h file
453 extern void $HOOK(ParsedHttpHdrs *httpreq);
469 #endif /* MODULES_INIT_H */