Index: ossp-pkg/rc/Makefile.in RCS File: /v/ossp/cvs/ossp-pkg/rc/Makefile.in,v rcsdiff -q -kk '-r1.18' '-r1.19' -u '/v/ossp/cvs/ossp-pkg/rc/Makefile.in,v' 2>/dev/null --- Makefile.in 2002/04/08 15:37:09 1.18 +++ Makefile.in 2002/04/09 17:01:54 1.19 @@ -60,10 +60,10 @@ TARGET_MANS = rc.1 rc-sample.5 SRCS = rc.c rc_config.c rc_optimpl.c rc_option.c\ - rc_version.c rc_pcre.c rc_util.c + rc_cliopt.c rc_version.c rc_pcre.c rc_util.c OBJS = rc.o rc_config.o rc_optimpl.o rc_option.o\ - rc_version.o rc_pcre.o rc_util.o + rc_cliopt.o rc_version.o rc_pcre.o rc_util.o SUBDIRS = @SUBDIR_EX@ @SUBDIR_POPT@ #SUBDIRS = @SUBDIR_EX@ @SUBDIR_VAR@ @SUBDIR_VAL@ @SUBDIR_STR@ @SUBDIR_POPT@ Index: ossp-pkg/rc/rc.h RCS File: /v/ossp/cvs/ossp-pkg/rc/rc.h,v rcsdiff -q -kk '-r1.14' '-r1.15' -u '/v/ossp/cvs/ossp-pkg/rc/rc.h,v' 2>/dev/null --- rc.h 2002/03/26 17:11:06 1.14 +++ rc.h 2002/04/09 17:01:54 1.15 @@ -79,6 +79,13 @@ /* Config accessor prototypes */ short configGetvers(void); +/* Command line function prototypes */ +rc_return_t clioptConstruct(void); +rc_return_t clioptDestruct(void); + +/* Command line accessor prototypes */ +short clioptGetvers(void); + /* Utility (nonbounded) function prototypes */ char *strErr(rc_return_t); Index: ossp-pkg/rc/rc_config.c RCS File: /v/ossp/cvs/ossp-pkg/rc/rc_config.c,v rcsdiff -q -kk '-r1.7' '-r1.8' -u '/v/ossp/cvs/ossp-pkg/rc/rc_config.c,v' 2>/dev/null --- rc_config.c 2002/04/08 15:37:10 1.7 +++ rc_config.c 2002/04/09 17:01:54 1.8 @@ -33,9 +33,10 @@ #include "rc.h" #include "rc_private.h" #include "rc_const.h" /* String constants */ +#include "rc_config.h" /* Config types and constants */ #include "rc_option.h" /* Option operations rely on popt */ -static rc_config_t *s_pInst = NULL; /* Singleton configuration instance */ +static rc_config_t *s_pInst = NULL; /* Singleton config instance */ /*************************************** @@ -46,20 +47,20 @@ { ex_t Except; - if (s_pInst == NULL) { /* If we don't have one */ - s_pInst = malloc(sizeof(s_pInst)); /* yet, then allocate */ - if (!s_pInst) /* a configuration */ - return(RC_THROW(RC_ERR_MEM)); /* instance */ - s_pInst->nLocks = 0; + if (s_pInst == NULL) { /* If we don't have one */ + s_pInst = malloc(sizeof(s_pInst)); /* yet, then allocate */ + if (!s_pInst) /* a config instance */ + return(RC_THROW(RC_ERR_MEM)); + s_pInst->m_nLocks = 0; ex_try { - /* Make a config instance */ + clioptConstruct(); /* Make a config instance */ } ex_catch(Except) { rethrow; } } - s_pInst->nLocks++; /* FIXME not threadsafe */ + s_pInst->m_nLocks++; /* FIXME not threadsafe */ return(RC_THROW(RC_OK)); } @@ -127,16 +128,16 @@ ex_t Except; if (s_pInst) { - if (!(--s_pInst->nLocks)) { /* If nLocks is 0, dealloc */ - ex_try { /* FIXME, not thread-safe */ - + if (--s_pInst->m_nLocks == 0) { /* If m_nLocks is 0, dealloc */ + ex_try { /* FIXME, not thread-safe */ + clioptDestruct(); } ex_catch(Except) { rethrow; } - free(s_pInst); /* Deallocate configuration */ - s_pInst = NULL; /* and clear its reference */ + free(s_pInst); /* Deallocate config and */ + s_pInst = NULL; /* clear its reference */ } } else Index: ossp-pkg/rc/rc_private.h RCS File: /v/ossp/cvs/ossp-pkg/rc/rc_private.h,v rcsdiff -q -kk '-r1.8' '-r1.9' -u '/v/ossp/cvs/ossp-pkg/rc/rc_private.h,v' 2>/dev/null --- rc_private.h 2002/04/08 15:37:10 1.8 +++ rc_private.h 2002/04/09 17:01:54 1.9 @@ -60,10 +60,9 @@ ((rv) != RC_OK && (ex_catching && !ex_shielding) \ ? (ex_throw(RC_STR_ID, NULL, (rv)), (rv)) : (rv)) - -typedef struct { /* Main rc configuration storage */ - void *pvFixme; /* Storage of configuration values */ - int nLocks; /* Server locks, not thread-safe FIXME */ -} rc_config_t; +typedef struct { /* Simple linked list definition */ + void *pvData; + void *pvNext; +} rc_list_t; #endif /* __OSSPRC_PRIVATE_H__ */