loadinfo.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* Copyright (C) 1996-1999, 2000, 2001 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software Foundation,
  14. Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  15. #ifndef _LOADINFO_H
  16. #define _LOADINFO_H 1
  17. #ifndef PARAMS
  18. # if __STDC__
  19. # define PARAMS(args) args
  20. # else
  21. # define PARAMS(args) ()
  22. # endif
  23. #endif
  24. #ifndef internal_function
  25. # define internal_function
  26. #endif
  27. /* Tell the compiler when a conditional or integer expression is
  28. almost always true or almost always false. */
  29. #ifndef HAVE_BUILTIN_EXPECT
  30. # define __builtin_expect(expr, val) (expr)
  31. #endif
  32. /* Separator in PATH like lists of pathnames. */
  33. #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
  34. /* Win32, OS/2, DOS */
  35. # define PATH_SEPARATOR ';'
  36. #else
  37. /* Unix */
  38. # define PATH_SEPARATOR ':'
  39. #endif
  40. /* Encoding of locale name parts. */
  41. #define CEN_REVISION 1
  42. #define CEN_SPONSOR 2
  43. #define CEN_SPECIAL 4
  44. #define XPG_NORM_CODESET 8
  45. #define XPG_CODESET 16
  46. #define TERRITORY 32
  47. #define CEN_AUDIENCE 64
  48. #define XPG_MODIFIER 128
  49. #define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
  50. #define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
  51. struct loaded_l10nfile
  52. {
  53. const char *filename;
  54. int decided;
  55. const void *data;
  56. struct loaded_l10nfile *next;
  57. struct loaded_l10nfile *successor[1];
  58. };
  59. /* Normalize codeset name. There is no standard for the codeset
  60. names. Normalization allows the user to use any of the common
  61. names. The return value is dynamically allocated and has to be
  62. freed by the caller. */
  63. extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
  64. size_t name_len));
  65. extern struct loaded_l10nfile *
  66. _nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
  67. const char *dirlist, size_t dirlist_len, int mask,
  68. const char *language, const char *territory,
  69. const char *codeset,
  70. const char *normalized_codeset,
  71. const char *modifier, const char *special,
  72. const char *sponsor, const char *revision,
  73. const char *filename, int do_allocate));
  74. extern const char *_nl_expand_alias PARAMS ((const char *name));
  75. /* normalized_codeset is dynamically allocated and has to be freed by
  76. the caller. */
  77. extern int _nl_explode_name PARAMS ((char *name, const char **language,
  78. const char **modifier,
  79. const char **territory,
  80. const char **codeset,
  81. const char **normalized_codeset,
  82. const char **special,
  83. const char **sponsor,
  84. const char **revision));
  85. extern char *_nl_find_language PARAMS ((const char *name));
  86. #endif /* loadinfo.h */