char *Ns_ConfigGetValue( char *sectionName, char *key );
key
in the section named sectionName
. If either the section does not exist or the key does not exist in the section, the function returns NULL
. If multiple keys of the same name are in the named section (for example, the multiple Load lines of the Modules section), this function returns only the first matching entry. The section names must match exactly, but the key will be matched case-insensitively. Ns_ConfigGetValueExact is the case-sensitive counterpart of this function.The space for the string returned is located in the configuration data. You must not deallocate or modify the string.
/* Fetch the home directory of the AOLserver. */ char *home; home = Ns_ConfigGetValue("[ns/parameters]", "Home");