Index: ossp-pkg/fsl/TODO RCS File: /v/ossp/cvs/ossp-pkg/fsl/Attic/TODO,v rcsdiff -q -kk '-r1.4' '-r1.5' -u '/v/ossp/cvs/ossp-pkg/fsl/Attic/TODO,v' 2>/dev/null --- TODO 2002/07/30 09:42:54 1.4 +++ TODO 2002/07/30 11:50:00 1.5 @@ -1,4 +1,3 @@ -- is readfileorallfiles() really reasonable? - allow syslog() without previous openlog()?! - cfg_destroy fixing and use it - runtime version check for sub libraries Index: ossp-pkg/fsl/fsl.c RCS File: /v/ossp/cvs/ossp-pkg/fsl/fsl.c,v rcsdiff -q -kk '-r1.39' '-r1.40' -u '/v/ossp/cvs/ossp-pkg/fsl/fsl.c,v' 2>/dev/null --- fsl.c 2002/07/30 11:37:19 1.39 +++ fsl.c 2002/07/30 11:50:00 1.40 @@ -260,32 +260,6 @@ return rc; } -/* read a single file "fsl.xxx" into buffer */ -static fsl_rc_t readfile(buf_t *buffer, const char *ident) -{ - fsl_rc_t rc; - char *filename = NULL; - - if (ident == NULL || buffer == NULL) - CU(FSL_ERR_ARG); - fsldebug(L2_LEVEL_TRACE, "readfile() ident=\"%s\")", ident); - - if ((filename = (char *)malloc(strlen(FSL_CFGDIR) + 1 + - strlen(FSL_PREFIX) + strlen(ident) + 1)) == NULL) - CU(FSL_ERR_MEM); - filename[0] = '\0'; - strcat(filename, FSL_CFGDIR); - strcat(filename, "/"); - strcat(filename, FSL_PREFIX); - strcat(filename, ident); - - CU(appendfiletobuffer(buffer, filename)); -CUS: - if (filename != NULL) - free(filename); - return rc; -} - /* read all possible files "fsl.*" into buffer */ static fsl_rc_t readallfiles(buf_t *buffer) { @@ -328,25 +302,6 @@ return rc; } -/* read a single or all possible files */ -static fsl_rc_t readfileorallfiles(buf_t *buffer, const char *ident) -{ - fsl_rc_t rv; - - if (ident == NULL) - return FSL_ERR_ARG; - fsldebug(L2_LEVEL_TRACE, "readfileorallfiles() ident=\"%s\")", ident); - - if ((rv = readfile(buffer, ident)) == FSL_OK) - return FSL_OK; - if (rv != FSL_ERR_SYS || errno != ENOENT) - return rv; - fsldebug(L2_LEVEL_TRACE, "readfileorallfiles: specific file does not exist, trying all files from directory"); - if ((rv = readallfiles(buffer)) != FSL_OK) - return rv; - return FSL_OK; -} - /* OSSP cfg node tree traversal function (recursive) */ static void traverse(cfg_t *cfg, cfg_node_t *cfgnode) { @@ -749,8 +704,8 @@ strcat(cpISF, cpFacility); /* read configuration file(s) into buffer */ - if ((rv = readfileorallfiles(&buf, ident)) != FSL_OK) { - fsldebug(L2_LEVEL_ERROR, "openlog: readfileorallfiles() for ident \"%s\" failed. Hint: last system error was \"%s\"(%d)", ident, strerror(errno), errno); CU(1); } + if ((rv = readallfiles(&buf)) != FSL_OK) { + fsldebug(L2_LEVEL_ERROR, "openlog: readallfiles() failed. Hint: last system error was \"%s\"(%d)", strerror(errno), errno); CU(1); } /* import configuration buffer into OSSP cfg node tree */ if ((cfgrv = cfg_create(&cfg)) != CFG_OK) { Index: ossp-pkg/fsl/fsl.pod RCS File: /v/ossp/cvs/ossp-pkg/fsl/fsl.pod,v rcsdiff -q -kk '-r1.15' '-r1.16' -u '/v/ossp/cvs/ossp-pkg/fsl/fsl.pod,v' 2>/dev/null --- fsl.pod 2002/07/30 07:10:54 1.15 +++ fsl.pod 2002/07/30 11:50:00 1.16 @@ -56,16 +56,12 @@ =head1 OPERATION If an application calls openlog(3) it passes an identification string -(I) and a logging facility (I) along. B -tries to read the file "ICI". If the file does not -exist, all files matching "IC" are read. - -In both cases, all data that has been read in is parsed for -configuration sections via B. These are identified by "CIC< >IC<;>" directives. The I argument is an B (Perl-compatible) regular expression that is matched against a -string concatenated from "I/I" given to the openlog(3) -call. +(I) and a logging facility (I) along. B reads all +configuration files matching "IC" and parses them using +B. Sections are identified by "CICIC<;>" +directives. The I argument is an B (Perl-compatible) +regular expression that is matched against a string concatenated from +"I/I" given to the openlog(3) call. The I (single) argument is an B channel tree specification, usually quoted with B flexible quotes (to make