Index: ossp-pkg/val/val.pod RCS File: /v/ossp/cvs/ossp-pkg/val/val.pod,v rcsdiff -q -kk '-r1.8' '-r1.9' -u '/v/ossp/cvs/ossp-pkg/val/val.pod,v' 2>/dev/null --- val.pod 2002/01/17 13:01:58 1.8 +++ val.pod 2002/01/17 13:26:31 1.9 @@ -84,10 +84,12 @@ It allows one to access C variables through name strings, although the C language does neither provide such a dedicated facility nor an evaluation construct (which could be used to implement such a facility -easily). In general, it is interesting whenever you need access to C -variable symbols without having to know the actual address/reference. -The typical use cases are in combination with flexible configuration -parsing and supporting loosly-coupled DSO-based module architectures. +easily). + +In general, this is used for accessing C variables without having to +know the actual symbol/address/reference. The typical use cases are +in combination with flexible configuration parsing and supporting +loosly-coupled DSO-based module architectures. =head1 STRUCTURED NAMES @@ -107,33 +109,27 @@ =item CI -Type of value when registering a variable using B() or querying for -the type using B(). Most are self-explanatory, C is -used to mount a C structure into an existing C structure to -support structured names. - -C, -C, -C, -C, -C, -C, -C, -C +Type of value when registering a variable using B() or querying +for the type using B(). Most are self-explanatory because +directly correspond to the basic C data types. C is used +to mount a C structure into an existing C structure to +support structured names (see example section for details). + +The following particular types exist: C, C, +C, C, C, C, +C, C =item C, CI -Return codes for every API function. Signals success, invalid argument passed -to function, bad usage of a function, memoryusage reached C -limit, error in internal hash function to be examined through C, -internal error in storage as result from structure corruption, or system -errors including out of memory. - -C, -C, -C, -C, -C, +Return codes (of type C) for every API function. Signals success +(C), invalid argument passed to function, bad usage of a function, +memory usage reached C limit, error in internal hash function to +be examined through C, internal error in storage as result from +structure corruption, or system errors including out of memory to be examined +through C. + +The following particular return codes exist: C, C, +C, C, C, C, C. =back @@ -144,16 +140,16 @@ =item C -Handle created by B() and passed to all other functions to reference -the the same group of variables. +Opaque handle data type created by B() and passed to all +other functions to reference the the same group of values. =item C -Callback to be used B(). +Function data type for the callback to be used with B(). =item C -Code returned by every function. See C C and +Data type returned by every function. See B C and CI. =back @@ -164,78 +160,78 @@ =item val_rc_t B(val_t **I); -Creates an I and updates the given pointer to reference it. +Creates a new value structure and updates the given pointer to reference it. =item val_rc_t B(val_t *I); -Destroys an I, freeing up memory. +Destroys a I structure. =item val_rc_t B(val_t *I, const char *I, int I, const char *I, void *I); -Registers a variable I using I in I. An optional description -or NULL can be passed through I which can be queried through -B() and is also passed to the callback of B(). The value -that belongs to the given I is expected to be found at I. -Passing NULL as I will create an inline data store in I so it -can only be access through B(), B() or after the actual -storage address was queried using B(). +Registers a value under I of type I in I. An optional +description or C can be passed through I which can be +queried through B() and is also passed to the callback of +B(). The value that belongs to the given I is expected +to be found at I. Passing C as I will create +an internal data storage in I so it can only be access through +B(), B() or after the actual storage address was +queried using B(). =item val_rc_t B(val_t *I, const char *I); -Unregisters a variable I in I. +Unregisters the value under I in I. =item val_rc_t B(val_t *I, const char *I, int *I, char **I, void **I); -Queries a variable I in I and returns it's type, description and +Queries a value I in I and returns its type, description and storage address. All of I, I and I are optional and -NULL can be passed in if this information is not needed. Passing NULL to all -query result pointers just checks for existence of I. +C can be passed in if this information is not needed. Passing C to +all query result pointers just checks for existence of the value I in +I. =item val_rc_t B(val_t *I, const char *I, ...); -Sets the value of variable I in I to the data passed in as vararg. -Unless the actual storage address was queried using B() this is -mandatory for inline data. Usually not the value but a pointer to it is stored -to the value can be modified without notice to the library. +Sets the value I in I to the data passed in as the variable +argument (expected to be of the I specified at B() time). +Unless the actual storage address was queried using B() this +operation is mandatory for internally stored data. If external storage +is used, not the value but a pointer to it is stored in the library, so +the value is allowed to be be modified without notice to the library. =item val_rc_t B(val_t *I, const char *I, ...); -Gets the value of variable I in I and stores it whereever the -passed vararg points to. +Gets the value I in I and stores it whereever the passed variable +argument points to. The storage location is expected to be of the I +specified at B() time. =item val_rc_t B(val_t *I, const char *I, va_list I); -Like B() but takes a C as input to allow recursive -execution. Acutally, B() ist just a wrapper around -B(). +Exactly like B() but uses a C. =item val_rc_t B(val_t *I, const char *I, va_list I); -Like B() but takes a C as input to allow recursive -execution. Acutally, B() ist just a wrapper around -B(). +Exactly like B() but uses a C. =item val_rc_t B(val_t *I, const char *I, int I, val_cb_t I, void *I); -Iterates through all elements of I, starting with I which can be -either a data store or I reference, down to a given recursion I. -When I is set to the empty string the search starts immediately at -I. For every element, the callback I() is executed and a context -I is passed to it along with other information described below. - -=item val_rc_t (*)(void *I, const char *I, int I, const char *I, void *I) - -Callback executed by B() for each element being processed. The -context I input to B() is passed to the callback verbatim. The -I is the structured name relative to the I passed to -B(), I signals the type of value I points to and -I is a text which was optionally passed to B(). +Iterates over all values in I, starting with I, which can be +either a data storage or I reference, down to a given recursion +I. If I is set to the empty string the search starts +immediately at I. For every value, the callback I() is executed. +The callback has to be a function with the following prototype: + +val_rc_t cb(void *I, const char *I, int I, const char *I, void *I); + +The I is the passed-through context I of B(). +The I is the structured name relative to the I passed to +B(), I signals the type of value I points to +and I is the text which was optionally passed to B(). =back =head1 SEE ALSO -OSSP var. +B (Variable Expansion Library) =head1 EXAMPLES @@ -349,8 +345,8 @@ =head1 AUTHORS - Thomas Lotterer - Ralf S. Engelschall + Thomas Lotterer + Ralf S. Engelschall =cut