Ns_Set *Ns_ConfigGetSection( char *sectionName );
This function returns the entire section as an Ns_Set
, where the fields of the set correspond to the entries of the section in the config file. The fields are stored in the Ns_Set in the same order in which they appear in the configuration file section. This is useful if you want to loop through all the entries of a section. If the section does not exist, Ns_ConfigGetSection returns NULL.
The Ns_Set returned is located in the configuration data. You do not need to free the set and you must not alter it.
Ns_Set *section; int i; char *key; /* Log the keys of the "MySection" config section. */ section = Ns_ConfigGetSection("MySection"); for (i = 0; i < Ns_SetSize(section); ++i) { key = Ns_SetKey(section, i); Ns_Log(Notice, "key %d: %s", i, key); } ...