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"
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);
135 #endif /* MODULES_INIT_H */
140 ###############################################################################
141 # u start the Makefile included file for $SERV_MODULES #
142 ###############################################################################
146 # This file is to be included by Makefile to dynamically add modules to the build process
147 # THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
153 echo modules/*/*.c | $SED "s;\.c ;.o \\\\\n;g" >> $MOD_FILE
157 ###############################################################################
158 # start of the files which inturn removes any existing file #
159 ###############################################################################
162 # start the Makefile included file for $SOURCES
166 # This file is to be included by Makefile to dynamically add modules to the build process
167 # THIS FILE WAS AUTO GENERATED BY mk_modules_init.sh DO NOT EDIT THIS FILE
174 echo modules/*/*.c | $SED "s;\.c ;.c \\\\\n;g" >> $SRC_FILE
179 ###############################################################################
180 # start the upgrade file #
181 ###############################################################################
185 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
196 #include <sys/types.h>
198 #include <libcitadel.h>
200 #include "modules_init.h"
201 #include "sysdep_decls.h"
202 #include "serv_extensions.h"
206 void upgrade_modules (void)
210 MODM_syslog(LOG_INFO, "Upgrade modules.\n");
214 # Add this entry point to the .c file
216 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
218 #close the upgrade file
219 /usr/bin/printf "}\n" >> $U_FILE