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`
47 #SESS_NEW_FUNCS=`grep SessionNewModule_ *.c |sed "s;.*:;;" |sort -u`
50 #start the header file
54 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
58 #ifndef MODULES_INIT_H
59 #define MODULES_INIT_H
60 extern size_t nSizErrmsg;
66 void initialise_modules (void);
67 void start_modules (void);
68 void shutdown_modules (void);
74 void session_new_modules (wcsession *sess);
75 void session_attach_modules (wcsession *sess);
76 void session_detach_modules (wcsession *sess);
77 void session_destroy_modules (wcsession **sess);
88 #start of the files which inturn removes any existing file
91 # start the Makefile included file for $SERV_MODULES
95 # This file is to be included by Makefile to dynamically add modules to the build process
96 # THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
101 # start the Makefile included file for $SOURCES
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
115 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
125 #include <sys/types.h>
127 #include <libcitadel.h>
129 #include "modules_init.h"
130 #include "webserver.h"
132 void LogPrintMessages(long err);
133 extern long DetailErrorFlags;
135 void start_modules (void)
138 #********************************************************************************
139 # server ******** start ******** module logic.
140 #********************************************************************************
143 /* Server Start Hooks: */
145 for HOOK in $START_FUNCS; do
146 HOOKNAME=`echo $HOOK |sed "s;ServerStartModule_;;"`
147 # Add this entry point to the .c file
149 #ifdef DBG_PRINNT_HOOKS_AT_START
150 lprintf (CTDL_INFO, "Starting $HOOKNAME\n");
154 # Add this entry point to the .h file
156 extern void $HOOK(void);
161 #********************************************************************************
162 # server module ******** initialisation ******** logic.
163 #********************************************************************************
166 /* Server Init Hooks: */
173 void initialise_modules (void)
177 for HOOK in $INIT_FUNCS; do
178 HOOKNAME=`echo $HOOK |sed "s;InitModule_;;"`
179 # Add this entry point to the .c file
181 #ifdef DBG_PRINNT_HOOKS_AT_START
182 lprintf (CTDL_INFO, "Initializing $HOOKNAME\n");
186 # Add this entry point to the .h file
188 extern void $HOOK(void);
195 #********************************************************************************
196 # server module ***** shutdown ***** logic.
197 #********************************************************************************
200 /* Server shutdown Hooks: */
206 void shutdown_modules (void)
210 for HOOK in $SHUTDOWN_FUNCS; do
211 HOOKNAME=`echo $HOOK |sed "s;ServerShutdownModule_;;"`
212 # Add this entry point to the .c file
214 #ifdef DBG_PRINNT_HOOKS_AT_START
215 lprintf (CTDL_INFO, "Shutting down $HOOKNAME\n");
219 # Add this entry point to the .h file
221 extern void $HOOK(void);
228 #********************************************************************************
229 # NEW-session module logic.
230 #********************************************************************************
233 /* Session New Hooks: */
239 void session_new_modules (wcsession *sess)
243 for HOOK in $SESS_NEW_FUNCS; do
244 HOOKNAME=`echo $HOOK |sed "s;SessionNewModule_;;"`
245 # Add this entry point to the .c file
247 #ifdef DBG_PRINNT_HOOKS_AT_START
248 lprintf (CTDL_INFO, "Initializing $HOOKNAME\n");
252 # Add this entry point to the .h file
254 extern void $HOOK(wcsession *sess);
260 #********************************************************************************
261 # ATTACH-Session module logic.
262 #********************************************************************************
265 /* Session Attach Hooks: */
271 void session_attach_modules (wcsession *sess)
275 for HOOK in $SESS_ATTACH_FUNCS; do
276 HOOKNAME=`echo $HOOK |sed "s;SessionAttachModule_;;"`
277 # Add this entry point to the .c file
279 #ifdef DBG_PRINNT_HOOKS_AT_START
280 lprintf (CTDL_INFO, "Attaching Session; $HOOKNAME\n");
284 # Add this entry point to the .h file
286 extern void $HOOK(wcsession *sess);
292 #********************************************************************************
293 # DETACH-Session module logic.
294 #********************************************************************************
297 /* Session detach Hooks: */
303 void session_detach_modules (wcsession *sess)
307 for HOOK in $SESS_DETACH_FUNCS; do
308 HOOKNAME=`echo $HOOK |sed "s;SessionDetachModule_;;"`
309 # Add this entry point to the .c file
311 #ifdef DBG_PRINNT_HOOKS_AT_START
312 lprintf (CTDL_INFO, "Initializing $HOOKNAME\n");
316 # Add this entry point to the .h file
318 extern void $HOOK(wcsession *sess);
325 #********************************************************************************
326 # DESTROY-Session module logic.
327 #********************************************************************************
330 /* Session destroy Hooks: */
336 void session_destroy_modules (wcsession **sess)
340 for HOOK in $SESS_DESTROY_FUNCS; do
341 HOOKNAME=`echo $HOOK |sed "s;SessionDestroyModule_;;"`
342 # Add this entry point to the .c file
344 #ifdef DBG_PRINNT_HOOKS_AT_START
345 lprintf (CTDL_INFO, "Initializing $HOOKNAME\n");
349 # Add this entry point to the .h file
351 extern void $HOOK(wcsession *sess);
370 #endif /* MODULES_INIT_H */