[ Previous ] [ Contents ] [ Index ] [ Next ]

Ns_ConfigGetSection

Overview

Get the Ns_Set for a configuration file section

Syntax

    Ns_Set *Ns_ConfigGetSection(
    	char *sectionName
    );

Description

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.

Example

    
    	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);
    	}
    	...
    

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1996 America Online, Inc.