1 #ifndef LIBRARIES_LOCALE_H
    2 #define LIBRARIES_LOCALE_H
    3 
    4 /*
    5 	locale.library include
    6 
    7 	Copyright © 2002-2010 The MorphOS Development Team, All Rights Reserved.
    8 */
    9 
   10 #ifndef EXEC_TYPES_H
   11 # include <exec/types.h>
   12 #endif
   13 
   14 #ifndef EXEC_NODES_H
   15 # include <exec/nodes.h>
   16 #endif
   17 
   18 #ifndef EXEC_LISTS_H
   19 # include <exec/lists.h>
   20 #endif
   21 
   22 #ifndef EXEC_LIBRARIES_H
   23 # include <exec/libraries.h>
   24 #endif
   25 
   26 #ifndef UTILITY_TAGITEM_H
   27 # include <utility/tagitem.h>
   28 #endif
   29 
   30 #pragma pack(2)
   31 
   32 
   33 #define DAY_1         1
   34 #define DAY_2         2
   35 #define DAY_3         3
   36 #define DAY_4         4
   37 #define DAY_5         5
   38 #define DAY_6         6
   39 #define DAY_7         7
   40 
   41 #define ABDAY_1       8
   42 #define ABDAY_2       9
   43 #define ABDAY_3       10
   44 #define ABDAY_4       11
   45 #define ABDAY_5       12
   46 #define ABDAY_6       13
   47 #define ABDAY_7       14
   48 
   49 #define MON_1         15
   50 #define MON_2         16
   51 #define MON_3         17
   52 #define MON_4         18
   53 #define MON_5         19
   54 #define MON_6         20
   55 #define MON_7         21
   56 #define MON_8         22
   57 #define MON_9         23
   58 #define MON_10        24
   59 #define MON_11        25
   60 #define MON_12        26
   61 
   62 #define ABMON_1       27
   63 #define ABMON_2       28
   64 #define ABMON_3       29
   65 #define ABMON_4       30
   66 #define ABMON_5       31
   67 #define ABMON_6       32
   68 #define ABMON_7       33
   69 #define ABMON_8       34
   70 #define ABMON_9       35
   71 #define ABMON_10      36
   72 #define ABMON_11      37
   73 #define ABMON_12      38
   74 
   75 #define YESSTR        39
   76 #define NOSTR         40
   77 
   78 #define AM_STR        41
   79 #define PM_STR        42
   80 
   81 #define SOFTHYPHEN    43
   82 #define HARDHYPHEN    44
   83 
   84 #define OPENQUOTE     45
   85 #define CLOSEQUOTE    46
   86 
   87 #define YESTERDAYSTR  47
   88 #define TODAYSTR      48
   89 #define TOMORROWSTR   49
   90 #define FUTURESTR     50
   91 
   92 #define MAXSTRMSG     51
   93 
   94 
   95 struct LocaleBase
   96 {
   97 	struct Library lb_LibNode;
   98 	BOOL           lb_SysPatches;
   99 };
  100 
  101 
  102 struct Locale
  103 {
  104 	STRPTR  loc_LocaleName;
  105 	STRPTR  loc_LanguageName;
  106 	STRPTR  loc_PrefLanguages[10];
  107 	ULONG   loc_Flags;
  108 
  109 	ULONG   loc_CodeSet;
  110 	ULONG   loc_CountryCode;
  111 	ULONG   loc_TelephoneCode;
  112 	LONG    loc_GMTOffset;
  113 	UBYTE   loc_MeasuringSystem;
  114 	UBYTE   loc_CalendarType;
  115 	UBYTE   loc_Reserved0[2];
  116 
  117 	STRPTR  loc_DateTimeFormat;
  118 	STRPTR  loc_DateFormat;
  119 	STRPTR  loc_TimeFormat;
  120 
  121 	STRPTR  loc_ShortDateTimeFormat;
  122 	STRPTR  loc_ShortDateFormat;
  123 	STRPTR  loc_ShortTimeFormat;
  124 
  125 	STRPTR  loc_DecimalPoint;
  126 	STRPTR  loc_GroupSeparator;
  127 	STRPTR  loc_FracGroupSeparator;
  128 	UBYTE  *loc_Grouping;
  129 	UBYTE  *loc_FracGrouping;
  130 
  131 	STRPTR  loc_MonDecimalPoint;
  132 	STRPTR  loc_MonGroupSeparator;
  133 	STRPTR  loc_MonFracGroupSeparator;
  134 	UBYTE  *loc_MonGrouping;
  135 	UBYTE  *loc_MonFracGrouping;
  136 	UBYTE   loc_MonFracDigits;
  137 	UBYTE   loc_MonIntFracDigits;
  138 	UBYTE   loc_Reserved1[2];
  139 
  140 	STRPTR  loc_MonCS;
  141 	STRPTR  loc_MonSmallCS;
  142 	STRPTR  loc_MonIntCS;
  143 
  144 	STRPTR  loc_MonPositiveSign;
  145 	UBYTE   loc_MonPositiveSpaceSep;
  146 	UBYTE   loc_MonPositiveSignPos;
  147 	UBYTE   loc_MonPositiveCSPos;
  148 	UBYTE   loc_Reserved2;
  149 
  150 	STRPTR  loc_MonNegativeSign;
  151 	UBYTE   loc_MonNegativeSpaceSep;
  152 	UBYTE   loc_MonNegativeSignPos;
  153 	UBYTE   loc_MonNegativeCSPos;
  154 	UBYTE   loc_Reserved3;
  155 };
  156 
  157 
  158 #define MS_ISO       0
  159 #define MS_AMERICAN  1
  160 #define MS_IMPERIAL  2
  161 #define MS_BRITISH   3
  162 
  163 
  164 #define CT_7SUN  0
  165 #define CT_7MON  1
  166 #define CT_7TUE  2
  167 #define CT_7WED  3
  168 #define CT_7THU  4
  169 #define CT_7FRI  5
  170 #define CT_7SAT  6
  171 
  172 
  173 #define SS_NOSPACE  0
  174 #define SS_SPACE    1
  175 
  176 
  177 #define SP_PARENS     0
  178 #define SP_PREC_ALL   1
  179 #define SP_SUCC_ALL   2
  180 #define SP_PREC_CURR  3
  181 #define SP_SUCC_CURR  4
  182 
  183 
  184 #define CSP_PRECEDES  0
  185 #define CSP_SUCCEEDS  1
  186 
  187 
  188 #define OC_TagBase          (TAG_USER + 0x90000)
  189 #define OC_BuiltInLanguage  (OC_TagBase + 1)
  190 #define OC_BuiltInCodeSet   (OC_TagBase + 2)
  191 #define OC_Version          (OC_TagBase + 3)
  192 #define OC_Language         (OC_TagBase + 4)
  193 #define OC_CodeSet          (OC_TagBase + 5)   /* V51 */
  194 #define OC_BuiltInStrings   (OC_TagBase + 6)   /* V52.3 */
  195 #define OC_ConvertStrings   (OC_TagBase + 7)   /* V53.9, defaults to TRUE. If FALSE, no string conversion will be performed */
  196 
  197 
  198 #define SC_ASCII     0
  199 #define SC_COLLATE1  1
  200 #define SC_COLLATE2  2
  201 
  202 #define SC_UNICODE   SC_ASCII
  203 
  204 #define UCF_IGNORE_CASE (1 << 0)
  205 
  206 
  207 
  208 #define UNICODE_NFD 0
  209 #define UNICODE_NFKD 1
  210 
  211 struct Catalog
  212 {
  213 	struct Node cat_Link;
  214 	UWORD       cat_Pad;
  215 	STRPTR      cat_Language;
  216 	ULONG       cat_CodeSet;
  217 	UWORD       cat_Version;
  218 	UWORD       cat_Revision;
  219 };
  220 
  221 
  222 /*
  223    Parameter to OC_BuiltInStrings tags.
  224 */
  225 
  226 struct BuiltInStrings
  227 {
  228 	LONG       Type;  /* Type of data */
  229 	LONG       Size;  /* Size of data in bytes */
  230 	CONST_APTR Data;  /* Pointer to data */
  231 };
  232 
  233 #define TYPE_CATCOMP_ARRAY 0
  234 #define TYPE_CATCOMP_BLOCK 1
  235 
  236 
  237 /*
  238    cat_CodeSet values
  239 */
  240 
  241 #define CODESET_LEGACY  0
  242 #define CODESET_UTF8    1
  243 #define CODESET_UTF32   2
  244 #define CODESET_COUNT   3
  245 
  246 #define CODESET_LATIN1  CODESET_LEGACY
  247 #define CODESET_UCS4    CODESET_UTF32
  248 
  249 
  250 
  251 /*
  252    Values returned by IsUnicode()
  253 */
  254 
  255 #define UNICODE_INVALID 0 /* ASCII or ISO-8859-1 */
  256 #define UNICODE_UTF8    1 /* UTF-8 */
  257 #define UNICODE_16_BE   2 /* UCS-2/UTF-16 big endian */
  258 #define UNICODE_16_LE   3 /* UCS-2/UTF-16 little endian */
  259 #define UNICODE_32_BE   4 /* UCS-4/UTF-32 big endian */
  260 #define UNICODE_32_LE   5 /* UCS-4/UTF-32 little endian */
  261 
  262 #pragma pack()
  263 
  264 #endif /* LIBRARIES_LOCALE_H */