Blame gettext-runtime/intl/loadinfo.h

Packit 5b56b6
/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
Packit 5b56b6
   This file is part of the GNU C Library.
Packit 5b56b6
   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
Packit 5b56b6
Packit 5b56b6
   This program is free software: you can redistribute it and/or modify
Packit 5b56b6
   it under the terms of the GNU Lesser General Public License as published by
Packit 5b56b6
   the Free Software Foundation; either version 2.1 of the License, or
Packit 5b56b6
   (at your option) any later version.
Packit 5b56b6
Packit 5b56b6
   This program is distributed in the hope that it will be useful,
Packit 5b56b6
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 5b56b6
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 5b56b6
   GNU Lesser General Public License for more details.
Packit 5b56b6
Packit 5b56b6
   You should have received a copy of the GNU Lesser General Public License
Packit 5b56b6
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit 5b56b6
Packit 5b56b6
#ifndef _LOADINFO_H
Packit 5b56b6
#define _LOADINFO_H	1
Packit 5b56b6
Packit 5b56b6
/* Declarations of locale dependent catalog lookup functions.
Packit 5b56b6
   Implemented in
Packit 5b56b6
Packit 5b56b6
     localealias.c    Possibly replace a locale name by another.
Packit 5b56b6
     explodename.c    Split a locale name into its various fields.
Packit 5b56b6
     l10nflist.c      Generate a list of filenames of possible message catalogs.
Packit 5b56b6
     finddomain.c     Find and open the relevant message catalogs.
Packit 5b56b6
Packit 5b56b6
   The main function _nl_find_domain() in finddomain.c is declared
Packit 5b56b6
   in gettextP.h.
Packit 5b56b6
 */
Packit 5b56b6
Packit 5b56b6
#ifndef internal_function
Packit 5b56b6
# define internal_function
Packit 5b56b6
#endif
Packit 5b56b6
Packit 5b56b6
#ifndef LIBINTL_DLL_EXPORTED
Packit 5b56b6
# define LIBINTL_DLL_EXPORTED
Packit 5b56b6
#endif
Packit 5b56b6
Packit 5b56b6
/* Tell the compiler when a conditional or integer expression is
Packit 5b56b6
   almost always true or almost always false.  */
Packit 5b56b6
#ifndef HAVE_BUILTIN_EXPECT
Packit 5b56b6
# define __builtin_expect(expr, val) (expr)
Packit 5b56b6
#endif
Packit 5b56b6
Packit 5b56b6
/* Separator in PATH like lists of pathnames.  */
Packit 5b56b6
#if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
Packit 5b56b6
  /* Win32, OS/2, DOS */
Packit 5b56b6
# define PATH_SEPARATOR ';'
Packit 5b56b6
#else
Packit 5b56b6
  /* Unix */
Packit 5b56b6
# define PATH_SEPARATOR ':'
Packit 5b56b6
#endif
Packit 5b56b6
Packit 5b56b6
/* Encoding of locale name parts.  */
Packit 5b56b6
#define XPG_NORM_CODESET	1
Packit 5b56b6
#define XPG_CODESET		2
Packit 5b56b6
#define XPG_TERRITORY		4
Packit 5b56b6
#define XPG_MODIFIER		8
Packit 5b56b6
Packit 5b56b6
Packit 5b56b6
struct loaded_l10nfile
Packit 5b56b6
{
Packit 5b56b6
  const char *filename;
Packit 5b56b6
  int decided;
Packit 5b56b6
Packit 5b56b6
  const void *data;
Packit 5b56b6
Packit 5b56b6
  struct loaded_l10nfile *next;
Packit 5b56b6
  struct loaded_l10nfile *successor[1];
Packit 5b56b6
};
Packit 5b56b6
Packit 5b56b6
Packit 5b56b6
/* Normalize codeset name.  There is no standard for the codeset
Packit 5b56b6
   names.  Normalization allows the user to use any of the common
Packit 5b56b6
   names.  The return value is dynamically allocated and has to be
Packit 5b56b6
   freed by the caller.  */
