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_DETACH_FUNCS=`grep HttpDetachModule_ *.c |sed "s;.*:;;" |sort -u`
47 HTTP_DESTROY_FUNCS=`grep HttpDestroyModule_ *.c |sed "s;.*:;;" |sort -u`
50 #SESS_NEW_FUNCS=`grep SessionNewModule_ *.c |sed "s;.*:;;" |sort -u`
53 #start the header file
57 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
61 #ifndef MODULES_INIT_H
62 #define MODULES_INIT_H
63 extern size_t nSizErrmsg;
69 void initialise_modules (void);
70 void start_modules (void);
71 void shutdown_modules (void);
77 void session_new_modules (wcsession *sess);
78 void session_attach_modules (wcsession *sess);
79 void session_detach_modules (wcsession *sess);
80 void session_destroy_modules (wcsession **sess);
82 void http_detach_modules (ParsedHttpHdrs *httpreq);
83 void http_destroy_modules (ParsedHttpHdrs *httpreq);
94 #start of the files which inturn removes any existing file
97 # start the Makefile included file for $SERV_MODULES
101 # This file is to be included by Makefile to dynamically add modules to the build process
102 # THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
107 # start the Makefile included file for $SOURCES
111 # This file is to be included by Makefile to dynamically add modules to the build process
112 # THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
121 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
131 #include <sys/types.h>
133 #include <libcitadel.h>
135 #include "modules_init.h"
136 #include "webserver.h"
138 void LogPrintMessages(long err);
139 extern long DetailErrorFlags;
141 void start_modules (void)
144 #********************************************************************************
145 # server ******** start ******** module logic.
146 #********************************************************************************
149 /* Server Start Hooks: */
151 for HOOK in $START_FUNCS; do
152 HOOKNAME=`echo $HOOK |sed "s;ServerStartModule_;;"`
153 # Add this entry point to the .c file
155 #ifdef DBG_PRINNT_HOOKS_AT_START
156 lprintf (CTDL_INFO, "Starting $HOOKNAME\n");
160 # Add this entry point to the .h file
162 extern void $HOOK(void);
167 #********************************************************************************
168 # server module ******** initialisation ******** logic.
169 #********************************************************************************
172 /* Server Init Hooks: */
179 void initialise_modules (void)
183 for HOOK in $INIT_FUNCS; do
184 HOOKNAME=`echo $HOOK |sed "s;InitModule_;;"`
185 # Add this entry point to the .c file
187 #ifdef DBG_PRINNT_HOOKS_AT_START
188 lprintf (CTDL_INFO, "Initializing $HOOKNAME\n");
192 # Add this entry point to the .h file
194 extern void $HOOK(void);
201 #********************************************************************************
202 # server module ***** shutdown ***** logic.
203 #********************************************************************************
206 /* Server shutdown Hooks: */
212 void shutdown_modules (void)
216 for HOOK in $SHUTDOWN_FUNCS; do
217 HOOKNAME=`echo $HOOK |sed "s;ServerShutdownModule_;;"`
218 # Add this entry point to the .c file
220 #ifdef DBG_PRINNT_HOOKS_AT_START
221 lprintf (CTDL_INFO, "Shutting down $HOOKNAME\n");
225 # Add this entry point to the .h file
227 extern void $HOOK(void);
234 #********************************************************************************
235 # NEW-session module logic.
236 #********************************************************************************
239 /* Session New Hooks: */
245 void session_new_modules (wcsession *sess)
249 for HOOK in $SESS_NEW_FUNCS; do
250 HOOKNAME=`echo $HOOK |sed "s;SessionNewModule_;;"`
251 # Add this entry point to the .c file
253 #ifdef DBG_PRINNT_HOOKS_AT_START
254 lprintf (CTDL_INFO, "Initializing $HOOKNAME\n");
258 # Add this entry point to the .h file
260 extern void $HOOK(wcsession *sess);
266 #********************************************************************************
267 # ATTACH-Session module logic.
268 #********************************************************************************
271 /* Session Attach Hooks: */
277 void session_attach_modules (wcsession *sess)
281 for HOOK in $SESS_ATTACH_FUNCS; do
282 HOOKNAME=`echo $HOOK |sed "s;SessionAttachModule_;;"`
283 # Add this entry point to the .c file
285 #ifdef DBG_PRINNT_HOOKS_AT_START
286 lprintf (CTDL_INFO, "Attaching Session; $HOOKNAME\n");
290 # Add this entry point to the .h file
292 extern void $HOOK(wcsession *sess);
298 #********************************************************************************
299 # DETACH-Session module logic.
300 #********************************************************************************
303 /* Session detach Hooks: */
309 void session_detach_modules (wcsession *sess)
313 for HOOK in $SESS_DETACH_FUNCS; do
314 HOOKNAME=`echo $HOOK |sed "s;SessionDetachModule_;;"`
315 # Add this entry point to the .c file
317 #ifdef DBG_PRINNT_HOOKS_AT_START
318 lprintf (CTDL_INFO, "Initializing $HOOKNAME\n");
322 # Add this entry point to the .h file
324 extern void $HOOK(wcsession *sess);
331 #********************************************************************************
332 # DESTROY-Session module logic.
333 #********************************************************************************
336 /* Session destroy Hooks: */
342 void session_destroy_modules (wcsession **sess)
346 for HOOK in $SESS_DESTROY_FUNCS; do
347 HOOKNAME=`echo $HOOK |sed "s;SessionDestroyModule_;;"`
348 # Add this entry point to the .c file
350 #ifdef DBG_PRINNT_HOOKS_AT_START
351 lprintf (CTDL_INFO, "Initializing $HOOKNAME\n");
355 # Add this entry point to the .h file
357 extern void $HOOK(wcsession *sess);
374 #********************************************************************************
375 # DETACH-Httprequest module logic.
376 #********************************************************************************
379 void http_detach_modules (ParsedHttpHdrs *httpreq)
383 for HOOK in $HTTP_DETACH_FUNCS; do
384 HOOKNAME=`echo $HOOK |sed "s;HttpDetachModule_;;"`
385 # Add this entry point to the .c file
387 #ifdef DBG_PRINNT_HOOKS_AT_START
388 lprintf (CTDL_INFO, "Detaching $HOOKNAME\n");
392 # Add this entry point to the .h file
394 extern void $HOOK(ParsedHttpHdrs *httpreq);
403 #********************************************************************************
404 # DESTROY-Httprequest module logic.
405 #********************************************************************************
408 void http_destroy_modules (ParsedHttpHdrs *httpreq)
412 for HOOK in $HTTP_DESTROY_FUNCS; do
413 HOOKNAME=`echo $HOOK |sed "s;HttpDestroyModule_;;"`
414 # Add this entry point to the .c file
416 #ifdef DBG_PRINNT_HOOKS_AT_START
417 lprintf (CTDL_INFO, "Destructing $HOOKNAME\n");
421 # Add this entry point to the .h file
423 extern void $HOOK(ParsedHttpHdrs *httpreq);
439 #endif /* MODULES_INIT_H */