home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / armlinux / alpha / PARTITIONS / USR_GZ / usr / include / localeinfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-14  |  4.9 KB  |  215 lines

  1. /* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. /* Locale-specific information.  */
  20.  
  21. #ifndef    _LOCALEINFO_H
  22.  
  23. #define    _LOCALEINFO_H    1
  24.  
  25. #include <features.h>
  26.  
  27. #define    __need_size_t
  28. #define    __need_wchar_t
  29. #include <stddef.h>
  30. #include <limits.h>
  31.  
  32.  
  33. /* Change these if the `wchar_t' type is changed.  */
  34. #define    WCHAR_MAX    ((wchar_t) UCHAR_MAX)
  35.  
  36.  
  37. /* Used by multibyte char functions.  */
  38. typedef struct
  39. {
  40.   char *string;            /* Bytes.  */
  41.   size_t len;            /* # of bytes.  */
  42.   long int shift;        /* # of mb_char's to shift.  */
  43. } mb_char;
  44.  
  45. struct ctype_mbchar_info
  46. {
  47.   size_t mb_max;        /* Max MB char length.  */
  48.   mb_char *mb_chars;        /* MB chars.  */
  49. };
  50.  
  51. struct ctype_ctype_info
  52. {
  53.   unsigned short int *ctype_b;    /* Characteristics.  */
  54.   unsigned char *ctype_tolower;    /* Case mappings.  */
  55.   unsigned char *ctype_toupper;    /* Case mappings.  */
  56. };
  57.  
  58. struct ctype_info
  59. {
  60.   struct ctype_ctype_info *ctype;
  61.   struct ctype_mbchar_info *mbchar;
  62. };
  63.  
  64. extern __const struct ctype_info *_ctype_info;
  65.  
  66. /* These are necessary because they are used in a header file.  */
  67. extern __const unsigned short int *__ctype_b;
  68. extern __const unsigned char *__ctype_tolower;
  69. extern __const unsigned char *__ctype_toupper;
  70.  
  71.  
  72. /* Used by strcoll and strxfrm.  */
  73. typedef struct
  74. {
  75.   unsigned char *values;
  76.   size_t nvalues;
  77. } literal_value;
  78.  
  79. typedef struct
  80. {
  81.   union
  82.   {
  83.     literal_value literal;
  84.     /* %%% This may become a regex_t in the future.  */
  85.     char *regexp;
  86.   } replace, with;
  87.   unsigned int regexp:1;
  88. } subst;
  89.  
  90. struct collate_info
  91. {
  92.   size_t nsubsts;
  93.   subst *substs;
  94.  
  95.   unsigned char *values;
  96.   unsigned char *offsets;
  97. };
  98.  
  99. extern __const struct collate_info *_collate_info;
  100.  
  101.  
  102. /* Used by strtod, atof.  */
  103. struct numeric_info
  104. {
  105.   char *decimal_point;
  106.   char *thousands_sep;
  107.   char *grouping;
  108. };
  109.  
  110. extern __const struct numeric_info *_numeric_info;
  111.  
  112.  
  113. /* Used in the return value of localeconv.  */
  114. struct monetary_info
  115. {
  116.   char *int_curr_symbol;
  117.   char *currency_symbol;
  118.   char *mon_decimal_point;
  119.   char *mon_thousands_sep;
  120.   char *mon_grouping;
  121.   char *positive_sign;
  122.   char *negative_sign;
  123.   char int_frac_digits;
  124.   char frac_digits;
  125.   char p_cs_precedes;
  126.   char p_sep_by_space;
  127.   char n_cs_precedes;
  128.   char n_sep_by_space;
  129.   char p_sign_posn;
  130.   char n_sign_posn;
  131. };
  132.  
  133. extern __const struct monetary_info *_monetary_info;
  134.  
  135.  
  136. /* Used by strftime, asctime.  */
  137. struct time_info
  138. {
  139.   char *abbrev_wkday[7];    /* Short weekday names.  */
  140.   char *full_wkday[7];        /* Full weekday names.  */
  141.   char *abbrev_month[12];    /* Short month names.  */
  142.   char *full_month[12];        /* Full month names.  */
  143.   char *ampm[2];        /* "AM" and "PM" strings.  */
  144.  
  145.   char *date_time;        /* Appropriate date and time format.  */
  146.   char *date;            /* Appropriate date format.  */
  147.   char *time;            /* Appropriate time format.  */
  148.  
  149.   char *ut0;            /* Name for GMT.  */
  150.   char *tz;            /* Default TZ value.  */
  151. };
  152.  
  153. extern __const struct time_info *_time_info;
  154.  
  155. struct response_info
  156. {
  157.   /* Regexp for affirmative answers.  */
  158.   char *yesexpr;
  159.  
  160.   /* Regexp for negative answers.  */
  161.   char *noexpr;
  162. };
  163.  
  164. extern __const struct response_info *_response_info;
  165.  
  166. /* Locale structure.  */
  167. typedef struct
  168. {
  169.   char *name;
  170.   int categories;
  171.  
  172.   unsigned int allocated:1;
  173.  
  174.   int subcategories;
  175.   size_t num_sublocales;
  176.   struct sub_locale *sublocales;
  177.  
  178.   __ptr_t *info;
  179. } locale;
  180.  
  181. typedef struct sub_locale
  182. {
  183.   unsigned int pointer:1;
  184.  
  185.   int categories;
  186.   char *name;
  187.  
  188.   locale *locale;
  189. } sublocale;
  190.  
  191.  
  192. /* This is the magic number that localeinfo object files begin with.
  193.    In case you're wondering why I chose the value 0x051472CA, it's
  194.    because I was born on 05-14-72 in Oakland, CA.  */
  195. #define    LIMAGIC        0x051472CA
  196. /* This is the magic number that precedes each category-specific section
  197.    of a localeinfo object file.  It's the arbitrary magic number above,
  198.    but modified by the category so that it's different from the per-file
  199.    magic number and unique for each category.  */
  200. #define    CATEGORY_MAGIC(x)    (LIMAGIC ^ (x))
  201.  
  202. extern __const char *__lidir, *__lidefault;
  203.  
  204. __BEGIN_DECLS
  205.  
  206.  
  207. extern locale *__find_locale __P ((int categories, __const char *name));
  208. extern locale *__new_locale __P ((locale *));
  209. extern locale *__localefile __P ((__const char *file));
  210. extern void __free_locale __P ((locale *));
  211.  
  212. __END_DECLS
  213.  
  214. #endif /* localeinfo.h  */
  215.