Packit 5b56b6
extern const char *_nl_normalize_codeset (const char *codeset,
Packit 5b56b6
					  size_t name_len);
Packit 5b56b6
Packit 5b56b6
/* Lookup a locale dependent file.
Packit 5b56b6
   *L10NFILE_LIST denotes a pool of lookup results of locale dependent
Packit 5b56b6
   files of the same kind, sorted in decreasing order of ->filename.
Packit 5b56b6
   DIRLIST and DIRLIST_LEN are an argz list of directories in which to
Packit 5b56b6
   look, containing at least one directory (i.e. DIRLIST_LEN > 0).
Packit 5b56b6
   MASK, LANGUAGE, TERRITORY, CODESET, NORMALIZED_CODESET, MODIFIER
Packit 5b56b6
   are the pieces of the locale name, as produced by _nl_explode_name().
Packit 5b56b6
   FILENAME is the filename suffix.
Packit 5b56b6
   The return value is the lookup result, either found in *L10NFILE_LIST,
Packit 5b56b6
   or - if DO_ALLOCATE is nonzero - freshly allocated, or possibly NULL.
Packit 5b56b6
   If the return value is non-NULL, it is added to *L10NFILE_LIST, and
Packit 5b56b6
   its ->next field denotes the chaining inside *L10NFILE_LIST, and
Packit 5b56b6
   furthermore its ->successor[] field contains a list of other lookup
Packit 5b56b6
   results from which this lookup result inherits.  */
Packit 5b56b6
extern struct loaded_l10nfile *
Packit 5b56b6
_nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
Packit 5b56b6
		    const char *dirlist, size_t dirlist_len, int mask,
Packit 5b56b6
		    const char *language, const char *territory,
Packit 5b56b6
		    const char *codeset, const char *normalized_codeset,
Packit 5b56b6
		    const char *modifier,
Packit 5b56b6
		    const char *filename, int do_allocate);
Packit 5b56b6
Packit 5b56b6
/* Lookup the real locale name for a locale alias NAME, or NULL if
Packit 5b56b6
   NAME is not a locale alias (but possibly a real locale name).
Packit 5b56b6
   The return value is statically allocated and must not be freed.  */
Packit 5b56b6
/* Part of the libintl ABI only for the sake of the gettext.m4 macro.  */
Packit 5b56b6
extern LIBINTL_DLL_EXPORTED const char *_nl_expand_alias (const char *name);
Packit 5b56b6
Packit 5b56b6
/* Split a locale name NAME into its pieces: language, modifier,
Packit 5b56b6
   territory, codeset.
Packit 5b56b6
   NAME gets destructively modified: NUL bytes are inserted here and
Packit 5b56b6
   there.  *LANGUAGE gets assigned NAME.  Each of *MODIFIER, *TERRITORY,
Packit 5b56b6
   *CODESET gets assigned either a pointer into the old NAME string, or
Packit 5b56b6
   NULL.  *NORMALIZED_CODESET gets assigned the expanded *CODESET, if it
Packit 5b56b6
   is different from *CODESET; this one is dynamically allocated and has
Packit 5b56b6
   to be freed by the caller.
Packit 5b56b6
   The return value is a bitmask, where each bit corresponds to one
Packit 5b56b6
   filled-in value:
Packit 5b56b6
     XPG_MODIFIER                for *MODIFIER,
Packit 5b56b6
     XPG_TERRITORY               for *TERRITORY,
Packit 5b56b6
     XPG_CODESET                 for *CODESET,
Packit 5b56b6
     XPG_NORM_CODESET            for *NORMALIZED_CODESET.
Packit 5b56b6
 */
Packit 5b56b6
extern int _nl_explode_name (char *name, const char **language,
Packit 5b56b6
			     const char **modifier, const char **territory,
Packit 5b56b6
			     const char **codeset,
Packit 5b56b6
			     const char **normalized_codeset);
Packit 5b56b6
Packit 5b56b6
#endif	/* loadinfo.h */