diff --git a/conf.h b/conf.h index 9e93c6a5..b75cc8e0 100755 --- a/conf.h +++ b/conf.h @@ -20,7 +20,7 @@ ** USA ** ** NeoStats CVS Identification -** $Id: conf.h,v 1.3 2003/04/18 06:41:34 fishwaldo Exp $ +** $Id: conf.h,v 1.4 2003/04/30 13:10:48 fishwaldo Exp $ */ @@ -54,13 +54,8 @@ struct config { unsigned int foreground : 1; } config; -#define GetDir(x, y) kp_get_dir(x,y,NULL); - int GetConf(void **data, int type, const char *item); int SetConf(void *data, int type, char *item); - -/* need this to stop modules complaining */ -int kp_get_dir (const char *keypath, char ***keysp, unsigned int *nump); - +int GetDir(char *item, char ***data); #endif diff --git a/dl.c b/dl.c index f76414d9..dd49a904 100644 --- a/dl.c +++ b/dl.c @@ -20,7 +20,7 @@ ** USA ** ** NeoStats CVS Identification -** $Id: dl.c,v 1.53 2003/04/18 06:41:34 fishwaldo Exp $ +** $Id: dl.c,v 1.54 2003/04/30 13:10:49 fishwaldo Exp $ */ #include @@ -161,22 +161,21 @@ int add_socket(char *readfunc, char *writefunc, char *errfunc, char *sock_name, Sock_List *Sockets_mod_list; strcpy(segv_location, "add_Socket"); - if (readfunc) { if (dlsym((int *)get_dl_handle(mod_name), readfunc) == NULL) { - nlog(LOG_WARNING, LOG_CORE, "oh oh, the socket function doesn't exist"); + nlog(LOG_WARNING, LOG_CORE, "oh oh, the Read socket function doesn't exist = %s (%s)", readfunc, mod_name); return -1; } } if (writefunc) { if (dlsym((int *)get_dl_handle(mod_name), writefunc) == NULL) { - nlog(LOG_WARNING, LOG_CORE, "oh oh, the socket function doesn't exist"); + nlog(LOG_WARNING, LOG_CORE, "oh oh, the Write socket function doesn't exist = %s (%s)", writefunc, mod_name); return -1; } } if (errfunc) { if (dlsym((int *)get_dl_handle(mod_name), errfunc) == NULL) { - nlog(LOG_WARNING, LOG_CORE, "oh oh, the socket function doesn't exist"); + nlog(LOG_WARNING, LOG_CORE, "oh oh, the Error socket function doesn't exist = %s (%s)", errfunc, mod_name); return -1; } } diff --git a/keeper.c b/keeper.c index 8069326f..bc2ecbae 100644 --- a/keeper.c +++ b/keeper.c @@ -20,7 +20,7 @@ ** USA ** ** NeoStats CVS Identification -** $Id: keeper.c,v 1.7 2003/04/18 06:41:34 fishwaldo Exp $ +** $Id: keeper.c,v 1.8 2003/04/30 13:10:50 fishwaldo Exp $ */ #include "stats.h" @@ -69,6 +69,30 @@ int GetConf(void **data, int type, const char *item) { return 1; } +/* @brief return a array of strings containing all subkeys in a directory */ + +int GetDir(char *item, char ***data) { + int i; + char keypath[255]; + char **data1; + + /* determine if its a module setting */ + if (strlen(segvinmodule) > 0) { + snprintf(keypath, 255, "g/%s:/%s", segvinmodule, item); + } else { + snprintf(keypath, 255, "g/core:/%s", item); + } + i = kp_get_dir(keypath, &data1, NULL); + if (i == 0) { + *data = data1; + return 1; + } + *data = NULL; + nlog(LOG_DEBUG1, LOG_CORE, "GetDir: %s - Path: %s", kp_strerror(i), keypath); + return -1; + +} + /** @brief Sets Config Data of Type diff --git a/tools/Makefile.in b/tools/Makefile.in index f252b276..8ea11d1a 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -1,6 +1,6 @@ include ../Makefile.inc -INCLUDES = -I.. -I../keeper/ -I../adns/ -DHAVE_CONFIG_H +INCLUDES = -I.. -I../keeper/ -I../adns/ -DHAVE_CONFIG_H -DDST_DIR=@prefix@ KP_SOURCES= kp_exp.c kp_imp.c kptool.c KP_OBJECTS= kp_exp.o kp_imp.o kptool.o