mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
* intl/dcigettext.c (DCIGETTEXT) [_LIBC]: Check for bogus CATEGORY.
[_LIBC] (category_to_name): Don't define the function. Instead define a macro using _nl_category_names.
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
2002-08-30 Roland McGrath <roland@redhat.com>
|
2002-08-30 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
|
* intl/dcigettext.c (DCIGETTEXT) [_LIBC]: Check for bogus CATEGORY.
|
||||||
|
[_LIBC] (category_to_name): Don't define the function. Instead
|
||||||
|
define a macro using _nl_category_names.
|
||||||
|
|
||||||
* locale/xlocale.h (struct __locale_struct): New member `__names'.
|
* locale/xlocale.h (struct __locale_struct): New member `__names'.
|
||||||
* locale/xlocale.c (_nl_C_locobj): Update initializer.
|
* locale/xlocale.c (_nl_C_locobj): Update initializer.
|
||||||
* locale/global-locale.c (_nl_global_locale): Likewise.
|
* locale/global-locale.c (_nl_global_locale): Likewise.
|
||||||
|
@@ -265,10 +265,15 @@ static char *plural_lookup PARAMS ((struct loaded_l10nfile *domain,
|
|||||||
const char *translation,
|
const char *translation,
|
||||||
size_t translation_len))
|
size_t translation_len))
|
||||||
internal_function;
|
internal_function;
|
||||||
static const char *category_to_name PARAMS ((int category)) internal_function;
|
|
||||||
static const char *guess_category_value PARAMS ((int category,
|
static const char *guess_category_value PARAMS ((int category,
|
||||||
const char *categoryname))
|
const char *categoryname))
|
||||||
internal_function;
|
internal_function;
|
||||||
|
#ifdef _LIBC
|
||||||
|
# include "../locale/localeinfo.h"
|
||||||
|
# define category_to_name(category) _nl_category_names[category]
|
||||||
|
#else
|
||||||
|
static const char *category_to_name PARAMS ((int category)) internal_function;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* For those loosing systems which don't have `alloca' we have to add
|
/* For those loosing systems which don't have `alloca' we have to add
|
||||||
@@ -391,6 +396,15 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
|
|||||||
if (msgid1 == NULL)
|
if (msgid1 == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
#ifdef _LIBC
|
||||||
|
if (category < 0 || category >= __LC_LAST || category == LC_ALL)
|
||||||
|
/* Bogus. */
|
||||||
|
return (plural == 0
|
||||||
|
? (char *) msgid1
|
||||||
|
/* Use the Germanic plural rule. */
|
||||||
|
: n == 1 ? (char *) msgid1 : (char *) msgid2);
|
||||||
|
#endif
|
||||||
|
|
||||||
__libc_rwlock_rdlock (_nl_state_lock);
|
__libc_rwlock_rdlock (_nl_state_lock);
|
||||||
|
|
||||||
/* If DOMAINNAME is NULL, we are interested in the default domain. If
|
/* If DOMAINNAME is NULL, we are interested in the default domain. If
|
||||||
@@ -985,7 +999,7 @@ plural_lookup (domain, n, translation, translation_len)
|
|||||||
return (char *) p;
|
return (char *) p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _LIBC
|
||||||
/* Return string representation of locale CATEGORY. */
|
/* Return string representation of locale CATEGORY. */
|
||||||
static const char *
|
static const char *
|
||||||
internal_function
|
internal_function
|
||||||
@@ -1045,6 +1059,7 @@ category_to_name (category)
|
|||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Guess value of current locale from value of the environment variables. */
|
/* Guess value of current locale from value of the environment variables. */
|
||||||
static const char *
|
static const char *
|
||||||
|
Reference in New Issue
Block a user