3 # Script to generate $C_FILE
9 #MINUS_e=X`$ECHO -n -e`
10 #if [ $MINUS_e != "X" ] ; then
16 #MINUS_E=X`$ECHO -n -E`
17 #if [ $MINUS_E != "X" ] ; then
25 C_FILE="$CUR_DIR/modules_init.c"
26 H_FILE="$CUR_DIR/modules_init.h"
27 MOD_FILE="$CUR_DIR/Make_modules"
28 SRC_FILE="$CUR_DIR/Make_sources"
29 U_FILE="$CUR_DIR/modules_upgrade.c"
31 /usr/bin/printf "Scanning extension modules for entry points.\n"
33 STATIC_FIRST_MODULES="citserver control modules euidindex file_ops msgbase room_ops user_ops nttlist database"
34 DYNAMIC_MODULES=`grep CTDL_MODULE_INIT modules/*/*.c |$SED 's;.*(\(.*\));\1;'`
35 if test -d user_modules; then
36 USER_MODULES=`grep CTDL_MODULE_INIT user_modules/*/*.c |$SED 's;.*(\(.*\));\1;'`
40 STATIC_LAST_MODULES="netconfig"
42 ###############################################################################
44 ###############################################################################
49 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
59 #include <sys/types.h>
61 #include <libcitadel.h>
63 #include "modules_init.h"
64 #include "sysdep_decls.h"
65 #include "serv_extensions.h"
68 void LogPrintMessages(long err);
69 extern long DetailErrorFlags;
71 void initialise_modules (int threading)
77 MODM_syslog(LOG_DEBUG, "Initializing, CtdlThreads enabled.\n");
80 MODM_syslog(LOG_INFO, "Initializing. CtdlThreads not yet enabled.\n");
86 for i in ${STATIC_FIRST_MODULES} ${DYNAMIC_MODULES} ${USER_MODULES} ${STATIC_LAST_MODULES}; do
88 pMod = CTDL_INIT_CALL($i);
89 MOD_syslog(LOG_DEBUG, "Loaded module: %s\n", pMod);
95 for (filter = 1; filter != 0; filter = filter << 1)
96 if ((filter & DetailErrorFlags) != 0)
97 LogPrintMessages(filter);
106 ###############################################################################
107 # start the header file #
108 ###############################################################################
112 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
116 #ifndef MODULES_INIT_H
117 #define MODULES_INIT_H
118 #include "ctdl_module.h"
119 extern size_t nSizErrmsg;
120 void initialise_modules (int threading);
121 void upgrade_modules(void);
125 for i in ${STATIC_FIRST_MODULES} ${DYNAMIC_MODULES} ${USER_MODULES} ${STATIC_LAST_MODULES}; do
126 # Add this entry point to the .h file
128 CTDL_MODULE_INIT($i);
132 grep CTDL_MODULE_UPGRADE *.c modules/*/*.c |$SED 's;.*(\(.*\));\CTDL_MODULE_UPGRADE(\1)\;\n;' >> $H_FILE
137 #endif /* MODULES_INIT_H */
142 ###############################################################################
143 # u start the Makefile included file for $SERV_MODULES #
144 ###############################################################################
148 # This file is to be included by Makefile to dynamically add modules to the build process
149 # THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
155 echo modules/*/*.c | $SED -e "s;\.c ;.o \\\\\n;g" -e "s;\.c;.o;" >> $MOD_FILE
159 ###############################################################################
160 # start of the files which inturn removes any existing file #
161 ###############################################################################
164 # start the Makefile included file for $SOURCES
168 # This file is to be included by Makefile to dynamically add modules to the build process
169 # THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
175 echo modules/*/*.c | $SED "s;\.c ;.c \\\\\n;g" >> $SRC_FILE
180 ###############################################################################
181 # start the upgrade file #
182 ###############################################################################
186 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
197 #include <sys/types.h>
199 #include <libcitadel.h>
201 #include "modules_init.h"
202 #include "sysdep_decls.h"
203 #include "serv_extensions.h"
207 void upgrade_modules (void)
211 MODM_syslog(LOG_INFO, "Upgrade modules.\n");
215 # Add this entry point to the .c file
217 grep CTDL_MODULE_UPGRADE *.c modules/*/*.c |$SED 's;.*(\(.*\));\tpMod = CTDL_UPGRADE_CALL(\1)\;\n\tMOD_syslog(LOG_INFO, "%s\\n", pMod)\;\n;' >> $U_FILE
219 #close the upgrade file
220 /usr/bin/printf "}\n" >> $U_FILE