gnome-util

Name

gnome-util -- Miscellaneous utility functions.

Synopsis


#include <libgnome/libgnome.h>


#define     gnome_is_program_in_path        (program)
const char* g_extension_pointer             (const char *path);
#define     gnome_util_prepend_user_home    (x)
#define     gnome_util_home_file            (afile)
char*       gnome_util_user_shell           (void);
int         gnome_setenv                    (const char *name,
                                             const char *value,
                                             gboolean overwrite);
void        gnome_unsetenv                  (const char *name);
void        gnome_clearenv                  (void);

#define     g_concat_dir_and_file           (dir,file)
#define     g_file_exists                   (filename)
#define     g_unix_error_string             (error_num)
#define     gnome_util_user_home            ()
#define     g_copy_vector                   (vec)
#define     gnome_libdir_file               (f)
#define     gnome_datadir_file              (f)
#define     gnome_sound_file                (f)
#define     gnome_pixmap_file               (f)
#define     gnome_config_file               (f)
#define     gnome_unconditional_libdir_file (f)
#define     gnome_unconditional_datadir_file(f)
#define     gnome_unconditional_sound_file  (f)
#define     gnome_unconditional_pixmap_file (f)
#define     gnome_unconditional_config_file (f)

Description

The functions in this section provide some shortcuts to finding certain file paths. There are also some functions for manipulating environment variables for those systems that do not have getenv() and similar functions.

Note: Many of the function in here are now deprecated in favour of similar functions in glib. The preferred replacement function in those cases is indicated below.

Details

gnome_is_program_in_path()

#define     gnome_is_program_in_path(program)

Warning

gnome_is_program_in_path is deprecated and should not be used in newly-written code.

Deprecated, use g_find_program_in_path


g_extension_pointer ()

const char* g_extension_pointer             (const char *path);


gnome_util_prepend_user_home()

#define     gnome_util_prepend_user_home(x)

Prepends the home directory of the user to a filename.


gnome_util_home_file()

#define     gnome_util_home_file(afile)

Similar to gnome_util_prepend_user_home, except that "/home/fred/.gnome", instead of just "/home/fred/" is put on the front.


gnome_util_user_shell ()

char*       gnome_util_user_shell           (void);


gnome_setenv ()

int         gnome_setenv                    (const char *name,
                                             const char *value,
                                             gboolean overwrite);

Adds "name=value" to the environment. Note that on systems without setenv, this leaks memory so please do not use inside a loop or anything like that. The semantics are the same as the glibc setenv() (if setenv() exists, it is used).

If overwrite is FALSE and the variable already exists in the environment, then 0 is returned and the value is not changed.


gnome_unsetenv ()

void        gnome_unsetenv                  (const char *name);

Removes name from the environment. In case there is no native implementation of unsetenv, this could cause leaks depending on the implementation of environment.


gnome_clearenv ()

void        gnome_clearenv                  (void);

Clears out the environment completely. In case there is no native implementation of clearenv, this could cause leaks depending on the implementation of environment.


g_concat_dir_and_file()

#define     g_concat_dir_and_file(dir,file)

Warning

g_concat_dir_and_file is deprecated and should not be used in newly-written code.

Programs should use g_build_filename() instead of this function.


g_file_exists()

#define     g_file_exists(filename)

Warning

g_file_exists is deprecated and should not be used in newly-written code.

Programs should use g_file_test(filename, G_FILE_TEST_EXISTS) instead of this function.


g_unix_error_string()

#define     g_unix_error_string(error_num)

Warning

g_unix_error_string is deprecated and should not be used in newly-written code.

Programs should use g_strerror() instead of this function. Also, note that the returned string is only valid until the next call to g_strerror() or g_unix_error_string().


gnome_util_user_home()

#define     gnome_util_user_home()

Warning

gnome_util_user_home is deprecated and should not be used in newly-written code.

Programs should use g_get_home_dir() instead of this function.


g_copy_vector()

#define     g_copy_vector(vec)

Warning

g_copy_vector is deprecated and should not be used in newly-written code.

Use g_strdupv() instead of this function.


gnome_libdir_file()

#define     gnome_libdir_file(f)

Warning

gnome_libdir_file is deprecated and should not be used in newly-written code.

Programs should use gnome_program_locate_file() instead of this function.


gnome_datadir_file()

#define     gnome_datadir_file(f)

Warning

gnome_datadir_file is deprecated and should not be used in newly-written code.

Programs should use gnome_program_locate_file() instead of this function.


gnome_sound_file()

#define     gnome_sound_file(f)

Warning

gnome_sound_file is deprecated and should not be used in newly-written code.

Programs should use gnome_program_locate_file() instead of this function.


gnome_pixmap_file()

#define     gnome_pixmap_file(f)

Warning

gnome_pixmap_file is deprecated and should not be used in newly-written code.

Programs should use gnome_program_locate_file() instead of this function.


gnome_config_file()

#define     gnome_config_file(f)

Warning

gnome_config_file is deprecated and should not be used in newly-written code.

Programs should use gnome_program_locate_file() instead of this function.


gnome_unconditional_libdir_file()

#define     gnome_unconditional_libdir_file(f)

Warning

gnome_unconditional_libdir_file is deprecated and should not be used in newly-written code.

Programs should use gnome_program_locate_file() instead of this function.


gnome_unconditional_datadir_file()

#define     gnome_unconditional_datadir_file(f)

Warning

gnome_unconditional_datadir_file is deprecated and should not be used in newly-written code.

Programs should use gnome_program_locate_file() instead of this function.


gnome_unconditional_sound_file()

#define     gnome_unconditional_sound_file(f)

Warning

gnome_unconditional_sound_file is deprecated and should not be used in newly-written code.

Programs should use gnome_program_locate_file() instead of this function.


gnome_unconditional_pixmap_file()

#define     gnome_unconditional_pixmap_file(f)

Warning

gnome_unconditional_pixmap_file is deprecated and should not be used in newly-written code.

Programs should use gnome_program_locate_file() instead of this function.


gnome_unconditional_config_file()

#define     gnome_unconditional_config_file(f)

Warning

gnome_unconditional_config_file is deprecated and should not be used in newly-written code.

Programs should use gnome_program_locate_file() instead of this function.