1*906afcb8SAndy Fiddaman /* : : generated by cmd/ast/tools/lcgen : : */ 2*906afcb8SAndy Fiddaman #pragma prototyped 3*906afcb8SAndy Fiddaman 4*906afcb8SAndy Fiddaman #ifndef _LC_H 5*906afcb8SAndy Fiddaman #define _LC_H 1 6*906afcb8SAndy Fiddaman 7*906afcb8SAndy Fiddaman #include <ast.h> 8*906afcb8SAndy Fiddaman 9*906afcb8SAndy Fiddaman #define LC_abbreviated 0x00001 10*906afcb8SAndy Fiddaman #define LC_checked 0x00002 11*906afcb8SAndy Fiddaman #define LC_debug 0x00004 12*906afcb8SAndy Fiddaman #define LC_default 0x00008 13*906afcb8SAndy Fiddaman #define LC_defined 0x00010 14*906afcb8SAndy Fiddaman #define LC_local 0x00020 15*906afcb8SAndy Fiddaman #define LC_primary 0x00040 16*906afcb8SAndy Fiddaman #define LC_qualified 0x00080 17*906afcb8SAndy Fiddaman #define LC_undefined 0x00100 18*906afcb8SAndy Fiddaman #define LC_utf8 0x00200 19*906afcb8SAndy Fiddaman #define LC_verbose 0x00400 20*906afcb8SAndy Fiddaman #define LC_setlocale 0x10000 21*906afcb8SAndy Fiddaman #define LC_setenv 0x20000 22*906afcb8SAndy Fiddaman #define LC_user 0x40000 23*906afcb8SAndy Fiddaman 24*906afcb8SAndy Fiddaman #define LC_language_attribute_max 2 25*906afcb8SAndy Fiddaman #define LC_territory_language_max 4 26*906afcb8SAndy Fiddaman 27*906afcb8SAndy Fiddaman struct Lc_s; 28*906afcb8SAndy Fiddaman 29*906afcb8SAndy Fiddaman typedef struct Lc_info_s 30*906afcb8SAndy Fiddaman { 31*906afcb8SAndy Fiddaman const struct Lc_s* lc; 32*906afcb8SAndy Fiddaman unsigned long number; 33*906afcb8SAndy Fiddaman void* data; 34*906afcb8SAndy Fiddaman } Lc_info_t; 35*906afcb8SAndy Fiddaman 36*906afcb8SAndy Fiddaman typedef struct Lc_attribute_s 37*906afcb8SAndy Fiddaman { 38*906afcb8SAndy Fiddaman const char* name; 39*906afcb8SAndy Fiddaman unsigned long flags; 40*906afcb8SAndy Fiddaman unsigned long index; 41*906afcb8SAndy Fiddaman } Lc_attribute_t; 42*906afcb8SAndy Fiddaman 43*906afcb8SAndy Fiddaman typedef struct Lc_charset_s 44*906afcb8SAndy Fiddaman { 45*906afcb8SAndy Fiddaman const char* code; 46*906afcb8SAndy Fiddaman const char* alternates; 47*906afcb8SAndy Fiddaman const char* ms; 48*906afcb8SAndy Fiddaman unsigned long index; 49*906afcb8SAndy Fiddaman } Lc_charset_t; 50*906afcb8SAndy Fiddaman 51*906afcb8SAndy Fiddaman typedef struct Lc_language_s 52*906afcb8SAndy Fiddaman { 53*906afcb8SAndy Fiddaman const char* code; 54*906afcb8SAndy Fiddaman const char* name; 55*906afcb8SAndy Fiddaman const char* alternates; 56*906afcb8SAndy Fiddaman const Lc_charset_t* charset; 57*906afcb8SAndy Fiddaman unsigned long flags; 58*906afcb8SAndy Fiddaman unsigned long index; 59*906afcb8SAndy Fiddaman const Lc_attribute_t* attributes[LC_language_attribute_max]; 60*906afcb8SAndy Fiddaman } Lc_language_t; 61*906afcb8SAndy Fiddaman 62*906afcb8SAndy Fiddaman typedef struct Lc_territory_s 63*906afcb8SAndy Fiddaman { 64*906afcb8SAndy Fiddaman const char* code; 65*906afcb8SAndy Fiddaman const char* name; 66*906afcb8SAndy Fiddaman unsigned long flags; 67*906afcb8SAndy Fiddaman unsigned long index; 68*906afcb8SAndy Fiddaman const Lc_language_t* languages[LC_territory_language_max]; 69*906afcb8SAndy Fiddaman #ifdef _LC_TERRITORY_PRIVATE_ 70*906afcb8SAndy Fiddaman _LC_TERRITORY_PRIVATE_ 71*906afcb8SAndy Fiddaman #endif 72*906afcb8SAndy Fiddaman } Lc_territory_t; 73*906afcb8SAndy Fiddaman 74*906afcb8SAndy Fiddaman typedef struct Lc_map_s 75*906afcb8SAndy Fiddaman { 76*906afcb8SAndy Fiddaman const char* code; 77*906afcb8SAndy Fiddaman const Lc_language_t* language; 78*906afcb8SAndy Fiddaman const Lc_territory_t* territory; 79*906afcb8SAndy Fiddaman const Lc_charset_t* charset; 80*906afcb8SAndy Fiddaman const Lc_attribute_t* attribute; 81*906afcb8SAndy Fiddaman } Lc_map_t; 82*906afcb8SAndy Fiddaman 83*906afcb8SAndy Fiddaman typedef struct Lc_attribute_list_s 84*906afcb8SAndy Fiddaman { 85*906afcb8SAndy Fiddaman struct Lc_attribute_list_s* next; 86*906afcb8SAndy Fiddaman const Lc_attribute_t* attribute; 87*906afcb8SAndy Fiddaman } Lc_attribute_list_t; 88*906afcb8SAndy Fiddaman 89*906afcb8SAndy Fiddaman typedef struct Lc_s 90*906afcb8SAndy Fiddaman { 91*906afcb8SAndy Fiddaman const char* name; 92*906afcb8SAndy Fiddaman const char* code; 93*906afcb8SAndy Fiddaman const Lc_language_t* language; 94*906afcb8SAndy Fiddaman const Lc_territory_t* territory; 95*906afcb8SAndy Fiddaman const Lc_charset_t* charset; 96*906afcb8SAndy Fiddaman const Lc_attribute_list_t* attributes; 97*906afcb8SAndy Fiddaman unsigned long flags; 98*906afcb8SAndy Fiddaman unsigned long index; 99*906afcb8SAndy Fiddaman #ifdef _LC_PRIVATE_ 100*906afcb8SAndy Fiddaman _LC_PRIVATE_ 101*906afcb8SAndy Fiddaman #endif 102*906afcb8SAndy Fiddaman } Lc_t; 103*906afcb8SAndy Fiddaman 104*906afcb8SAndy Fiddaman struct Lc_category_s; 105*906afcb8SAndy Fiddaman 106*906afcb8SAndy Fiddaman typedef int (*Lc_category_set_f)(struct Lc_category_s*); 107*906afcb8SAndy Fiddaman 108*906afcb8SAndy Fiddaman typedef struct Lc_category_s 109*906afcb8SAndy Fiddaman { 110*906afcb8SAndy Fiddaman const char* name; 111*906afcb8SAndy Fiddaman int external; 112*906afcb8SAndy Fiddaman int internal; 113*906afcb8SAndy Fiddaman Lc_category_set_f setf; 114*906afcb8SAndy Fiddaman Lc_t* prev; 115*906afcb8SAndy Fiddaman unsigned int flags; 116*906afcb8SAndy Fiddaman } Lc_category_t; 117*906afcb8SAndy Fiddaman 118*906afcb8SAndy Fiddaman #if _BLD_ast && defined(__EXPORT__) 119*906afcb8SAndy Fiddaman #define extern __EXPORT__ 120*906afcb8SAndy Fiddaman #endif 121*906afcb8SAndy Fiddaman 122*906afcb8SAndy Fiddaman extern size_t lccanon(Lc_t*, unsigned long flags, char*, size_t); 123*906afcb8SAndy Fiddaman extern Lc_category_t* lccategories(void); 124*906afcb8SAndy Fiddaman extern int lcindex(int, int); 125*906afcb8SAndy Fiddaman extern Lc_info_t* lcinfo(int); 126*906afcb8SAndy Fiddaman extern Lc_t* lcmake(const char*); 127*906afcb8SAndy Fiddaman extern Lc_t* lcscan(Lc_t*); 128*906afcb8SAndy Fiddaman 129*906afcb8SAndy Fiddaman #undef extern 130*906afcb8SAndy Fiddaman 131*906afcb8SAndy Fiddaman #endif 132