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

Ns_ConfigGetPath

Overview

Return configuration file section name

Syntax

    char *Ns_ConfigGetPath(
    	char *hServer,
    	char *module,
    	...
    );

Description

The Ns_ConfigGetPath function returns a pointer to a configuration file section name based on the virtual server (hServer) and module specified. The hServer or module may be NULL. A variable number of additional path elements are appended. The list must end with NULL. For example, Ns_ConfigGetPath("server1", NULL, "special", NULL) will return "\NS\Server\server1\special" if such a section exists in the configuration file and NULL if it does not.

The space for the string returned is located in the configuration data. You do not need to deallocate the string and you must not alter it.

Example

    
    int DllExport
    Ns_ModuleInit(char *hServer, char *hModule)
    {
    	char *path;
    	char *value;
    
    	/*
    	 * Construct the MySub section name specific to this
    	 * server and module. For example, if hServer = "vs1"
    	 * and hModule = "mymod", path would be:
    	 * [ns/server/vs1/module/mymod/MySudb]
    	 */
    	path = Ns_ConfigGetPath(hServer, hModule, "MySub", NULL);
    	value = Ns_ConfigGetValue(path, "MyKey");
    
    	...
    

Top of Page

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