From 62a0c9f2573ff3478d103d67aba9090b67719ee9 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 18 Jul 1999 18:53:40 +0000 Subject: [PATCH] Changes to dynloader et al to handle ICQ module being written --- citadel/ChangeLog | 3 +++ citadel/citserver.c | 4 ++++ citadel/citserver.h | 1 + citadel/dynloader.c | 18 +++++++++++++----- citadel/serv_chat.c | 2 ++ citadel/serv_chat.h | 1 + citadel/server.h | 1 + 7 files changed, 25 insertions(+), 5 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index b563ddaf2..c42b341e9 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,3 +1,6 @@ +Sun Jul 18 14:53:16 EDT 1999 Art Cancro + * Changes to dynloader et al to handle ICQ module being written + 1999-07-17 Nathan Bryant * chkpwd.c: DELETED CVS REVISION 1.3 (backed out Art's last change) use 'cvs update -r 1.2 chkpwd.c; cvs update -A chkpwd.c' NOW to diff --git a/citadel/citserver.c b/citadel/citserver.c index 5543386a9..45d23b95e 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -41,6 +41,7 @@ struct CitContext *ContextList = NULL; int ScheduledShutdown = 0; int do_defrag = 0; +int (*CtdlSendExpressMessageFunc) (char *, char *, char *) = NULL; /* * Various things that need to be initialized at startup @@ -1257,6 +1258,9 @@ void *context_loop(struct CitContext *con) ERROR); } + /* Run any after-each-command outines registered by modules */ + PerformSessionHooks(EVT_CMD); + } while(strncasecmp(cmdbuf, "QUIT", 4)); cleanup(EXIT_NORMAL); diff --git a/citadel/citserver.h b/citadel/citserver.h index 0db931cb8..c19e13e14 100644 --- a/citadel/citserver.h +++ b/citadel/citserver.h @@ -29,3 +29,4 @@ void CtdlAllocUserData(unsigned long requested_sym, size_t num_bytes); int CtdlGetDynamicSymbol(void); extern int do_defrag; +int (*CtdlSendExpressMessageFunc) (char *, char *, char *); diff --git a/citadel/dynloader.c b/citadel/dynloader.c index 1f6dab1cd..92bae4aa8 100644 --- a/citadel/dynloader.c +++ b/citadel/dynloader.c @@ -21,10 +21,12 @@ #include #endif #include +#include #include "dynloader.h" #include "citadel.h" #include "server.h" #include "sysdep_decls.h" +#include "tools.h" #ifndef HAVE_SNPRINTF #include @@ -74,8 +76,9 @@ int DLoader_Exec_Cmd(char *cmdbuf) void DLoader_Init(char *pathname) { void *fcn_handle; - const char *dl_error; + char dl_error[256]; DIR *dir; + int i; struct dirent *dptr; struct DLModule_Info *(*h_init_fcn) (void); struct DLModule_Info *dl_info; @@ -89,6 +92,7 @@ void DLoader_Init(char *pathname) while ((dptr = readdir(dir)) != NULL) { if (dptr->d_name[0] == '.') continue; + lprintf(9, "Attempting to load %s\n", dptr->d_name); snprintf(pathbuf, PATH_MAX, "%s/%s", pathname, dptr->d_name); #ifdef RTLD_NOW @@ -97,8 +101,12 @@ void DLoader_Init(char *pathname) if (!(fcn_handle = dlopen(pathbuf, DL_LAZY))) #endif { - /* dl_error = dlerror(); */ - fprintf(stderr, "DLoader_Init dlopen failed\n"); + safestrncpy(dl_error, dlerror(), sizeof dl_error); + for (i=0; i