|   | ![[ Previous ]](navbprev.gif)  ![[ Contents ]](navbhome.gif)  ![[ Index ]](navbhelp.gif)  ![[ Next ]](navbnext.gif)  | 
    int Ns_ConfigGetBool(
    char *hSection,
    char *sKey,
    int *pbValue
    );
The Ns_ConfigGetBool function returns the boolean value of the specified key (sKey) in the specified configuration file section (hSection) and puts it into the integer pointed to by pbValue as a 1 or 0. Values of "1", "y", "yes", "on", "t", and "true" are 1, and values of "0", "n", "no", "f", and "false" are 0. If any other value is found, a warning is written to the log and NS_FALSE is returned. Ns_ConfigGetBool returns NS_TRUE if a valid sKey exists and NS_FALSE otherwise.
    	int opt;
    
    	if (Ns_ConfigGetBool("MySect", "MyKey", &opt) != NS_TRUE) {
    		/* Option was not present or invalid - set a default. */
    		opt = 0;	/* off */
    	}