* First cut at static-linking the citserver. Ripped out libtool and
authorArt Cancro <ajc@citadel.org>
Wed, 15 Jan 2003 05:57:10 +0000 (05:57 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 15 Jan 2003 05:57:10 +0000 (05:57 +0000)
  replaced the dynloader paradigm with "server extensions" paradigm (static
  linked, but still very loosely coupled by way of using the API's to
  register callbacks and commands etc.)   Needs more testing.

27 files changed:
citadel/ChangeLog
citadel/Makefile.in
citadel/bootstrap
citadel/configure.ac
citadel/dynloader.c
citadel/dynloader.h
citadel/serv_bio.c
citadel/serv_calendar.c
citadel/serv_chat.c
citadel/serv_expire.c
citadel/serv_imap.c
citadel/serv_inetcfg.c
citadel/serv_listsub.c
citadel/serv_mrtg.c
citadel/serv_netfilter.c
citadel/serv_network.c
citadel/serv_newuser.c
citadel/serv_pas2.c
citadel/serv_pop3.c
citadel/serv_rwho.c
citadel/serv_smtp.c
citadel/serv_spam.c
citadel/serv_test.c
citadel/serv_upgrade.c
citadel/serv_vandelay.c
citadel/serv_vcard.c
citadel/server_main.c

index 9c40d6dee4b0d169946dc0001db59fa863bdbbc7..962c54bf86b105feee192de7e6ba5a2a1488c7ae 100644 (file)
@@ -1,4 +1,10 @@
  $Log$
+ Revision 601.109  2003/01/15 05:57:09  ajc
+ * First cut at static-linking the citserver.  Ripped out libtool and
+   replaced the dynloader paradigm with "server extensions" paradigm (static
+   linked, but still very loosely coupled by way of using the API's to
+   register callbacks and commands etc.)   Needs more testing.
+
  Revision 601.108  2003/01/14 04:12:26  ajc
  * Set default view for new user Calendar> rooms to 3 (calendar)
  * Set default view for new user Tasks> rooms to 4 (tasks)
@@ -4371,3 +4377,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index 67142180f4df65e33aa0c42f20960c192b356be0..1648bf18b19e8a914a79c4cf588a7ccc40628b63 100644 (file)
@@ -17,32 +17,35 @@ CHKPWD=@CHKPWD@
 
 all: $(TARGETS)
 
-.SUFFIXES: .lo .d .c
+.SUFFIXES: .o .d .c
 
 EXEEXT=@EXEEXT@
 
 SMTP=@SMTP@
 
 CLIENT_TARGETS=citadel$(EXEEXT) whobbs$(EXEEXT)
-SERVER_TARGETS=libcitserver.la citserver setup $(CHKPWD)
-SERV_MODULES=modules/libchat.la modules/libvcard.la \
-       modules/libupgrade.la \
+SERVER_TARGETS=citserver setup $(CHKPWD)
+SERV_MODULES=serv_chat.o \
+       serv_upgrade.o \
        $(SMTP) \
-       modules/libpop3.la \
-       modules/libmrtg.la \
-       modules/libspam.la \
-       modules/libimap.la \
-       modules/libnetwork.la \
-       modules/liblistsub.la \
-       modules/libnetfilter.la \
-       modules/libnewuser.la \
-       modules/libpas2.la \
-       modules/libinetcfg.la \
-       modules/librwho.la \
-       modules/libbio.la \
-       modules/libexpire.la \
-       modules/libvandelay.la \
-       modules/libcalendar.la
+       serv_pop3.o \
+       serv_vcard.o vcard.o \
+       serv_mrtg.o \
+       serv_spam.o \
+       serv_imap.o imap_fetch.o imap_misc.o imap_search.o \
+               imap_store.o imap_tools.o \
+       serv_network.o \
+       serv_listsub.o \
+       serv_netfilter.o \
+       serv_newuser.o \
+       serv_pas2.o md5.o \
+       serv_inetcfg.o \
+       serv_rwho.o \
+       serv_bio.o \
+       serv_expire.o \
+       serv_vandelay.o \
+       serv_calendar.o ical_dezonify.o
+
 UTIL_TARGETS=aidepost msgform readlog \
        stats citmail userlist sendcommand \
        base64 migratenet$(EXEEXT)
@@ -68,9 +71,6 @@ ACLOCAL=@ACLOCAL@
 YACC=@YACC@
 DATABASE=@DATABASE@
 
-LIBTOOL=./libtool
-LTSHARE=cd modules && ../$(LIBTOOL) $(CC) -rpath $(prefix)/modules -no-undefined -avoid-version -module
-
 # End configuration section
 
 VPATH=$(srcdir)
@@ -99,17 +99,10 @@ DEP_FILES=$(SOURCES:.c=.d)
 
 client: $(CLIENT_TARGETS)
 
-server: $(SERVER_TARGETS)
+server: $(SERVER_TARGETS) $(SERV_MODULES)
 
 utils: $(UTIL_TARGETS)
 
-serv_modules: $(SERV_MODULES)
-       @cd modules && mods=`echo .libs/*.s[ol]` && test "$$mods" != '.libs/*.s[ol]' && ln -sf $$mods . || true
-       @cd modules && mods=`echo .libs/*.dll` && test "$$mods" != '.libs/*.dll' && ln -sf $$mods . || true
-
-#
-#
-
 citadel$(EXEEXT): citadel.o citadel_ipc.o client_chat.o client_passwords.o \
        commands.o html.o ipc_c_tcp.o md5.o messages.o rooms.o routines.o \
        routines2.o screen.o tools.o $(LIBOBJS)
@@ -125,101 +118,26 @@ citadel$(EXEEXT): citadel.o citadel_ipc.o client_chat.o client_passwords.o \
 #
 #
 
-SERV_OBJS = server_main.o
-
 parsedate.o: parsedate.c
 
-LIBSERV_OBJS = user_ops.lo citserver.lo sysdep.lo dynloader.lo \
-       tools.lo $(DATABASE:.c=.lo) $(DOMAIN:.c=.lo) \
-       control.lo policy.lo config.lo support.lo room_ops.lo \
-       file_ops.lo msgbase.lo \
-       locate_host.lo housekeeping.lo logging.lo mime_parser.lo html.lo \
-       internet_addressing.lo \
-       serv_crypto.lo parsedate.lo genstamp.lo \
-       clientsocket.lo $(AUTH) $(LIBOBJS:.o=.lo)
+SERV_OBJS = server_main.o \
+       user_ops.o citserver.o sysdep.o dynloader.o \
+       tools.o $(DATABASE:.c=.o) $(DOMAIN:.c=.o) \
+       control.o policy.o config.o support.o room_ops.o \
+       file_ops.o msgbase.o \
+       locate_host.o housekeeping.o logging.o mime_parser.o html.o \
+       internet_addressing.o \
+       serv_crypto.o parsedate.o genstamp.o \
+       clientsocket.o $(AUTH) $(SERV_MODULES)
 
-libcitserver.la: $(LIBSERV_OBJS)
-       $(LIBTOOL) $(CC) $(LDFLAGS) -rpath $(prefix) -no-undefined \
-       -o libcitserver.la $(LIBSERV_OBJS) $(LIBS) $(RESOLV)
-
-citserver: $(SERV_OBJS) $(LIBTOOL) libcitserver.la
-       $(LIBTOOL) --mode=link $(CC) $(SERV_OBJS) $(LDFLAGS) libcitserver.la -o \
-       citserver $(LIBS)
+citserver: $(SERV_OBJS)
+       $(CC) $(SERV_OBJS) $(LDFLAGS) $(LIBS) $(RESOLV) -o citserver
 
 .c.o:
        $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c $< -o $@
 
-.c.lo: $(LIBTOOL)
-       @test -d modules || mkdir -p modules
-       $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c $< -o $@
-
-modules/libchat.la: serv_chat.lo libcitserver.la $(LIBTOOL)
-       $(LTSHARE) -o libchat.la ../serv_chat.lo ../libcitserver.la
-
-modules/libtest.la: serv_test.lo libcitserver.la $(LIBTOOL)
-       $(LTSHARE) -o libtest.la ../serv_test.lo ../libcitserver.la
-
-modules/libpop3.la: serv_pop3.lo md5.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libpop3.la ../serv_pop3.lo ../md5.lo ../libcitserver.la
-
-modules/libmrtg.la: serv_mrtg.lo md5.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libmrtg.la ../serv_mrtg.lo ../libcitserver.la
-
-modules/libspam.la: serv_spam.lo md5.lo domain.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libspam.la ../serv_spam.lo ../domain.lo ../libcitserver.la
-
-modules/libinetcfg.la: serv_inetcfg.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libinetcfg.la ../serv_inetcfg.lo ../libcitserver.la
-
-modules/librwho.la: serv_rwho.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o librwho.la ../serv_rwho.lo ../libcitserver.la
-
-modules/libbio.la: serv_bio.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libbio.la ../serv_bio.lo ../libcitserver.la
-
-modules/libexpire.la: serv_expire.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libexpire.la ../serv_expire.lo ../libcitserver.la
-
-modules/libvandelay.la: serv_vandelay.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libvandelay.la ../serv_vandelay.lo ../libcitserver.la
-
-modules/libnetwork.la: serv_network.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libnetwork.la ../serv_network.lo ../libcitserver.la
-
-modules/liblistsub.la: serv_listsub.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o liblistsub.la ../serv_listsub.lo ../libcitserver.la
-
-modules/libnetfilter.la: serv_netfilter.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libnetfilter.la ../serv_netfilter.lo ../libcitserver.la
-
-modules/libnewuser.la: serv_newuser.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libnewuser.la ../serv_newuser.lo ../libcitserver.la
-
-modules/libupgrade.la: serv_upgrade.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libupgrade.la ../serv_upgrade.lo ../libcitserver.la
-
-modules/libvcard.la: serv_vcard.lo vcard.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libvcard.la ../serv_vcard.lo ../vcard.lo ../libcitserver.la
-
-modules/libsmtp.la: serv_smtp.lo domain.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libsmtp.la ../serv_smtp.lo ../domain.lo ../libcitserver.la
-
-
-modules/libimap.la: serv_imap.lo imap_tools.lo imap_fetch.lo \
-       imap_search.lo imap_store.lo imap_misc.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libimap.la ../imap_tools.lo ../serv_imap.lo \
-               ../imap_fetch.lo ../imap_search.lo ../imap_store.lo ../imap_misc.lo ../libcitserver.la
-
-aidepost: aidepost.o libcitserver.la $(LIBOBJS)
-       $(LIBTOOL) $(CC) aidepost.o libcitserver.la $(LIBOBJS) $(LDFLAGS) -o aidepost $(LIBS)
-
-modules/libpas2.la: serv_pas2.lo md5.lo $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libpas2.la ../serv_pas2.lo ../md5.lo ../libcitserver.la
-
-modules/libcalendar.la: serv_calendar.lo ical_dezonify.lo \
-       $(LIBTOOL) libcitserver.la
-       $(LTSHARE) -o libcalendar.la ../serv_calendar.lo ../ical_dezonify.lo \
-       ../libcitserver.la
+aidepost: aidepost.o config.o
+       $(CC) aidepost.o config.o $(LDFLAGS) -o aidepost $(LIBS)
 
 citmail: citmail.o config.o
        $(CC) citmail.o config.o $(LDFLAGS) -o citmail $(LIBS)
@@ -233,11 +151,11 @@ chkpwd: chkpwd.o auth.o config.o
 whobbs$(EXEEXT): whobbs.o ipc_c_tcp.o tools.o citadel_ipc.o $(LIBOBJS)
        $(CC) whobbs.o ipc_c_tcp.o tools.o citadel_ipc.o  $(LIBOBJS) $(LDFLAGS) -o whobbs $(LIBS)
 
-migratenet$(EXEEXT): migratenet.o config.o ipc_c_tcp.o citadel_ipc.o tools.o libcitserver.la $(LIBOBJS)
-       $(LIBTOOL) $(CC) migratenet.o config.o ipc_c_tcp.o citadel_ipc.o tools.o libcitserver.la $(LIBOBJS) $(LDFLAGS) -o migratenet $(LIBS)
+migratenet$(EXEEXT): migratenet.o config.o ipc_c_tcp.o citadel_ipc.o tools.o $(LIBOBJS)
+       $(CC) migratenet.o config.o ipc_c_tcp.o citadel_ipc.o tools.o $(LIBOBJS) $(LDFLAGS) -o migratenet $(LIBS)
 
-sendcommand: sendcommand.o ipc_c_tcp.o citadel_ipc.o libcitserver.la $(LIBOBJS)
-       $(LIBTOOL) $(CC) sendcommand.o ipc_c_tcp.o citadel_ipc.o libcitserver.la \
+sendcommand: sendcommand.o ipc_c_tcp.o citadel_ipc.o tools.o config.o $(LIBOBJS)
+       $(CC) sendcommand.o ipc_c_tcp.o citadel_ipc.o tools.o config.o \
         $(LIBOBJS) $(LDFLAGS) -o sendcommand $(LIBS)
 
 base64: base64.o
@@ -253,8 +171,8 @@ msgform: msgform.o
 readlog: readlog.o config.o
        $(CC) readlog.o config.o $(LDFLAGS) -o readlog
 
-stats: stats.o ipc_c_tcp.o citadel_ipc.o libcitserver.la $(LIBOBJS)
-       $(LIBTOOL) $(CC) stats.o ipc_c_tcp.o citadel_ipc.o libcitserver.la $(LIBOBJS) $(LDFLAGS) -o stats $(LIBS)
+stats: stats.o ipc_c_tcp.o citadel_ipc.o tools.o config.o
+       $(CC) stats.o ipc_c_tcp.o citadel_ipc.o tools.o config.o $(LDFLAGS) -o stats $(LIBS)
 
 .PHONY: install-data install-doc install-exec clean cleaner distclean
 
@@ -283,18 +201,13 @@ install-doc:
        done
 
 install-exec: all weekly
-       @for i in bio bitbucket files images info modules userpics; do \
+       @for i in bio bitbucket files images info userpics; do \
                $(srcdir)/mkinstalldirs $(root)$(prefix)/$$i; \
        done
        @for i in $(CLIENT_TARGETS) $(SERVER_TARGETS) $(UTIL_TARGETS); do \
                if test -f $$i; then \
-                       echo $(LIBTOOL) --mode=install $(INSTALL) $$i $(root)$(prefix)/$$i; \
-                       $(LIBTOOL) --mode=install $(INSTALL) $$i $(root)$(prefix)/$$i; \
-               fi \
-       done
-       @for i in $(SERV_MODULES) ; do \
-               if test -f $$i; then \
-                       (cd modules && ../$(LIBTOOL) --mode=install $(INSTALL) `basename $$i` $(root)$(prefix)/$$i) ; \
+                       echo $(INSTALL) $$i $(root)$(prefix)/$$i; \
+                       $(INSTALL) $$i $(root)$(prefix)/$$i; \
                fi \
        done
        @for i in utilsmenu weekly ; do \
@@ -309,19 +222,18 @@ install-exec: all weekly
        fi
 
 clean:
-       rm -f *.o *.lo parsedate.c
+       rm -f *.o parsedate.c
 
 cleaner: clean
-       rm -rf $(CLIENT_TARGETS) $(SERVER_TARGETS) $(UTIL_TARGETS) \
-               modules/*.la modules/.libs so_locations
+       rm -rf $(CLIENT_TARGETS) $(SERVER_TARGETS) $(UTIL_TARGETS) *.la
 
 distclean: cleaner
        find . -name '*~' -o -name '.#*' | xargs rm -f
-       rm -f Makefile sysdep.h config.cache config.log config.status *.d weekly
+       rm -f Makefile sysdep.h config.cache config/.og config.status *.d weekly
 
 .c.d:
        @echo Checking dependencies for $<
-       @$(CC) -M $(CPPFLAGS) $< | sed -e 's!$*.o!$*.o $*.lo $@!' > $@
+       @$(CC) -M $(CPPFLAGS) $< | sed -e 's!$*.o!$*.o $*/.o $@!' > $@
        @test -s $@ || rm -f $@
 
 Makefile: $(srcdir)/Makefile.in config.status
@@ -339,8 +251,4 @@ $(srcdir)/aclocal.m4: $(srcdir)/acinclude.m4
 weekly: $(srcdir)/weekly.in config.status
        CONFIG_FILES=weekly CONFIG_HEADERS= $(SHELL) ./config.status
 
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-$(LIBTOOL): $(LIBTOOL_DEPS)
-       $(SHELL) ./config.status --recheck
-
 -include $(DEP_FILES)
index 4511cb5f4e983869a3240ba216fa5f40b128e091..c6910888fbd1de7d740bb5e7359e9e398f70dd5b 100755 (executable)
@@ -31,21 +31,16 @@ fi
 
 echo ... running aclocal ...
 $aclocal
-echo ... running libtoolize ...
-libtoolize -c --force
 echo ... running autoconf ...
 $autoconf
 echo ... running autoheader ...
 $autoheader
 
 echo
-echo This script has been tested with autoconf 2.53, libtool 1.4d, and
+echo This script has been tested with autoconf 2.53 and
 echo automake 1.5. Other versions may work, but I recommend the latest
 echo compatible versions of these.
 echo
-echo libtool 1.4.2 is not sufficient to build portable configure scripts;
-echo at least version 1.4d from alpha.gnu.org is needed.
-echo
-echo Also note that autoconf, automake, and libtool should all be configured
+echo Also note that autoconf and automake should be configured
 echo with the same prefix.
 echo
index 1a061cb96dc540dd600a70d7d8b800c94edf799c..d32210b540e988f7b141162fa28da073c09e9613 100644 (file)
@@ -120,11 +120,7 @@ if test "$GCC" = yes; then
                ;;
        esac
 fi
-AC_LIBTOOL_DLOPEN
-AC_LIBTOOL_WIN32_DLL
 AC_DISABLE_STATIC
-AC_PROG_LIBTOOL
-AC_SUBST(LIBTOOL_DEPS)
 AC_PROG_INSTALL
 AC_PROG_YACC
 missing_dir=`cd $ac_aux_dir && pwd`
@@ -145,7 +141,7 @@ dnl Checks for libraries.
 dnl We want to test for the following in libc before checking for their
 dnl respective libraries, because some systems (like Irix) have both, and the
 dnl non-libc versions may be broken.
-AC_CHECK_FUNCS(crypt dlopen gethostbyname connect)
+AC_CHECK_FUNCS(crypt gethostbyname connect)
 
 if test "$ac_cv_func_gethostbyname" = no; then
        AC_CHECK_LIB(nsl, gethostbyname)
@@ -155,14 +151,6 @@ if test "$ac_cv_func_connect" = no; then
         AC_CHECK_LIB(socket, connect)
 fi
 
-if test "$ac_cv_func_dlopen" = no; then
-        AC_CHECK_LIB(dl, dlopen, [LIBS="-ldl $LIBS"
-               test "$with_pam" = yes && chkpwd_LIBS="-ldl $chkpwd_LIBS"])
-fi
-
-dnl Check for HP/UX dynamic loader. This should only be in -ldld.
-AC_CHECK_LIB(dld, shl_load, LIBS="-ldld $LIBS")
-
 dnl Check for Solaris realtime support
 AC_CHECK_LIB(rt, sched_yield)
 
@@ -446,7 +434,7 @@ if test "x$with_ncurses" != xno; then
        AC_CHECK_HEADERS(ncurses.h,,,[ ])
 fi
 
-AC_CHECK_HEADER(resolv.h, [SMTP=modules/libsmtp.la; DOMAIN=domain.c],,
+AC_CHECK_HEADER(resolv.h, [SMTP=serv_smtp.o; DOMAIN=domain.c],,
 [#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
@@ -526,7 +514,7 @@ AC_CACHE_CHECK([for pthread_create], ac_cv_func_pthread_create,
 #endif],
 ac_cv_func_pthread_create=yes, ac_cv_func_pthread_create=no)])
 if test "$ac_cv_func_pthread_create" = yes; then
-       test "$DATABASE" && TARGETS="client server utils serv_modules"
+       test "$DATABASE" && TARGETS="client server utils"
        if test "x$enable_threaded_client" != xno; then
                AC_DEFINE(THREADED_CLIENT)
        fi
index fbec1b316884f7aa0371b79944f8a5c975454c82..07295ba52d8f49d7ee82f8b3192231e719f3e0d8 100644 (file)
@@ -6,21 +6,10 @@
  *
  */
 
-#ifdef DLL_EXPORT
-#define IN_LIBCIT
-#endif
-
 #include "sysdep.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#ifdef HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-#ifdef HAVE_DL_H
-#include <dl.h>
-#include "hpsux.h"
-#endif
 #include <sys/types.h>
 #include <dirent.h>
 #include <string.h>
@@ -112,64 +101,28 @@ int DLoader_Exec_Cmd(char *cmdbuf)
        return 0;
 }
 
-void DLoader_Init(char *pathname)
+void initialize_server_extensions(void)
 {
-       void *fcn_handle;
-       char dl_error[SIZ];
-       DIR *dir;
-       int i;
-       struct dirent *dptr;
-       char *(*h_init_fcn) (void);
-       char *dl_info;
-
-       char pathbuf[PATH_MAX];
-
-       if ((dir = opendir(pathname)) == NULL) {
-               perror("opendir");
-               exit(1);
-       }
-       while ((dptr = readdir(dir)) != NULL) {
-               if (strlen(dptr->d_name) < 4)
-                       continue;
-#ifndef __CYGWIN__
-               if (strcasecmp(&dptr->d_name[strlen(dptr->d_name)-3], ".so"))
-#else
-               if (strcasecmp(&dptr->d_name[strlen(dptr->d_name)-4], ".dll"))
-#endif
-                       continue;
-
-               snprintf(pathbuf, PATH_MAX, "%s/%s", pathname, dptr->d_name);
-               lprintf(7, "Initializing %s...\n", pathbuf);
-
-#ifdef RTLD_LAZY
-               if (!(fcn_handle = dlopen(pathbuf, RTLD_LAZY)))
-#else                          /* OpenBSD */
-               if (!(fcn_handle = dlopen(pathbuf, DL_LAZY)))
-#endif
-               {
-                       safestrncpy(dl_error, dlerror(), sizeof dl_error);
-                       for (i=0; i<strlen(dl_error); ++i)
-                               if (!isprint(dl_error[i]))
-                                       dl_error[i]='.';
-                       fprintf(stderr, "DLoader_Init dlopen failed: %s\n",
-                               dl_error);
-                       continue;
-               }
-               h_init_fcn = (char * (*)(void))
-#if defined(__OpenBSD__) || defined(__APPLE__)
-                   dlsym(fcn_handle, "_Dynamic_Module_Init");
-#else
-                   dlsym(fcn_handle, "Dynamic_Module_Init");
-#endif
-
-               if (dlerror() != NULL) {
-                       fprintf(stderr, "DLoader_Init dlsym failed\n");
-                       continue;
-               }
-               dl_info = h_init_fcn();
-
-               lprintf(3, "Loaded module: %s\n", dl_info);
-       }       /* While */
+       serv_bio_init();
+       serv_calendar_init();
+       serv_inithat_init();
+       serv_expire_init();
+       serv_imap_init();
+       serv_inetcfg_init();
+       serv_listsub_init();
+       serv_mrtg_init();
+       serv_netfilter_init();
+       serv_network_init();
+       serv_newuser_init();
+       serv_pas2_init();
+       serv_pop3_init();
+       serv_rwho_init();
+       serv_smtp_init();
+       serv_spam_init();
+       /* serv_test_init(); */
+       serv_upgrade_init();
+       serv_vandelay_init();
+       serv_vcard_init();
 }
 
 
index b8491e1caba9083512c1b9e90274ab23e1c64389..69b26bfe79b0806dd97d9d2fc111445f2bf9d38e 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "server.h"
 
-void DLoader_Init(char *pathname);
+void initialize_server_extensions(void);
 int DLoader_Exec_Cmd(char *cmdbuf);
 char *Dynamic_Module_Init(void);
 
index b8f812a3c561b32b384bfb0d307f451571986580..66b79c9aa44e0281191e71475b79fc880c428e5d 100644 (file)
@@ -127,7 +127,7 @@ void cmd_lbio(char *cmdbuf) {
 
 
 
-char *Dynamic_Module_Init(void)
+char *serv_bio_init(void)
 {
         CtdlRegisterProtoHook(cmd_ebio, "EBIO", "Enter your bio");
         CtdlRegisterProtoHook(cmd_rbio, "RBIO", "Read a user's bio");
index 0331dde22c479aded531f9ca1eaf27b3d1c09685..b274481f8ac305d88acabece570f518e4fdfad5e 100644 (file)
@@ -1446,7 +1446,7 @@ void ical_session_startup(void) {
 /*
  * Register this module with the Citadel server.
  */
-char *Dynamic_Module_Init(void)
+char *serv_calendar_init(void)
 {
 #ifdef CITADEL_WITH_CALENDAR_SERVICE
        CtdlRegisterMessageHook(ical_obj_beforesave, EVT_BEFORESAVE);
index d8cbc80a64723eac9ec5f751cb6d1fbc2a65ac2a..fcb724f1cdc11ebd500f5565153cce70b9da7504 100644 (file)
@@ -750,7 +750,7 @@ void cmd_reqt(char *argbuf) {
 
 
 
-char *Dynamic_Module_Init(void)
+char *serv_inithat_init(void)
 {
        CtdlRegisterProtoHook(cmd_chat, "CHAT", "Begin real-time chat");
        CtdlRegisterProtoHook(cmd_pexp, "PEXP", "Poll for express messages");
index 31f9a73fb4a2218ac37b9181c909b5598065cd91..c3a22eb47947f636a34fb4478987479675b11583 100644 (file)
@@ -724,7 +724,7 @@ void cmd_fsck(char *argbuf) {
 
 /*****************************************************************************/
 
-char *Dynamic_Module_Init(void)
+char *serv_expire_init(void)
 {
        CtdlRegisterProtoHook(cmd_expi, "EXPI", "Expire old system objects");
        CtdlRegisterProtoHook(cmd_fsck, "FSCK", "Check message ref counts");
index 67b8ca16705428a128a7b2950fc58c49f59615a0..11c6063e6c1e49a39e9e00dee574f3eac307e460 100644 (file)
@@ -1231,7 +1231,7 @@ void imap_command_loop(void) {
  * This function is called by dynloader.c to register the IMAP module
  * with the Citadel server.
  */
-char *Dynamic_Module_Init(void)
+char *serv_imap_init(void)
 {
        SYM_IMAP = CtdlGetDynamicSymbol();
        CtdlRegisterServiceHook(config.c_imap_port,
index 73fddcb0dd487102b13a05791bf4755c143b52f8..90cb8273e93d2183e2fc09d02bf5c98b1516fc79 100644 (file)
@@ -187,7 +187,7 @@ void inetcfg_init(void) {
 /*****************************************************************************/
 
 
-char *Dynamic_Module_Init(void)
+char *serv_inetcfg_init(void)
 {
        CtdlRegisterMessageHook(inetcfg_aftersave, EVT_AFTERSAVE);
        inetcfg_init();
index 31265508845feb775c49fd2128c2d27fb28d7977..bba19f284c806ebfb2fb88413ae5c84f9bab3225 100644 (file)
@@ -506,7 +506,7 @@ void cmd_subs(char *cmdbuf) {
 /*
  * Module entry point
  */
-char *Dynamic_Module_Init(void)
+char *serv_listsub_init(void)
 {
        CtdlRegisterProtoHook(cmd_subs, "SUBS", "List subscribe/unsubscribe");
        return "$Id$";
index d24de4a22dc51f6ddcc19cf7122e099b8172ba42..433039d824ec3b347c51ef124a01ece2667d31b5 100644 (file)
@@ -127,7 +127,7 @@ void cmd_mrtg(char *argbuf) {
 }
 
 
-char *Dynamic_Module_Init(void)
+char *serv_mrtg_init(void)
 {
         CtdlRegisterProtoHook(cmd_mrtg, "MRTG", "Supply stats to MRTG");
         return "$Id$";
index 5aeda1b690ab3671c290f0548f492e3322503dc5..5a3703c13c4fd2975cc4e202bfd68b9d19477be7 100644 (file)
@@ -103,7 +103,7 @@ int filter_the_idiots(struct CtdlMessage *msg, char *target_room) {
 }
 
 
-char *Dynamic_Module_Init(void)
+char *serv_netfilter_init(void)
 {
        CtdlRegisterNetprocHook(filter_the_idiots);
        return "$Id$";
index 5694055b8e16f386f7f847495e7e7cabbd4c3a4c..cd906ca87c36daf37d2f67a7292044c6e19619e4 100644 (file)
@@ -1573,7 +1573,7 @@ void cmd_netp(char *cmdbuf)
 /*
  * Module entry point
  */
-char *Dynamic_Module_Init(void)
+char *serv_network_init(void)
 {
        CtdlRegisterProtoHook(cmd_gnet, "GNET", "Get network config");
        CtdlRegisterProtoHook(cmd_snet, "SNET", "Set network config");
index b2f27eae6f40179253a417f6107b4f3ce825144e..b0bb189ce042ff94c20f1e16784cc53f10e67891 100644 (file)
@@ -94,7 +94,7 @@ void CopyNewUserGreetings(void) {
 }
 
 
-char *Dynamic_Module_Init(void)
+char *serv_newuser_init(void)
 {
    CtdlRegisterSessionHook(CopyNewUserGreetings, EVT_LOGIN);
    return "$Id$";
index f1b1dbf1e8e3b57535c2b61ec14aae7ec41d00b3..9c22c86f40d91058ea73ebaf13eacb91e81f9da0 100644 (file)
@@ -85,7 +85,7 @@ void cmd_pas2(char *argbuf)
 
 
 
-char *Dynamic_Module_Init(void)
+char *serv_pas2_init(void)
 {
         CtdlRegisterProtoHook(cmd_pas2, "PAS2", "APOP-based login");
         return "$Id$";
index 68e60d95da886f6548270453d211a2a46c9b83a5..ee93d03b9611e36969466a79b78ae4a2d44009df 100644 (file)
@@ -616,7 +616,7 @@ void pop3_command_loop(void) {
 
 
 
-char *Dynamic_Module_Init(void)
+char *serv_pop3_init(void)
 {
        SYM_POP3 = CtdlGetDynamicSymbol();
        CtdlRegisterServiceHook(config.c_pop3_port,
index cc38343e0c9b771cc155953bbf53a68e7099f12c..2120e970ecdd496fd22586a16a45420d2ecfac1d 100644 (file)
@@ -253,7 +253,7 @@ void cmd_stel(char *cmdbuf)
 
 
 
-char *Dynamic_Module_Init(void)
+char *serv_rwho_init(void)
 {
         CtdlRegisterProtoHook(cmd_rwho, "RWHO", "Display who is online");
         CtdlRegisterProtoHook(cmd_hchg, "HCHG", "Masquerade hostname");
index 3d9dc248cdefb755ab862f53f0a5bb180dcbe078..6fdac85dceffc5f4a877aa8a87d40e7da1055003 100644 (file)
@@ -1393,7 +1393,7 @@ void smtp_init_spoolout(void) {
 /*****************************************************************************/
 
 
-char *Dynamic_Module_Init(void)
+char *serv_smtp_init(void)
 {
        SYM_SMTP = CtdlGetDynamicSymbol();
 
index ff548b2ccf6fae3ea6146b8a1b3859cad3bb1892..7efef8a90e08243aae19fc8ef67e9c5c37664a24 100644 (file)
@@ -177,7 +177,7 @@ bail:       close(sock);
 
 
 
-char *Dynamic_Module_Init(void)
+char *serv_spam_init(void)
 {
 
 /* (disabled built-in scanner, see above)
index 8c2bb19172b01bdef064436b49aae4200a386542..26b2373804e509a7ac781901cadcad9623f05c82 100644 (file)
@@ -78,7 +78,7 @@ void LogTest(char *buf) {
        }
 
 
-char *Dynamic_Module_Init(void)
+char *serv_test_init(void)
 {
    CtdlRegisterCleanupHook(CleanupTest);
    CtdlRegisterSessionHook(NewRoomTest, EVT_NEWROOM);
index 0f2686da319796281565920e51b82f2a872d963a..b620e0417971bf18293dda874e7334f9562ab9a4 100644 (file)
@@ -221,7 +221,7 @@ void check_server_upgrades(void) {
 
 
 
-char *Dynamic_Module_Init(void)
+char *serv_upgrade_init(void)
 {
        check_server_upgrades();
        return "$Id$";
index 41c6e5e1473e90d73b1b5bfc82898e9ef8d2113c..056b65500d4c7a6e9a03b26d48a5919717dce895 100644 (file)
@@ -574,7 +574,7 @@ void cmd_artv(char *cmdbuf) {
 
 
 
-char *Dynamic_Module_Init(void)
+char *serv_vandelay_init(void)
 {
        CtdlRegisterProtoHook(cmd_artv, "ARTV", "import/export data store");
        return "$Id$";
index 4c30c1fbf01303b789176936fdf68fb481fcae9b..d03bef4b1bbcb18e64d5fc35ddab1ea2d4c0e268 100644 (file)
@@ -771,7 +771,7 @@ void vcard_session_login_hook(void) {
 
 
 
-char *Dynamic_Module_Init(void)
+char *serv_vcard_init(void)
 {
        SYM_VCARD = CtdlGetDynamicSymbol();
        CtdlRegisterSessionHook(vcard_session_startup_hook, EVT_START);
index fb7100cfa155cfe7b99e49e850378a1a021535ff..ad353e2383fa61ff04e669a282ecb2b9fe44b0ca 100644 (file)
@@ -68,7 +68,6 @@ int main(int argc, char **argv)
        int a, i;                       /* General-purpose variables */
        struct passwd *pw;
        int drop_root_perms = 1;
-       char *moddir;
        struct worker_node *wnp;
        size_t size;
         
@@ -168,15 +167,11 @@ int main(int argc, char **argv)
                                do_command_loop);
 
        /*
-        * Load any server-side modules (plugins) available here.
+        * Load any server-side extensions available here.
         */
-       lprintf(7, "Initializing loadable modules\n");
+       lprintf(7, "Initializing server extensions\n");
        size = strlen(bbs_home_directory) + 9;
-       if ((moddir = mallok(size)) != NULL) {
-               snprintf(moddir, size, "%s/modules", bbs_home_directory);
-               DLoader_Init(moddir);
-               free(moddir);
-       }
+       initialize_server_extensions();
 
        /*
         * The rescan pipe exists so that worker threads can be woken up and