blob: 40febab35f33c152836052f6b179e5bed1c4e81a [file] [log] [blame] [edit]
/* Copyright (C) 1995-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
/* Branched from glibc's intl/loadinfo.h. */
#ifndef THIRD_PARTY_GLIBC_LOCALES_COMMON_LOADINFO_H
#define THIRD_PARTY_GLIBC_LOCALES_COMMON_LOADINFO_H
#include <stddef.h>
/* Encoding of locale name parts. */
#define XPG_NORM_CODESET 1
#define XPG_CODESET 2
#define XPG_TERRITORY 4
#define XPG_MODIFIER 8
/* Normalize codeset name. There is no standard for the codeset
names. Normalization allows the user to use any of the common
names. The return value is dynamically allocated and has to be
freed by the caller. */
const char *google_nl_normalize_codeset(const char *codeset, size_t name_len);
/* Normalize a locale name containing a codeset. The returned pointer is
either equal to the input or is dynamically allocated and has to be
freed by the caller. */
const char *google_nl_normalize_locale_name(const char *name);
/* normalized_codeset is dynamically allocated and has to be freed by
the caller. */
int google_nl_explode_name(char *name, const char **language,
const char **modifier, const char **territory,
const char **codeset,
const char **normalized_codeset);
#endif // THIRD_PARTY_GLIBC_LOCALES_SRC_INTL_LOADINFO_H