[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    cfp_getcur(3) manual page Table of Contents

Name

cfp_getcur - retrieve current value of item being parsed

Synopsis


#include <cfht/cfht.h>#include <cfht/cfp.h>int cfp_getcur(id, name, addr, type,
size)FILE_ID id;char *name;char *addr;     /* RETURNED */int type;int size;
libcfht.a

Description

Id is the previously acquired handle for the configuration file. Name is a string to match in the configuration file for item identification. Addr is a pointer to the user supplied place for the value to be retrieved into. Type specifies both the type of pointer really passed in and the conversion that should be done on the value. Valid types are:


CFP_BOOLEAN
CFP_INTEGER
CFP_DOUBLE
CFP_STRING

Note that CFP_BOOLEAN is really an integer, but only TRUE or FALSE will be returned in addr . Size is the number of bytes that addr really points to. This is either the size of a string or the result of a sizeof() .

Return Value

The return value will be a history indicator for those that care about where the value has come from. In the event of an error, FAIL will be returned. Valid histories are:
CFP_CURRENT
Original value from configuration file.
CFP_DEFAULT
Value from the default field has been used.
CFP_ENVIRONMENT
Environment variable has overridden.
CFP_FOUND_CURRENT
The option token was found but the original value is returned.
CFP_FOUND_DEFAULT
The option token was found but the default value is returned.
CFP_FOUND_SUPPLIED
The option token was found but supplied field is returned.
CFP_FOUND_ARGV
The option token was found, and an argument was present.
CFP_SET
The value has been changed programmatically.

Errors

[EIO]
Something failed for an unknown reason.

See Also

cfp(4) .

Warnings


Table of Contents