moo_getenv_bool()

This commit is contained in:
Yevgen Muntyan 2010-11-01 02:39:58 -07:00
parent 2e1a6d1cbc
commit 0441281cd3
2 changed files with 10 additions and 0 deletions

View File

@ -1198,6 +1198,14 @@ _moo_get_pid_string (void)
} }
gboolean
moo_getenv_bool (const char *var)
{
const char *value = g_getenv (var);
return value && *value && strcmp (value, "0") != 0;
}
char * char *
moo_tempnam (void) moo_tempnam (void)
{ {

View File

@ -103,6 +103,8 @@ char **moo_get_lib_subdirs (const char *subdir);
#define moo_get_data_files moo_get_data_subdirs #define moo_get_data_files moo_get_data_subdirs
#define moo_get_sys_data_files moo_get_sys_data_subdirs #define moo_get_sys_data_files moo_get_sys_data_subdirs
gboolean moo_getenv_bool (const char *var);
char *moo_tempnam (void); char *moo_tempnam (void);
void moo_cleanup (void); void moo_cleanup (void);