Index: ossp-pkg/val/AUTHORS RCS File: /v/ossp/cvs/ossp-pkg/val/AUTHORS,v rcsdiff -q -kk '-r1.1' '-r1.2' -u '/v/ossp/cvs/ossp-pkg/val/AUTHORS,v' 2>/dev/null --- AUTHORS 2002/03/13 18:39:40 1.1 +++ AUTHORS 2003/02/17 14:35:24 1.2 @@ -1,3 +1,10 @@ + _ ___ ____ ____ ____ _ + |_|_ _ / _ \/ ___/ ___|| _ \ __ ____ _| | + _|_||_| | | | \___ \___ \| |_) | \ \ / / _` | | + |_||_|_| | |_| |___) |__) | __/ \ V / (_| | | + |_|_|_| \___/|____/____/|_| \_/ \__,_|_| + + OSSP val - Value Access AUTHORS @@ -5,5 +12,5 @@ or edited major parts of the OSSP val sources. Ralf S. Engelschall - Thomas Lotterer + Thomas Lotterer Index: ossp-pkg/val/NEWS RCS File: /v/ossp/cvs/ossp-pkg/val/NEWS,v rcsdiff -q -kk '-r1.1' '-r1.2' -u '/v/ossp/cvs/ossp-pkg/val/NEWS,v' 2>/dev/null --- NEWS 2002/03/13 18:39:40 1.1 +++ NEWS 2003/02/17 14:35:24 1.2 @@ -1,13 +1,12 @@ - _ - __ ____ _| | - \ \ / / _` | | - \ V / (_| | | - \_/ \__,_|_| + _ ___ ____ ____ ____ _ + |_|_ _ / _ \/ ___/ ___|| _ \ __ ____ _| | + _|_||_| | | | \___ \___ \| |_) | \ \ / / _` | | + |_||_|_| | |_| |___) |__) | __/ \ V / (_| | | + |_|_|_| \___/|____/____/|_| \_/ \__,_|_| - OSSP val -- Value Access + OSSP val - Value Access NEWS - ==== This is a list of user-visible and/or major changes to OSSP val. For more details please have a look at the ChangeLog file. Index: ossp-pkg/val/README RCS File: /v/ossp/cvs/ossp-pkg/val/README,v rcsdiff -q -kk '-r1.5' '-r1.6' -u '/v/ossp/cvs/ossp-pkg/val/README,v' 2>/dev/null --- README 2003/02/02 14:22:43 1.5 +++ README 2003/02/17 14:35:24 1.6 @@ -1,10 +1,10 @@ - _ - __ ____ _| | - \ \ / / _` | | - \ V / (_| | | - \_/ \__,_|_| + _ ___ ____ ____ ____ _ + |_|_ _ / _ \/ ___/ ___|| _ \ __ ____ _| | + _|_||_| | | | \___ \___ \| |_) | \ \ / / _` | | + |_||_|_| | |_| |___) |__) | __/ \ V / (_| | | + |_|_|_| \___/|____/____/|_| \_/ \__,_|_| - OSSP val -- Value Access + OSSP val - Value Access Version 0.9.0 (15-Mar-2002) ABSTRACT Index: ossp-pkg/val/TODO RCS File: /v/ossp/cvs/ossp-pkg/val/TODO,v rcsdiff -q -kk '-r1.5' '-r1.6' -u '/v/ossp/cvs/ossp-pkg/val/TODO,v' 2>/dev/null --- TODO 2002/05/27 15:34:33 1.5 +++ TODO 2003/02/17 14:35:24 1.6 @@ -1,16 +1,22 @@ + _ ___ ____ ____ ____ _ + |_|_ _ / _ \/ ___/ ___|| _ \ __ ____ _| | + _|_||_| | | | \___ \___ \| |_) | \ \ / / _` | | + |_||_|_| | |_| |___) |__) | __/ \ V / (_| | | + |_|_|_| \___/|____/____/|_| \_/ \__,_|_| -TODO ----- + OSSP val - Value Access -o dynamic variables: function pointer for set/get + TODO -o in combination with var lookups, each variable should have dump/print/output - feature/function which results the value (integer, string, struct, etc.) always as a string - (stringify function) - -o access control feature: val_reg(, ...) - val_get(, ...) - for use in combination with var in order to allow all internals to be stored - and registered in val structure but allow variable lookups only to access - public/whatever type variables. + o dynamic variables: function pointer for set/get + + o in combination with var lookups, each variable should have + dump/print/output feature/function which results the value (integer, + string, struct, etc.) always as a string (stringify function) + + o access control feature: val_reg(, ...) + val_get(, ...) + for use in combination with var in order to allow all internals to + be stored and registered in val structure but allow variable lookups + only to access public/whatever type variables. Index: ossp-pkg/val/configure.ac RCS File: /v/ossp/cvs/ossp-pkg/val/configure.ac,v rcsdiff -q -kk '-r1.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/val/configure.ac,v' 2>/dev/null --- configure.ac 2003/02/02 14:22:43 1.6 +++ configure.ac 2003/02/17 14:35:24 1.7 @@ -45,7 +45,7 @@ dnl # checks for external libraries AC_CHECK_EXTLIB([OSSP ex], ex, __ex_ctx, ex.h, [AC_DEFINE(WITH_EX, 1, [Define to 1 if building with OSSP ex])]) -AC_CHECK_EXTLIB([Dmalloc], dmalloc, dmalloc_debug, dmalloc.h, +AC_CHECK_EXTLIB([Dmalloc], dmalloc, dmalloc_debug, dmalloc.h, [AC_DEFINE(WITH_DMALLOC, 1, [Define to 1 if building with Dmalloc])]) dnl # output generation Index: ossp-pkg/val/devtool RCS File: /v/ossp/cvs/ossp-pkg/val/devtool,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/val/devtool,v' 2>/dev/null --- devtool 2003/02/10 10:13:34 1.2 +++ devtool 2003/02/17 14:35:24 1.3 @@ -1,7 +1,7 @@ #!/bin/sh ## ## devtool -- Development Tool -## Copyright (c) 2001-2002 Ralf S. Engelschall +## Copyright (c) 2001-2002 Ralf S. Engelschall ## if [ $# -eq 0 ]; then Index: ossp-pkg/val/devtool.conf RCS File: /v/ossp/cvs/ossp-pkg/val/devtool.conf,v rcsdiff -q -kk '-r1.8' '-r1.9' -u '/v/ossp/cvs/ossp-pkg/val/devtool.conf,v' 2>/dev/null --- devtool.conf 2003/01/30 19:06:49 1.8 +++ devtool.conf 2003/02/17 14:35:25 1.9 @@ -23,7 +23,7 @@ %version shtool version -l txt -n "OSSP val" -p "val_" -e VERSION V=`shtool version -l txt -d long VERSION` - sed -e "s/Version .*(.*)/Version $V/g" README.n + sed -e "s/Version .*(.*)/Version $V/g" README.n mv README.n README %dist Index: ossp-pkg/val/devtool.func RCS File: /v/ossp/cvs/ossp-pkg/val/devtool.func,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/val/devtool.func,v' 2>/dev/null --- devtool.func 2002/03/13 18:19:38 1.2 +++ devtool.func 2003/02/17 14:35:25 1.3 @@ -1,6 +1,6 @@ ## ## devtool.func -- Development Tool Functions -## Copyright (c) 2001-2002 Ralf S. Engelschall +## Copyright (c) 2001-2002 Ralf S. Engelschall ## devtool_require () { Index: ossp-pkg/val/val-config.in RCS File: /v/ossp/cvs/ossp-pkg/val/val-config.in,v rcsdiff -q -kk '-r1.5' '-r1.6' -u '/v/ossp/cvs/ossp-pkg/val/val-config.in,v' 2>/dev/null --- val-config.in 2003/02/02 14:22:43 1.5 +++ val-config.in 2003/02/17 14:35:25 1.6 @@ -29,7 +29,7 @@ ## val-config.in: cache library build utility ## -DIFS=' +DIFS=' ' prefix="@prefix@" Index: ossp-pkg/val/val.c RCS File: /v/ossp/cvs/ossp-pkg/val/val.c,v rcsdiff -q -kk '-r1.14' '-r1.15' -u '/v/ossp/cvs/ossp-pkg/val/val.c,v' 2>/dev/null --- val.c 2003/02/06 16:58:40 1.14 +++ val.c 2003/02/17 14:35:25 1.15 @@ -107,7 +107,7 @@ typedef struct segment_st segment_t; struct segment_st { element_t *s_element[SEGMENTSIZE]; /* array of pointers to elements */ -}; +}; /* the top-level hash table structure */ struct lh_st { @@ -139,7 +139,7 @@ * signature). It can be definetely recommended as a good general * purpose hash function. */ -static long +static long lh_hash( register const unsigned char *k, register size_t length) @@ -176,7 +176,7 @@ /* handle the last 11 bytes */ c += length; - switch(len) { + switch(len) { /* all the case statements fall through */ case 11: c+=((ub4)k[10]<<24); case 10: c+=((ub4)k[ 9]<<16); @@ -220,7 +220,7 @@ /* allocate and clear first segment of hash table array */ if ((h->h_dir[0] = (segment_t *)malloc(sizeof(segment_t))) == NULL) { - free(h->h_dir); + free(h->h_dir); free(h); return NULL; } @@ -243,7 +243,7 @@ element_t **pelold; element_t *el, *headofold, *headofnew, *next; unsigned int n; - + /* calculate next new address */ pmax0 = h->h_pmax; newaddr = pmax0 + h->h_p; @@ -257,7 +257,7 @@ return; memset((char *)h->h_dir+n, 0, n); } - + /* have to create a new table segment? */ if (SEGINDEX(newaddr) == 0) { if ((seg = (segment_t *)malloc(sizeof(segment_t))) == NULL) @@ -275,7 +275,7 @@ h->h_p = 0; } h->h_slack += MAXLOADFCTR; - + /* relocate and split between P-element new element */ headofold = NULL; headofnew = NULL; @@ -369,7 +369,7 @@ /* check whether element is already in the hash table */ bFound = FALSE; for (el = *pel; el != NULL; el = el->e_next) { - if ( el->e_hash == hash + if ( el->e_hash == hash && el_keylen(el) == keylen && memcmp(el->e_keyptr, keyptr, el_keylen(el)) == 0) { bFound = TRUE; @@ -440,7 +440,7 @@ /* search for element in collision list */ for (el = *pel; el != NULL; el = el->e_next) { - if ( el->e_hash == hash + if ( el->e_hash == hash && el_keylen(el) == keylen && memcmp(el->e_keyptr, keyptr, el_keylen(el)) == 0) { /* provide results */ @@ -477,7 +477,7 @@ /* search for element in collision chain */ rv = FALSE; for (lel = NULL, el = *pel; el != NULL; lel = el, el = el->e_next) { - if ( el->e_hash == hash + if ( el->e_hash == hash && el_keylen(el) == keylen && memcmp(el->e_keyptr, keyptr, el_keylen(el)) == 0) { /* free key+data memory chunk */ @@ -485,7 +485,7 @@ free(el->e_datptr); /* remove element from collision chain */ if (lel == NULL) - *pel = el->e_next; + *pel = el->e_next; else lel->e_next = el->e_next; /* deallocate element structure */ @@ -581,7 +581,7 @@ ** full-featured linear hashing library. */ -/* +/* * usually val_object_t.data is a pointer val_object_t.data.p, * but VAL_INLINE signals val_object_t.data is actual data * val_object_t.data.[csilfd]. @@ -634,7 +634,7 @@ default: storage = NULL; break; /* cannot happen */ } } - else + else storage = obj->data.p; return storage; @@ -666,12 +666,12 @@ } /* internal lh_apply() callback for use with val_destroy() */ -static int val_destroy_cb(void *_ctx, - const void *keyptr, int keylen, +static int val_destroy_cb(void *_ctx, + const void *keyptr, int keylen, const void *datptr, int datlen) { val_object_t *obj; - + /* free description string */ if ((obj = (val_object_t *)datptr) != NULL) if (obj->desc != NULL) @@ -727,7 +727,7 @@ newobj.desc = strdup(desc); else newobj.desc = NULL; - if (storage == NULL) { + if (storage == NULL) { newobj.type = (type | VAL_INLINE); newobj.data.l = 0; } @@ -779,7 +779,7 @@ } /* query information about a value */ -val_rc_t val_query(val_t *val, const char *name, +val_rc_t val_query(val_t *val, const char *name, int *ptype, char **pdesc, void **pstorage) { char *cp; @@ -890,7 +890,7 @@ /* argument consistency check */ if (val == NULL || name == NULL || ap == NULL) return VAL_RC(VAL_ERR_ARG); - + /* recursive step-down on structured name */ if ((cp = strchr(name, '.')) != NULL) { if (!lh_lookup(val->lh, name, cp-name, (void **)&obj, NULL)) @@ -934,7 +934,7 @@ /* argument consistency check */ if (val == NULL || name == NULL) return VAL_RC(VAL_ERR_ARG); - + /* just pass-through to va_list variant */ va_start(ap, name); rc = val_vget(val, name, ap); @@ -981,7 +981,7 @@ strncat(name, (char *)keyptr, keylen); /* recursive step-down */ - if ((ctx->rc = val_apply_internal(ctx->val, name, prefixlen, + if ((ctx->rc = val_apply_internal(ctx->val, name, prefixlen, ctx->depth, ctx->cb, ctx->ctx)) != VAL_OK) return FALSE; @@ -989,7 +989,7 @@ } /* internal API-increased variant of val_apply() */ -static val_rc_t val_apply_internal(val_t *val, const char *name, int prefixlen, +static val_rc_t val_apply_internal(val_t *val, const char *name, int prefixlen, int depth, val_cb_t cb, void *ctx) { val_object_t *obj; @@ -999,7 +999,7 @@ val_apply_ctx_t val_ctx; if (name[prefixlen] == '\0') { - /* CASE 1: apply to all elements + /* CASE 1: apply to all elements prefix="foo.bar.", remainder="" */ val_ctx.val = val; val_ctx.name = (char *)name; @@ -1027,7 +1027,7 @@ prefix="foo.bar.quux.", remainder="baz" */ if (!lh_lookup(val->lh, name+prefixlen, strlen(name+prefixlen), (void **)&obj, NULL)) return VAL_RC(VAL_ERR_ARG); - if ((rc = cb(ctx, name, (obj->type & ~VAL_INLINE), + if ((rc = cb(ctx, name, (obj->type & ~VAL_INLINE), obj->desc, val_storage(obj))) != VAL_OK) return VAL_RC(rc); if (obj->type & VAL_TYPE_VAL) { Index: ossp-pkg/val/val.pod RCS File: /v/ossp/cvs/ossp-pkg/val/val.pod,v rcsdiff -q -kk '-r1.15' '-r1.16' -u '/v/ossp/cvs/ossp-pkg/val/val.pod,v' 2>/dev/null --- val.pod 2003/02/17 14:27:40 1.15 +++ val.pod 2003/02/17 14:35:25 1.16 @@ -40,7 +40,7 @@ =item B -C, +C, C, C, C, Index: ossp-pkg/val/val_test.c RCS File: /v/ossp/cvs/ossp-pkg/val/val_test.c,v rcsdiff -q -kk '-r1.8' '-r1.9' -u '/v/ossp/cvs/ossp-pkg/val/val_test.c,v' 2>/dev/null --- val_test.c 2003/02/02 14:22:43 1.8 +++ val_test.c 2003/02/17 14:35:25 1.9 @@ -55,31 +55,31 @@ printf("DEBUG: <%10s>, name=<%10s>, VAL_TYPE_PTR, desc=<%20s>, data@%.8lx=%.8lx\n", (char *)ctx, name, desc, (long)data, *(long *)data); break; - case VAL_TYPE_CHAR: + case VAL_TYPE_CHAR: printf("DEBUG: <%10s>, name=<%10s>, VAL_TYPE_CHAR, desc=<%20s>, data@%.8lx='%c'\n", (char *)ctx, name, desc, (long)data, *(char *)data); break; - case VAL_TYPE_SHORT: + case VAL_TYPE_SHORT: printf("DEBUG: <%10s>, name=<%10s>, VAL_TYPE_SHORT, desc=<%20s>, data@%.8lx=%8d\n", (char *)ctx, name, desc, (long)data, *(short *)data); break; - case VAL_TYPE_INT: + case VAL_TYPE_INT: printf("DEBUG: <%10s>, name=<%10s>, VAL_TYPE_INT, desc=<%20s>, data@%.8lx=%8d\n", (char *)ctx, name, desc, (long)data, *(int *)data); break; - case VAL_TYPE_LONG: + case VAL_TYPE_LONG: printf("DEBUG: <%10s>, name=<%10s>, VAL_TYPE_LONG, desc=<%20s>, data@%.8lx=%8ld\n", (char *)ctx, name, desc, (long)data, *(long *)data); break; - case VAL_TYPE_FLOAT: + case VAL_TYPE_FLOAT: printf("DEBUG: <%10s>, name=<%10s>, VAL_TYPE_FLOAT, desc=<%20s>, data@%.8lx=%8f\n", (char *)ctx, name, desc, (long)data, *(float *)data); break; - case VAL_TYPE_DOUBLE: + case VAL_TYPE_DOUBLE: printf("DEBUG: <%10s>, name=<%10s>, VAL_TYPE_DOUBLE, desc=<%20s>, data@%.8lx=%8f\n", (char *)ctx, name, desc, (long)data, *(double *)data); break; - default: + default: printf("DEBUG: <%10s>, name=<%10s>, type = %.8lx, desc=<%20s>, data@%.8lx\n", (char *)ctx, name, (long)type, desc, (long)data); }