1 /* GLIB - Library of useful routines for C programming
2 * Copyright (C) 1995-1998 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * Modified by the GLib Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GLib Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GLib at ftp://ftp.gtk.org/pub/gtk/.
28 * MT safe for the unix part, FIXME: make the win32 part MT safe as well.
46 #include <sys/types.h>
47 #ifdef HAVE_SYS_PARAM_H
48 #include <sys/param.h>
51 /* implement gutils's inline functions
53 #define G_IMPLEMENT_INLINES 1
56 #include "gprintfint.h"
59 #define G_PATH_LENGTH MAXPATHLEN
60 #elif defined (PATH_MAX)
61 #define G_PATH_LENGTH PATH_MAX
62 #elif defined (_PC_PATH_MAX)
63 #define G_PATH_LENGTH sysconf(_PC_PATH_MAX)
65 #define G_PATH_LENGTH 2048
68 #ifdef G_PLATFORM_WIN32
69 # define STRICT /* Strict typing, please */
72 # include <lmcons.h> /* For UNLEN */
74 #endif /* G_PLATFORM_WIN32 */
84 #ifdef HAVE_BIND_TEXTDOMAIN_CODESET
88 const guint glib_major_version = GLIB_MAJOR_VERSION;
89 const guint glib_minor_version = GLIB_MINOR_VERSION;
90 const guint glib_micro_version = GLIB_MICRO_VERSION;
91 const guint glib_interface_age = GLIB_INTERFACE_AGE;
92 const guint glib_binary_age = GLIB_BINARY_AGE;
94 #if !defined (HAVE_MEMMOVE) && !defined (HAVE_WORKING_BCOPY)
96 g_memmove (gpointer dest, gconstpointer src, gulong len)
98 gchar* destptr = dest;
99 const gchar* srcptr = src;
100 if (src + len < dest || dest + len < src)
102 bcopy (src, dest, len);
105 else if (dest <= src)
108 *(destptr++) = *(srcptr++);
115 *(--destptr) = *(--srcptr);
118 #endif /* !HAVE_MEMMOVE && !HAVE_WORKING_BCOPY */
121 g_atexit (GVoidFunc func)
124 const gchar *error = NULL;
126 /* keep this in sync with glib.h */
128 #ifdef G_NATIVE_ATEXIT
129 result = ATEXIT (func);
131 error = g_strerror (errno);
132 #elif defined (HAVE_ATEXIT)
133 # ifdef NeXT /* @#%@! NeXTStep */
134 result = !atexit ((void (*)(void)) func);
136 error = g_strerror (errno);
138 result = atexit ((void (*)(void)) func);
140 error = g_strerror (errno);
142 #elif defined (HAVE_ON_EXIT)
143 result = on_exit ((void (*)(int, void *)) func, NULL);
145 error = g_strerror (errno);
148 error = "no implementation";
149 #endif /* G_NATIVE_ATEXIT */
152 g_error ("Could not register atexit() function: %s", error);
155 /* Based on execvp() from GNU Libc.
156 * Some of this code is cut-and-pasted into gspawn.c
160 my_strchrnul (const gchar *str, gchar c)
162 gchar *p = (gchar*)str;
163 while (*p && (*p != c))
171 gchar *inner_find_program_in_path (const gchar *program);
174 g_find_program_in_path (const gchar *program)
176 const gchar *last_dot = strrchr (program, '.');
178 if (last_dot == NULL || strchr (last_dot, '\\') != NULL)
180 const gint program_length = strlen (program);
181 const gchar *pathext = getenv ("PATHEXT");
183 gchar *decorated_program;
187 pathext = ".com;.exe;.bat";
193 p = my_strchrnul (pathext, ';');
195 decorated_program = g_malloc (program_length + (p-pathext) + 1);
196 memcpy (decorated_program, program, program_length);
197 memcpy (decorated_program+program_length, pathext, p-pathext);
198 decorated_program [program_length + (p-pathext)] = '\0';
200 retval = inner_find_program_in_path (decorated_program);
201 g_free (decorated_program);
205 } while (*p++ != '\0');
209 return inner_find_program_in_path (program);
212 #define g_find_program_in_path inner_find_program_in_path
216 * g_find_program_in_path:
217 * @program: a program name
219 * Locates the first executable named @program in the user's path, in the
220 * same way that execvp() would locate it. Returns an allocated string
221 * with the absolute path name, or NULL if the program is not found in
222 * the path. If @program is already an absolute path, returns a copy of
223 * @program if @program exists and is executable, and NULL otherwise.
225 * On Windows, if @program does not have a file type suffix, tries to
226 * append the suffixes in the PATHEXT environment variable (if that
227 * doesn't exists, the suffixes .com, .exe, and .bat) in turn, and
228 * then look for the resulting file name in the same way as
229 * CreateProcess() would. This means first in the directory where the
230 * program was loaded from, then in the current directory, then in the
231 * Windows 32-bit system directory, then in the Windows directory, and
232 * finally in the directories in the PATH environment variable. If
233 * the program is found, the return value contains the full name
234 * including the type suffix.
236 * Return value: absolute path, or NULL
239 g_find_program_in_path (const gchar *program)
241 const gchar *path, *p;
242 gchar *name, *freeme;
249 g_return_val_if_fail (program != NULL, NULL);
251 /* If it is an absolute path, or a relative path including subdirectories,
252 * don't look in PATH.
254 if (g_path_is_absolute (program)
255 || strchr (program, G_DIR_SEPARATOR) != NULL)
257 if (g_file_test (program, G_FILE_TEST_IS_EXECUTABLE))
258 return g_strdup (program);
263 path = g_getenv ("PATH");
267 /* There is no `PATH' in the environment. The default
268 * search path in GNU libc is the current directory followed by
269 * the path `confstr' returns for `_CS_PATH'.
272 /* In GLib we put . last, for security, and don't use the
273 * unportable confstr(); UNIX98 does not actually specify
274 * what to search if PATH is unset. POSIX may, dunno.
277 path = "/bin:/usr/bin:.";
282 gchar moddir[MAXPATHLEN], sysdir[MAXPATHLEN], windir[MAXPATHLEN];
284 GetModuleFileName (NULL, moddir, sizeof (moddir));
285 tmp = g_path_get_dirname (moddir);
286 GetSystemDirectory (sysdir, sizeof (sysdir));
287 GetWindowsDirectory (windir, sizeof (windir));
288 path_tmp = g_strconcat (tmp, ";.;", sysdir, ";", windir,
289 (path != NULL ? ";" : NULL),
290 (path != NULL ? path : NULL),
297 len = strlen (program) + 1;
298 pathlen = strlen (path);
299 freeme = name = g_malloc (pathlen + len + 1);
301 /* Copy the file name at the top, including '\0' */
302 memcpy (name + pathlen + 1, program, len);
303 name = name + pathlen;
304 /* And add the slash before the filename */
305 *name = G_DIR_SEPARATOR;
313 p = my_strchrnul (path, G_SEARCHPATH_SEPARATOR);
316 /* Two adjacent colons, or a colon at the beginning or the end
317 * of `PATH' means to search the current directory.
321 startp = memcpy (name - (p - path), path, p - path);
323 if (g_file_test (startp, G_FILE_TEST_IS_EXECUTABLE))
326 ret = g_strdup (startp);
334 while (*p++ != '\0');
345 g_parse_debug_string (const gchar *string,
346 const GDebugKey *keys,
352 g_return_val_if_fail (string != NULL, 0);
354 if (!g_ascii_strcasecmp (string, "all"))
356 for (i=0; i<nkeys; i++)
357 result |= keys[i].value;
361 const gchar *p = string;
363 gboolean done = FALSE;
374 for (i=0; i<nkeys; i++)
375 if (g_ascii_strncasecmp(keys[i].key, p, q - p) == 0 &&
376 keys[i].key[q - p] == '\0')
377 result |= keys[i].value;
388 * @file_name: the name of the file.
390 * Gets the name of the file without any leading directory components.
391 * It returns a pointer into the given file name string.
393 * Return value: the name of the file without any leading directory components.
395 * Deprecated: Use g_path_get_basename() instead.
397 G_CONST_RETURN gchar*
398 g_basename (const gchar *file_name)
400 register gchar *base;
402 g_return_val_if_fail (file_name != NULL, NULL);
404 base = strrchr (file_name, G_DIR_SEPARATOR);
409 if (g_ascii_isalpha (file_name[0]) && file_name[1] == ':')
410 return (gchar*) file_name + 2;
411 #endif /* G_OS_WIN32 */
413 return (gchar*) file_name;
417 g_path_get_basename (const gchar *file_name)
419 register gssize base;
420 register gssize last_nonslash;
424 g_return_val_if_fail (file_name != NULL, NULL);
426 if (file_name[0] == '\0')
428 return g_strdup (".");
430 last_nonslash = strlen (file_name) - 1;
432 while (last_nonslash >= 0 && file_name [last_nonslash] == G_DIR_SEPARATOR)
435 if (last_nonslash == -1)
436 /* string only containing slashes */
437 return g_strdup (G_DIR_SEPARATOR_S);
440 if (last_nonslash == 1 && g_ascii_isalpha (file_name[0]) && file_name[1] == ':')
441 /* string only containing slashes and a drive */
442 return g_strdup (G_DIR_SEPARATOR_S);
443 #endif /* G_OS_WIN32 */
445 base = last_nonslash;
447 while (base >=0 && file_name [base] != G_DIR_SEPARATOR)
451 if (base == -1 && g_ascii_isalpha (file_name[0]) && file_name[1] == ':')
453 #endif /* G_OS_WIN32 */
455 len = last_nonslash - base;
456 retval = g_malloc (len + 1);
457 memcpy (retval, file_name + base + 1, len);
463 g_path_is_absolute (const gchar *file_name)
465 g_return_val_if_fail (file_name != NULL, FALSE);
467 if (file_name[0] == G_DIR_SEPARATOR
469 || file_name[0] == '/'
475 /* Recognize drive letter on native Windows */
476 if (g_ascii_isalpha (file_name[0]) && file_name[1] == ':' && (file_name[2] == G_DIR_SEPARATOR || file_name[2] == '/'))
478 #endif /* G_OS_WIN32 */
483 G_CONST_RETURN gchar*
484 g_path_skip_root (const gchar *file_name)
486 g_return_val_if_fail (file_name != NULL, NULL);
488 #ifdef G_PLATFORM_WIN32
489 /* Skip \\server\share (Win32) or //server/share (Cygwin) */
490 if (file_name[0] == G_DIR_SEPARATOR &&
491 file_name[1] == G_DIR_SEPARATOR &&
496 if ((p = strchr (file_name + 2, G_DIR_SEPARATOR)) > file_name + 2 &&
501 while (file_name[0] && file_name[0] != G_DIR_SEPARATOR)
504 /* Possibly skip a backslash after the share name */
505 if (file_name[0] == G_DIR_SEPARATOR)
508 return (gchar *)file_name;
513 /* Skip initial slashes */
514 if (file_name[0] == G_DIR_SEPARATOR)
516 while (file_name[0] == G_DIR_SEPARATOR)
518 return (gchar *)file_name;
523 if (g_ascii_isalpha (file_name[0]) && file_name[1] == ':' && file_name[2] == G_DIR_SEPARATOR)
524 return (gchar *)file_name + 3;
531 g_path_get_dirname (const gchar *file_name)
533 register gchar *base;
536 g_return_val_if_fail (file_name != NULL, NULL);
538 base = strrchr (file_name, G_DIR_SEPARATOR);
540 return g_strdup (".");
541 while (base > file_name && *base == G_DIR_SEPARATOR)
543 len = (guint) 1 + base - file_name;
545 base = g_new (gchar, len + 1);
546 g_memmove (base, file_name, len);
553 g_get_current_dir (void)
555 gchar *buffer = NULL;
557 static gulong max_len = 0;
560 max_len = (G_PATH_LENGTH == -1) ? 2048 : G_PATH_LENGTH;
562 /* We don't use getcwd(3) on SUNOS, because, it does a popen("pwd")
563 * and, if that wasn't bad enough, hangs in doing so.
565 #if (defined (sun) && !defined (__SVR4)) || !defined(HAVE_GETCWD)
566 buffer = g_new (gchar, max_len + 1);
568 dir = getwd (buffer);
569 #else /* !sun || !HAVE_GETCWD */
570 while (max_len < G_MAXULONG / 2)
572 buffer = g_new (gchar, max_len + 1);
574 dir = getcwd (buffer, max_len);
576 if (dir || errno != ERANGE)
582 #endif /* !sun || !HAVE_GETCWD */
584 if (!dir || !*buffer)
586 /* hm, should we g_error() out here?
587 * this can happen if e.g. "./" has mode \0000
589 buffer[0] = G_DIR_SEPARATOR;
593 dir = g_strdup (buffer);
599 G_CONST_RETURN gchar*
600 g_getenv (const gchar *variable)
603 g_return_val_if_fail (variable != NULL, NULL);
605 return getenv (variable);
607 G_LOCK_DEFINE_STATIC (getenv);
613 static GArray *environs = NULL;
618 g_return_val_if_fail (variable != NULL, NULL);
623 environs = g_array_new (FALSE, FALSE, sizeof (struct env_struct));
625 /* First we try to find the envinronment variable inside the already
629 for (i = 0; i < environs->len; i++)
631 env = &g_array_index (environs, struct env_struct, i);
632 if (strcmp (env->key, variable) == 0)
634 g_assert (env->value);
640 /* If not found, we ask the system */
642 system_env = getenv (variable);
649 /* On Windows NT, it is relatively typical that environment variables
650 * contain references to other environment variables. Handle that by
651 * calling ExpandEnvironmentStrings.
654 g_array_set_size (environs, environs->len + 1);
656 env = &g_array_index (environs, struct env_struct, environs->len - 1);
658 /* First check how much space we need */
659 length = ExpandEnvironmentStrings (system_env, dummy, 2);
661 /* Then allocate that much, and actualy do the expansion and insert
662 * the new found pair into our buffer
665 env->value = g_malloc (length);
666 env->key = g_strdup (variable);
668 ExpandEnvironmentStrings (system_env, env->value, length);
676 G_LOCK_DEFINE_STATIC (g_utils_global);
678 static gchar *g_tmp_dir = NULL;
679 static gchar *g_user_name = NULL;
680 static gchar *g_real_name = NULL;
681 static gchar *g_home_dir = NULL;
683 /* HOLDS: g_utils_global_lock */
685 g_get_any_init (void)
689 g_tmp_dir = g_strdup (g_getenv ("TMPDIR"));
691 g_tmp_dir = g_strdup (g_getenv ("TMP"));
693 g_tmp_dir = g_strdup (g_getenv ("TEMP"));
699 g_tmp_dir = g_strdup (P_tmpdir);
700 k = strlen (g_tmp_dir);
701 if (k > 1 && g_tmp_dir[k - 1] == G_DIR_SEPARATOR)
702 g_tmp_dir[k - 1] = '\0';
709 g_tmp_dir = g_strdup ("/tmp");
710 #else /* G_OS_WIN32 */
711 g_tmp_dir = g_strdup ("C:\\");
712 #endif /* G_OS_WIN32 */
716 /* We check $HOME first for Win32, though it is a last resort for Unix
717 * where we prefer the results of getpwuid().
719 g_home_dir = g_strdup (g_getenv ("HOME"));
721 /* In case HOME is Unix-style (it happens), convert it to
727 while ((p = strchr (g_home_dir, '/')) != NULL)
733 /* USERPROFILE is probably the closest equivalent to $HOME? */
734 if (getenv ("USERPROFILE") != NULL)
735 g_home_dir = g_strdup (g_getenv ("USERPROFILE"));
740 /* At least at some time, HOMEDRIVE and HOMEPATH were used
741 * to point to the home directory, I think. But on Windows
742 * 2000 HOMEDRIVE seems to be equal to SYSTEMDRIVE, and
743 * HOMEPATH is its root "\"?
745 if (getenv ("HOMEDRIVE") != NULL && getenv ("HOMEPATH") != NULL)
747 gchar *homedrive, *homepath;
749 homedrive = g_strdup (g_getenv ("HOMEDRIVE"));
750 homepath = g_strdup (g_getenv ("HOMEPATH"));
752 g_home_dir = g_strconcat (homedrive, homepath, NULL);
757 #endif /* G_OS_WIN32 */
761 struct passwd *pw = NULL;
762 gpointer buffer = NULL;
765 # if defined (HAVE_POSIX_GETPWUID_R) || defined (HAVE_NONPOSIX_GETPWUID_R)
767 # ifdef _SC_GETPW_R_SIZE_MAX
768 /* This reurns the maximum length */
769 glong bufsize = sysconf (_SC_GETPW_R_SIZE_MAX);
773 # else /* _SC_GETPW_R_SIZE_MAX */
775 # endif /* _SC_GETPW_R_SIZE_MAX */
780 buffer = g_malloc (bufsize);
783 # ifdef HAVE_POSIX_GETPWUID_R
784 error = getpwuid_r (getuid (), &pwd, buffer, bufsize, &pw);
785 error = error < 0 ? errno : error;
786 # else /* HAVE_NONPOSIX_GETPWUID_R */
788 error = getpwuid_r (getuid (), &pwd, buffer, bufsize);
789 pw = error == 0 ? &pwd : NULL;
791 pw = getpwuid_r (getuid (), &pwd, buffer, bufsize);
792 error = pw ? 0 : errno;
794 # endif /* HAVE_NONPOSIX_GETPWUID_R */
798 /* we bail out prematurely if the user id can't be found
799 * (should be pretty rare case actually), or if the buffer
800 * should be sufficiently big and lookups are still not
803 if (error == 0 || error == ENOENT)
805 g_warning ("getpwuid_r(): failed due to unknown user id (%lu)",
809 if (bufsize > 32 * 1024)
811 g_warning ("getpwuid_r(): failed due to: %s.",
820 # endif /* HAVE_POSIX_GETPWUID_R || HAVE_NONPOSIX_GETPWUID_R */
825 pw = getpwuid (getuid ());
830 g_user_name = g_strdup (pw->pw_name);
831 g_real_name = g_strdup (pw->pw_gecos);
833 g_home_dir = g_strdup (pw->pw_dir);
838 #else /* !HAVE_PWD_H */
843 gchar buffer[UNLEN+1];
845 if (GetUserName ((LPTSTR) buffer, (LPDWORD) &len))
847 g_user_name = g_strdup (buffer);
848 g_real_name = g_strdup (buffer);
851 # endif /* G_OS_WIN32 */
853 #endif /* !HAVE_PWD_H */
856 g_home_dir = g_strdup (g_getenv ("HOME"));
859 /* change '\\' in %HOME% to '/' */
860 g_strdelimit (g_home_dir, "\\",'/');
863 g_user_name = g_strdup ("somebody");
865 g_real_name = g_strdup ("Unknown");
870 for (p = g_real_name; *p; p++)
874 p = g_strdup (g_real_name);
875 g_free (g_real_name);
883 G_CONST_RETURN gchar*
884 g_get_user_name (void)
886 G_LOCK (g_utils_global);
889 G_UNLOCK (g_utils_global);
894 G_CONST_RETURN gchar*
895 g_get_real_name (void)
897 G_LOCK (g_utils_global);
900 G_UNLOCK (g_utils_global);
905 /* Return the home directory of the user. If there is a HOME
906 * environment variable, its value is returned, otherwise use some
907 * system-dependent way of finding it out. If no home directory can be
908 * deduced, return NULL.
911 G_CONST_RETURN gchar*
912 g_get_home_dir (void)
914 G_LOCK (g_utils_global);
917 G_UNLOCK (g_utils_global);
922 /* Return a directory to be used to store temporary files. This is the
923 * value of the TMPDIR, TMP or TEMP environment variables (they are
924 * checked in that order). If none of those exist, use P_tmpdir from
925 * stdio.h. If that isn't defined, return "/tmp" on POSIXly systems,
926 * and C:\ on Windows.
929 G_CONST_RETURN gchar*
932 G_LOCK (g_utils_global);
935 G_UNLOCK (g_utils_global);
940 G_LOCK_DEFINE (g_prgname);
941 static gchar *g_prgname = NULL;
950 G_UNLOCK (g_prgname);
956 g_set_prgname (const gchar *prgname)
960 g_prgname = g_strdup (prgname);
961 G_UNLOCK (g_prgname);
964 G_LOCK_DEFINE (g_application_name);
965 static gchar *g_application_name = NULL;
968 * g_get_application_name:
970 * Gets a human-readable name for the application, as set by
971 * g_set_application_name(). This name should be localized if
972 * possible, and is intended for display to the user. Contrast with
973 * g_get_prgname(), which gets a non-localized name. If
974 * g_set_application_name() has not been called, returns the result of
975 * g_get_prgname() (which may be %NULL if g_set_prgname() has also not
978 * Return value: human-readable application name. may return %NULL
982 G_CONST_RETURN gchar*
983 g_get_application_name (void)
987 G_LOCK (g_application_name);
988 retval = g_application_name;
989 G_UNLOCK (g_application_name);
992 return g_get_prgname ();
998 * g_set_application_name:
999 * @application_name: localized name of the application
1001 * Sets a human-readable name for the application. This name should be
1002 * localized if possible, and is intended for display to the user.
1003 * Contrast with g_set_prgname(), which sets a non-localized name.
1004 * g_set_prgname() will be called automatically by gtk_init(),
1005 * but g_set_application_name() will not.
1007 * Note that for thread safety reasons, this function can only
1010 * The application name will be used in contexts such as error messages,
1011 * or when displaying an application's name in the task list.
1015 g_set_application_name (const gchar *application_name)
1017 gboolean already_set = FALSE;
1019 G_LOCK (g_application_name);
1020 if (g_application_name)
1023 g_application_name = g_strdup (application_name);
1024 G_UNLOCK (g_application_name);
1027 g_warning ("g_set_application() name called multiple times");
1031 g_direct_hash (gconstpointer v)
1033 return GPOINTER_TO_UINT (v);
1037 g_direct_equal (gconstpointer v1,
1044 g_int_equal (gconstpointer v1,
1047 return *((const gint*) v1) == *((const gint*) v2);
1051 g_int_hash (gconstpointer v)
1053 return *(const gint*) v;
1057 * g_nullify_pointer:
1058 * @nullify_location: the memory address of the pointer.
1060 * Set the pointer at the specified location to %NULL.
1063 g_nullify_pointer (gpointer *nullify_location)
1065 g_return_if_fail (nullify_location != NULL);
1067 *nullify_location = NULL;
1073 * Get the codeset for the current locale.
1075 * Return value: a newly allocated string containing the name
1076 * of the codeset. This string must be freed with g_free().
1079 g_get_codeset (void)
1082 char *result = nl_langinfo (CODESET);
1083 return g_strdup (result);
1085 #ifdef G_PLATFORM_WIN32
1086 return g_strdup_printf ("CP%d", GetACP ());
1088 /* FIXME: Do something more intelligent based on setlocale (LC_CTYPE, NULL)
1090 return g_strdup ("ISO-8859-1");
1097 #include <libintl.h>
1099 #ifdef G_PLATFORM_WIN32
1101 G_WIN32_DLLMAIN_FOR_DLL_NAME (static, dll_name)
1103 static const gchar *
1104 _glib_get_locale_dir (void)
1106 static const gchar *cache = NULL;
1108 cache = g_win32_get_package_installation_subdirectory
1109 (GETTEXT_PACKAGE, dll_name, "lib\\locale");
1114 #undef GLIB_LOCALE_DIR
1115 #define GLIB_LOCALE_DIR _glib_get_locale_dir ()
1117 #endif /* G_PLATFORM_WIN32 */
1119 G_CONST_RETURN gchar *
1120 _glib_gettext (const gchar *str)
1122 static gboolean _glib_gettext_initialized = FALSE;
1124 if (!_glib_gettext_initialized)
1126 bindtextdomain(GETTEXT_PACKAGE, GLIB_LOCALE_DIR);
1127 # ifdef HAVE_BIND_TEXTDOMAIN_CODESET
1128 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
1130 _glib_gettext_initialized = TRUE;
1133 return dgettext (GETTEXT_PACKAGE, str);
1136 #endif /* ENABLE_NLS */