|
| iMatix home page | << | < | > | >> |
SFLVersion 2.11 |
#include "sflenv.h"
char *
env_get_string (
const char *name,
const char *default_value)
Translates the specified environment variable and returns a static string containing the value. If the variable is not defined in the environment, returns the specified default value. Note: if you want to use the value in a program you should use strdupl() to make a copy. The environment variable name is always translated into upper case. The default value may be NULL.
config_file = strdupl (env_get_string ("config", "default.cfg"));
{
char
*variable_name,
*variable_value;
variable_name = mem_strdup (name);
variable_value = getenv (strupc (variable_name));
mem_free (variable_name);
return (variable_value? variable_value: (char *) default_value);
}
| | << | < | > | >> |
|