2.7.1.6. cft_GetEx()
[<<<] [>>>]
Get the value associated with the key key from the configuration
structure pCT, or get the values of a node.
The arguments:
- pCT the configuration information searched.
- key the key that we search the value for, or NULL if we already
know the node id where the needed information is.
- plNodeId the id of the node that we need information from. If the
key argumentum is not NULL then this argument is overwritten with the
node id associated with the key. If the argument key is NULL this
argument should specify the id of the node we need information from.
If the node id is not needed upon return this argument may point to NULL.
- ppszValue will return a pointer to a constant ZCHAR string if
the value associated with key is string. If the argument is NULL
then the function ignore this argument.
- plValue will return a long if the value associated with
key is integer. If the argument is NULL
then the function ignore this argument.
- pdValue will return a double if the value associated with
key is a real number. If the argument is NULL
then the function ignore this argument.
- type will return the type of the key. This can be
- CFT_NODE_BRANCH if the key is associated with a subtree.
- CFT_TYPE_STRING if the key is associated with a string
- CFT_TYPE_INTEGER if the key is associated with an integer number
- CFT_TYPE_REAL if the key is associated with a real number
This argument can also be NULL if the caller is not interested in the
type of the value.
Note that any of ppszValue, plValue, pdValue can point to a
variable or to NULL in case the caller does not need the actual value.
int cft_GetEx(ptConfigTree pCT,
char *key,
CFT_NODE *plNodeId,
char **ppszValue,
long *plValue,
double *pdValue,
int *type
){
The function returns CFT_ERROR_SUCCESS if no error happens.
The value CFT_ERROR_SUCCESS is zero.
If an error happens the error code is returned. These error codes are:
- CFT_ERROR_NOT_FOUND the key is not present in the table, and
*plNodeId will also be set to zero.
- CFT_ERROR_NOTYPE the key is found but has a type that can not
be returned, because the caller passed NULL as storage location.
In this case the type of the configuration information is probably
wrong.
[<<<] [>>>]