Begun phase 2 of modules stuff.
authorDave West <davew@uncensored.citadel.org>
Sat, 28 Jul 2007 11:30:54 +0000 (11:30 +0000)
committerDave West <davew@uncensored.citadel.org>
Sat, 28 Jul 2007 11:30:54 +0000 (11:30 +0000)
Moved serv_test.c into modules/test
modified Makefile.in to build it.
Fixed a bug in mk_module_init.sh that stopped it scanning the subdirs

citadel/Makefile.in
citadel/mk_module_init.sh
citadel/modules/test/serv_test.c [new file with mode: 0644]
citadel/serv_test.c [deleted file]

index 7cfddeb59fed94dfdee90db854608e8279e2c024..1b0261fdb6692c51d3da48b895b83c905cb5c891 100644 (file)
@@ -65,7 +65,7 @@ SERV_MODULES=serv_chat.o \
        serv_ldap.o \
        serv_autocompletion.o \
        serv_funambol.o \
-       serv_test.o
+       modules/test/serv_test.o
 
 UTIL_TARGETS=aidepost msgform \
        citmail userlist sendcommand \
@@ -113,12 +113,13 @@ SOURCES=aidepost.c auth.c base64.c chkpwd.c chkpw.c citadel.c citadel_ipc.c \
        serv_crypto.c serv_expire.c serv_imap.c serv_inetcfg.c \
        serv_listsub.c serv_mrtg.c serv_netfilter.c serv_network.c \
        serv_newuser.c serv_pas2.c serv_pop3.c serv_rwho.c serv_smtp.c \
-       serv_spam.c serv_test.c serv_mrtg.c serv_spam.c serv_upgrade.c \
+       serv_spam.c serv_mrtg.c serv_spam.c serv_upgrade.c \
        serv_vandelay.c serv_vcard.c serv_managesieve.c server_main.c \
        serv_sieve.c serv_funambol.c setup.c snprintf.c imap_acl.c \
        stress.c support.c sysdep.c tools.c user_ops.c userlist.c \
        whobbs.c vcard.c serv_notes.c serv_fulltext.c ft_wordbreaker.c \
-       crc16.c journaling.c citadel_dirs.c imap_list.c imap_metadata.c
+       crc16.c journaling.c citadel_dirs.c imap_list.c imap_metadata.c \
+       modules/test/serv_test.c
 
 DEP_FILES=$(SOURCES:.c=.d) modules_init.d
 
index 3b8a2ed605779ed92336fddf8b7177cd92535351..775013aa0c39e2bac526187b5e82eb448a6e83f3 100755 (executable)
@@ -73,12 +73,13 @@ if [ -d "modules" ] ; then
                                        if [ $RES != "X" ] ; then
                                                RES_OUT=`echo $RES | cut -b2-`
                                                echo -e "Found entry point in file modules/$j/$k"
-                                               echo -n "\t" >> $C_FILE
-                                               echo -E "lprintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL($RES_OUT));" >> $C_FILE
+                                               echo -e -n "\t" >> $C_FILE
+                                               echo -E "lprintf (CTDL_INFO, \"%s\n\", CTDL_INIT_CALL($RES_OUT));" >> $C_FILE
                                                echo -E "CTDL_MODULE_INIT($RES_OUT) ;" >> $H_FILE
                                        fi
                                fi
                        done
+                       cd ..
                fi
        done
 fi
@@ -98,12 +99,13 @@ if [ -d "user_modules" ] ; then
                                        if [ $RES != "X" ] ; then
                                                RES_OUT=`echo $RES | cut -b2-`
                                                echo -e "Found entry point in file user_modules/$j/$k"
-                                               echo -n "\t" >> $C_FILE
-                                               echo -E "lprintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL($RES_OUT));" >> $C_FILE
+                                               echo -e -n "\t" >> $C_FILE
+                                               echo -E "lprintf (CTDL_INFO, \"%s\n\", CTDL_INIT_CALL($RES_OUT));" >> $C_FILE
                                                echo -E "CTDL_MODULE_INIT($RES_OUT) ;" >> $H_FILE
                                        fi
                                fi
                        done
