| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

env_get_boolean

#include "sflenv.h"
Bool
env_get_boolean (
    const char *name,
    Bool default_value)

Synopsis

Translates the specified environment variable and returns the Boolean value of the string. If the variable is not defined in the environment, returns the specified default value. The environment variable name is always translated into upper case. The environment variable value is interpreted irrespective to upper/lower case, and looking at the first letter only. T/Y/1 are TRUE, everything else is FALSE. See conv str bool() for the conversion rules.

Examples

    enforce_security = env_get_number ("security", FALSE);

Source Code - (sflenv.c)

{
    char
        *variable_value;

    variable_value = env get string (name, NULL);
    return (variable_value?
           (conv str bool (variable_value) != 0): default_value);
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation