/* 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