+                       cd ..
                fi
        done
 fi
diff --git a/citadel/modules/test/serv_test.c b/citadel/modules/test/serv_test.c
new file mode 100644 (file)
index 0000000..356b167
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * $Id$
+ *
+ * A skeleton module to test the dynamic loader.
+ *
+ */
+
+#include "sysdep.h"
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <pwd.h>
+#include <errno.h>
+#include <sys/types.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
+#include <sys/wait.h>
+#include <string.h>
+#include <limits.h>
+#include "ctdl_module.h"
+
+extern struct CitContext *ContextList;
+
+void CleanupTest(void) {
+       lprintf(CTDL_DEBUG, "--- test of adding an unload hook --- \n");
+       }
+
+void NewRoomTest(void) {
+       lprintf(CTDL_DEBUG, "--- test module was told we're now in a new room ---\n");
+       }
+
+void SessionStartTest(void) {
+       lprintf(CTDL_DEBUG, "--- starting up session %d ---\n",
+               CC->cs_pid);
+       }
+
+void SessionStopTest(void) {
+       lprintf(CTDL_DEBUG, "--- ending session %d ---\n", 
+               CC->cs_pid);
+       }
+
+void LoginTest(void) {
+       lprintf(CTDL_DEBUG, "--- Hello, %s ---\n", CC->curr_user);
+       }
+
+/* To insert this module into the server activate the next block by changing the #if 0 to #if 1 */
+CTDL_MODULE_INIT(test)
+{
+#if 0
+   CtdlRegisterCleanupHook(CleanupTest);
+   CtdlRegisterSessionHook(NewRoomTest, EVT_NEWROOM);
+   CtdlRegisterSessionHook(SessionStartTest, EVT_START);
+   CtdlRegisterSessionHook(SessionStopTest, EVT_STOP);
+   CtdlRegisterSessionHook(LoginTest, EVT_LOGIN);
+#endif
+
+   /* return our Subversion id for the Log */
+   return "$Id$";
+}
diff --git a/citadel/serv_test.c b/citadel/serv_test.c
deleted file mode 100644 (file)
index 356b167..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * $Id$
- *
- * A skeleton module to test the dynamic loader.
- *
- */
-
-#include "sysdep.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <pwd.h>
-#include <errno.h>
-#include <sys/types.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-
-#include <sys/wait.h>
-#include <string.h>
-#include <limits.h>
-#include "ctdl_module.h"
-
-extern struct CitContext *ContextList;
-
-void CleanupTest(void) {
-       lprintf(CTDL_DEBUG, "--- test of adding an unload hook --- \n");
-       }
-
-void NewRoomTest(void) {
-       lprintf(CTDL_DEBUG, "--- test module was told we're now in a new room ---\n");
-       }
-
-void SessionStartTest(void) {
-       lprintf(CTDL_DEBUG, "--- starting up session %d ---\n",
-               CC->cs_pid);
-       }
-
-void SessionStopTest(void) {
-       lprintf(CTDL_DEBUG, "--- ending session %d ---\n", 
-               CC->cs_pid);
-       }
-
-void LoginTest(void) {
-       lprintf(CTDL_DEBUG, "--- Hello, %s ---\n", CC->curr_user);
-       }
-
-/* To insert this module into the server activate the next block by changing the #if 0 to #if 1 */
-CTDL_MODULE_INIT(test)
-{
-#if 0
-   CtdlRegisterCleanupHook(CleanupTest);
-   CtdlRegisterSessionHook(NewRoomTest, EVT_NEWROOM);
-   CtdlRegisterSessionHook(SessionStartTest, EVT_START);
-   CtdlRegisterSessionHook(SessionStopTest, EVT_STOP);
-   CtdlRegisterSessionHook(LoginTest, EVT_LOGIN);
-#endif
-
-   /* return our Subversion id for the Log */
-   return "$Id$";
-}