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"
29 L_FILE="$CUR_DIR/language_list.h"
31 /usr/bin/printf "Scanning extension modules for entry points.\n"
36 START_FUNCS=`grep ServerStartModule_ *.c |sed "s;.*:;;" |sort -u`
37 INIT_FUNCS=`grep InitModule_ *.c |sed "s;.*:;;" |sort -u`
38 INIT2_FUNCS=`grep InitModule2_ *.c |sed "s;.*:;;" |sort -u`
39 FINALIZE_FUNCS=`grep FinalizeModule_ *.c |sed "s;.*:;;" |sort -u`
40 SHUTDOWN_FUNCS=`grep ServerShutdownModule_ *.c |sed "s;.*:;;" |sort -u`
43 SESS_NEW_FUNCS=`grep SessionNewModule_ *.c |sed "s;.*:;;" |sort -u`
44 SESS_ATTACH_FUNCS=`grep SessionAttachModule_ *.c |sed "s;.*:;;" |sort -u`
45 SESS_DETACH_FUNCS=`grep SessionDetachModule_ *.c |sed "s;.*:;;" |sort -u`
46 SESS_DESTROY_FUNCS=`grep SessionDestroyModule_ *.c |sed "s;.*:;;" |sort -u`
48 HTTP_NEW_FUNCS=`grep HttpNewModule_ *.c |sed "s;.*:;;" |sort -u`
49 HTTP_DETACH_FUNCS=`grep HttpDetachModule_ *.c |sed "s;.*:;;" |sort -u`
50 HTTP_DESTROY_FUNCS=`grep HttpDestroyModule_ *.c |sed "s;.*:;;" |sort -u`
53 #SESS_NEW_FUNCS=`grep SessionNewModule_ *.c |sed "s;.*:;;" |sort -u`
56 #start the header file
60 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
64 #ifndef MODULES_INIT_H
65 #define MODULES_INIT_H
66 extern size_t nSizErrmsg;
72 void initialise_modules (void);
73 void initialise2_modules (void);
74 void start_modules (void);
75 void shutdown_modules (void);
81 void session_new_modules (wcsession *sess);
82 void session_attach_modules (wcsession *sess);
83 void session_detach_modules (wcsession *sess);
84 void session_destroy_modules (wcsession **sess);
86 void http_new_modules (ParsedHttpHdrs *httpreq);
87 void http_detach_modules (ParsedHttpHdrs *httpreq);
88 void http_destroy_modules (ParsedHttpHdrs *httpreq);
99 #start of the files which inturn removes any existing file
102 # start the Makefile included file for $SERV_MODULES
106 # This file is to be included by Makefile to dynamically add modules to the build process
107 # THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
112 # start the Makefile included file for $SOURCES
116 # This file is to be included by Makefile to dynamically add modules to the build process
117 # THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
126 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
136 #include <sys/types.h>
138 #include <libcitadel.h>
140 #include "modules_init.h"
141 #include "webserver.h"
143 void LogPrintMessages(long err);
144 extern long DetailErrorFlags;
146 void start_modules (void)
149 #********************************************************************************
150 # server ******** start ******** module logic.
151 #********************************************************************************
154 /* Server Start Hooks: */
156 for HOOK in $START_FUNCS; do
157 HOOKNAME=`echo $HOOK |sed "s;ServerStartModule_;;"`
158 # Add this entry point to the .c file
160 #ifdef DBG_PRINNT_HOOKS_AT_START
161 syslog(CTDL_INFO, "Starting $HOOKNAME\n");
165 # Add this entry point to the .h file
167 extern void $HOOK(void);
172 #********************************************************************************
173 # server module ******** initialisation ******** logic.
174 #********************************************************************************
177 /* Server Init Hooks: */
184 void initialise_modules (void)
188 for HOOK in $INIT_FUNCS; do
189 HOOKNAME=`echo $HOOK |sed "s;InitModule_;;"`
190 # Add this entry point to the .c file
192 #ifdef DBG_PRINNT_HOOKS_AT_START
193 syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
197 # Add this entry point to the .h file
199 extern void $HOOK(void);
203 #********************************************************************************
204 # server module ******** initialisation ******** second stage.
205 #********************************************************************************
208 /* Server Init Hooks: */
215 void initialise2_modules (void)
219 for HOOK in $INIT2_FUNCS; do
220 HOOKNAME=`echo $HOOK |sed "s;InitModule2_;;"`
221 # Add this entry point to the .c file
223 #ifdef DBG_PRINNT_HOOKS_AT_START
224 syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
228 # Add this entry point to the .h file
230 extern void $HOOK(void);
236 #********************************************************************************
237 # server module ***** shutdown ***** logic.
238 #********************************************************************************
241 /* Server shutdown Hooks: */
247 void shutdown_modules (void)
251 for HOOK in $SHUTDOWN_FUNCS; do
252 HOOKNAME=`echo $HOOK |sed "s;ServerShutdownModule_;;"`
253 # Add this entry point to the .c file
255 #ifdef DBG_PRINNT_HOOKS_AT_START
256 syslog(CTDL_INFO, "Shutting down $HOOKNAME\n");
260 # Add this entry point to the .h file
262 extern void $HOOK(void);
269 #********************************************************************************
270 # NEW-session module logic.
271 #********************************************************************************
274 /* Session New Hooks: */
280 void session_new_modules (wcsession *sess)
284 for HOOK in $SESS_NEW_FUNCS; do
285 HOOKNAME=`echo $HOOK |sed "s;SessionNewModule_;;"`
286 # Add this entry point to the .c file
288 #ifdef DBG_PRINNT_HOOKS_AT_START
289 syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
293 # Add this entry point to the .h file
295 extern void $HOOK(wcsession *sess);
301 #********************************************************************************
302 # ATTACH-Session module logic.
303 #********************************************************************************
306 /* Session Attach Hooks: */
312 void session_attach_modules (wcsession *sess)
316 for HOOK in $SESS_ATTACH_FUNCS; do
317 HOOKNAME=`echo $HOOK |sed "s;SessionAttachModule_;;"`
318 # Add this entry point to the .c file
320 #ifdef DBG_PRINNT_HOOKS_AT_START
321 syslog(CTDL_INFO, "Attaching Session; $HOOKNAME\n");
325 # Add this entry point to the .h file
327 extern void $HOOK(wcsession *sess);
333 #********************************************************************************
334 # DETACH-Session module logic.
335 #********************************************************************************
338 /* Session detach Hooks: */
344 void session_detach_modules (wcsession *sess)
348 for HOOK in $SESS_DETACH_FUNCS; do
349 HOOKNAME=`echo $HOOK |sed "s;SessionDetachModule_;;"`
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);
366 #********************************************************************************
367 # DESTROY-Session module logic.
368 #********************************************************************************
371 /* Session destroy Hooks: */
377 void session_destroy_modules (wcsession **sess)
381 for HOOK in $SESS_DESTROY_FUNCS; do
382 HOOKNAME=`echo $HOOK |sed "s;SessionDestroyModule_;;"`
383 # Add this entry point to the .c file
385 #ifdef DBG_PRINNT_HOOKS_AT_START
386 syslog(CTDL_INFO, "Initializing $HOOKNAME\n");
390 # Add this entry point to the .h file
392 extern void $HOOK(wcsession *sess);
409 #********************************************************************************
410 # NEW-Httprequest module logic.
411 #********************************************************************************
414 void http_new_modules (ParsedHttpHdrs *httpreq)
418 for HOOK in $HTTP_NEW_FUNCS; do
419 HOOKNAME=`echo $HOOK |sed "s;HttpNewModule_;;"`
420 # Add this entry point to the .c file
422 #ifdef DBG_PRINNT_HOOKS_AT_START
423 syslog(CTDL_INFO, "NEW $HOOKNAME\n");
427 # Add this entry point to the .h file
429 extern void $HOOK(ParsedHttpHdrs *httpreq);
437 #********************************************************************************
438 # DETACH-Httprequest module logic.
439 #********************************************************************************
442 void http_detach_modules (ParsedHttpHdrs *httpreq)
446 for HOOK in $HTTP_DETACH_FUNCS; do
447 HOOKNAME=`echo $HOOK |sed "s;HttpDetachModule_;;"`
448 # Add this entry point to the .c file
450 #ifdef DBG_PRINNT_HOOKS_AT_START
451 syslog(CTDL_INFO, "Detaching $HOOKNAME\n");
455 # Add this entry point to the .h file
457 extern void $HOOK(ParsedHttpHdrs *httpreq);
466 #********************************************************************************
467 # DESTROY-Httprequest module logic.
468 #********************************************************************************
471 void http_destroy_modules (ParsedHttpHdrs *httpreq)
475 for HOOK in $HTTP_DESTROY_FUNCS; do
476 HOOKNAME=`echo $HOOK |sed "s;HttpDestroyModule_;;"`
477 # Add this entry point to the .c file
479 #ifdef DBG_PRINNT_HOOKS_AT_START
480 syslog(CTDL_INFO, "Destructing $HOOKNAME\n");
484 # Add this entry point to the .h file
486 extern void $HOOK(ParsedHttpHdrs *httpreq);
502 #endif /* MODULES_INIT_H */
507 ### Now see what language modules we have installed ###
508 /usr/bin/printf "Scanning language modules.\n"
511 /* This file is generated automatically by mk_module_init.sh
512 * Editing it by hand would be an exercise in futility.
514 const char *AvailLang[] = {
518 for x in po/webcit/*.po
520 echo \ \"`basename $x | sed s/\.po\$//g`\",