+2007-06-07 Bruno Haible <bruno@clisp.org>
+
+ * gettextP.h (gl_locale_name_canonicalize, gl_locale_name_posix,
+ gl_locale_name_default, gl_locale_name): New macros.
+ (_nl_locale_name_canonicalize): New declaration.
+ * localename.c: Include config.h unconditionally. Include gettextP.h or
+ localename.h.
+ (gl_locale_name_canonicalize): Renamed from
+ _nl_locale_name_canonicalize. Make static except in libintl.
+ (gl_locale_name_posix): Renamed from _nl_locale_name_posix.
+ (gl_locale_name_default): Renamed from _nl_locale_name_default.
+ (gl_locale_name): Renamed from _nl_locale_name.
+
2007-05-28 Bruno Haible <bruno@clisp.org>
* libintl.rc: New file.
/* Header describing internals of libintl library.
- Copyright (C) 1995-1999, 2000-2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
This program is free software; you can redistribute it and/or modify it
#endif
#ifndef _LIBC
-const char *_nl_language_preferences_default (void);
-const char *_nl_locale_name_posix (int category, const char *categoryname);
-const char *_nl_locale_name_default (void);
-const char *_nl_locale_name (int category, const char *categoryname);
+extern const char *_nl_language_preferences_default (void);
+# define gl_locale_name_canonicalize _nl_locale_name_canonicalize
+extern void _nl_locale_name_canonicalize (char *name);
+# define gl_locale_name_posix _nl_locale_name_posix
+extern const char *_nl_locale_name_posix (int category,
+ const char *categoryname);
+# define gl_locale_name_default _nl_locale_name_default
+extern const char *_nl_locale_name_default (void);
+# define gl_locale_name _nl_locale_name_default
+extern const char *_nl_locale_name (int category, const char *categoryname);
#endif
struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale,
-/* Determine the current selected locale.
- Copyright (C) 1995-1999, 2000-2006 Free Software Foundation, Inc.
+/* Determine name of the currently selected locale.
+ Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
/* Win32 code written by Tor Lillqvist <tml@iki.fi>. */
/* MacOS X code written by Bruno Haible <bruno@clisp.org>. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
+#include <config.h>
+
+/* Specification. */
+#ifdef IN_LIBINTL
+# include "gettextP.h"
+#else
+# include "localename.h"
#endif
#include <stdlib.h>
NAME is a sufficiently large buffer.
On input, it contains the MacOS X locale name.
On output, it contains the Unix locale name. */
+# if !defined IN_LIBINTL
+static
+# endif
void
-_nl_locale_name_canonicalize (char *name)
+gl_locale_name_canonicalize (char *name)
{
/* This conversion is based on a posting by
Deborah GoldSmith <goldsmit@apple.com> on 2005-03-08,
The result must not be freed; it is statically allocated. */
const char *
-_nl_locale_name_posix (int category, const char *categoryname)
+gl_locale_name_posix (int category, const char *categoryname)
{
/* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'.
On some systems this can be done by the 'setlocale' function itself. */
}
const char *
-_nl_locale_name_default (void)
+gl_locale_name_default (void)
{
/* POSIX:2001 says:
"All implementations shall define a locale as the default locale, to be
if (CFStringGetCString (name, namebuf, sizeof(namebuf),
kCFStringEncodingASCII))
{
- _nl_locale_name_canonicalize (namebuf);
+ gl_locale_name_canonicalize (namebuf);
cached_localename = strdup (namebuf);
}
CFRelease (locale);
&& CFStringGetCString ((CFStringRef)value, namebuf, sizeof(namebuf),
kCFStringEncodingASCII))
{
- _nl_locale_name_canonicalize (namebuf);
+ gl_locale_name_canonicalize (namebuf);
cached_localename = strdup (namebuf);
}
# endif
}
const char *
-_nl_locale_name (int category, const char *categoryname)
+gl_locale_name (int category, const char *categoryname)
{
const char *retval;
- retval = _nl_locale_name_posix (category, categoryname);
+ retval = gl_locale_name_posix (category, categoryname);
if (retval != NULL)
return retval;
- return _nl_locale_name_default ();
+ return gl_locale_name_default ();
}