int Ns_ConfigGetInt( char *sectionName, char *key, int *valuePtr );
This function converts the specified value into an int and stores it in valuePtr
. If the key
does not exist in the config file or it is not an integer, the function returns NS_FALSE
. Otherwise it returns NS_TRUE
.
int n; if (Ns_ConfigGetInt("MySect", "MyKey", &n) != NS_TRUE) { /* Integer was not present or invalid - set a default. */ n = 5; /* off */ }