xref: /titanic_51/usr/src/lib/libast/i386/include/ast/lc.h (revision 24fe0b3bf671e123467ce1df0b67cadd3614c8e4)
1 /***********************************************************************
2 *                                                                      *
3 *               This software is part of the ast package               *
4 *          Copyright (c) 1985-2008 AT&T Intellectual Property          *
5 *                      and is licensed under the                       *
6 *                  Common Public License, Version 1.0                  *
7 *                    by AT&T Intellectual Property                     *
8 *                                                                      *
9 *                A copy of the License is available at                 *
10 *            http://www.opensource.org/licenses/cpl1.0.txt             *
11 *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
12 *                                                                      *
13 *              Information and Software Systems Research               *
14 *                            AT&T Research                             *
15 *                           Florham Park NJ                            *
16 *                                                                      *
17 *                 Glenn Fowler <gsf@research.att.com>                  *
18 *                  David Korn <dgk@research.att.com>                   *
19 *                   Phong Vo <kpv@research.att.com>                    *
20 *                                                                      *
21 ***********************************************************************/
22 
23 /* : : generated by proto : : */
24 /* : : generated by ./lcgen : : */
25 
26 
27 #ifndef _LC_H
28 #if !defined(__PROTO__)
29 #include <prototyped.h>
30 #endif
31 #if !defined(__LINKAGE__)
32 #define __LINKAGE__		/* 2004-08-11 transition */
33 #endif
34 
35 #define _LC_H			1
36 
37 #include <ast.h>
38 
39 #define LC_abbreviated		0x00001
40 #define LC_checked		0x00002
41 #define LC_default		0x00004
42 #define LC_defined		0x00008
43 #define LC_debug		0x00010
44 #define LC_local		0x00020
45 #define LC_primary		0x00040
46 #define LC_qualified		0x00080
47 #define LC_undefined		0x00100
48 #define LC_verbose		0x00200
49 #define LC_user			0x10000
50 #define LC_language_attribute_max		2
51 #define LC_territory_language_max		4
52 
53 struct Lc_s;
54 
55 typedef struct Lc_info_s
56 {
57 	const struct Lc_s*	lc;
58 	unsigned long		number;
59 	__V_*			data;
60 } Lc_info_t;
61 
62 typedef struct Lc_attribute_s
63 {
64 	const char*		name;
65 	unsigned long		flags;
66 	unsigned long		index;
67 } Lc_attribute_t;
68 
69 typedef struct Lc_charset_s
70 {
71 	const char*		code;
72 	const char*		alternates;
73 	const char*		ms;
74 	unsigned long		index;
75 } Lc_charset_t;
76 
77 typedef struct Lc_language_s
78 {
79 	const char*		code;
80 	const char*		name;
81 	const char*		alternates;
82 	const Lc_charset_t*	charset;
83 	unsigned long		flags;
84 	unsigned long		index;
85 	const Lc_attribute_t*	attributes[LC_language_attribute_max];
86 } Lc_language_t;
87 
88 typedef struct Lc_territory_s
89 {
90 	const char*		code;
91 	const char*		name;
92 	unsigned long		flags;
93 	unsigned long		index;
94 	const Lc_language_t*	languages[LC_territory_language_max];
95 #ifdef _LC_TERRITORY_PRIVATE_
96 	_LC_TERRITORY_PRIVATE_
97 #endif
98 } Lc_territory_t;
99 
100 typedef struct Lc_map_s
101 {
102 	const char*		code;
103 	const Lc_language_t*	language;
104 	const Lc_territory_t*	territory;
105 	const Lc_charset_t*	charset;
106 	const Lc_attribute_t*	attribute;
107 } Lc_map_t;
108 
109 typedef struct Lc_attribute_list_s
110 {
111 	struct Lc_attribute_list_s*	next;
112 	const Lc_attribute_t*		attribute;
113 } Lc_attribute_list_t;
114 
115 typedef struct Lc_s
116 {
117 	const char*		name;
118 	const char*		code;
119 	const Lc_language_t*	language;
120 	const Lc_territory_t*	territory;
121 	const Lc_charset_t*	charset;
122 	const Lc_attribute_list_t*	attributes;
123 	unsigned long		flags;
124 	unsigned long		index;
125 #ifdef _LC_PRIVATE_
126 	_LC_PRIVATE_
127 #endif
128 } Lc_t;
129 
130 struct Lc_category_s;
131 
132 typedef int (*Lc_category_set_f) __PROTO__((struct Lc_category_s*));
133 
134 typedef struct Lc_category_s
135 {
136 	const char*		name;
137 	int			external;
138 	int			internal;
139 	Lc_category_set_f	setf;
140 	Lc_t*			prev;
141 } Lc_category_t;
142 
143 #if _BLD_ast && defined(__EXPORT__)
144 #undef __MANGLE__
145 #define __MANGLE__ __LINKAGE__		__EXPORT__
146 #endif
147 
148 extern __MANGLE__ size_t		lccanon __PROTO__((Lc_t*, unsigned long flags, char*, size_t));
149 extern __MANGLE__ Lc_category_t*	lccategories __PROTO__((void));
150 extern __MANGLE__ int		lcindex __PROTO__((int, int));
151 extern __MANGLE__ Lc_info_t*	lcinfo __PROTO__((int));
152 extern __MANGLE__ Lc_t*		lcmake __PROTO__((const char*));
153 extern __MANGLE__ Lc_t*		lcscan __PROTO__((Lc_t*));
154 
155 #undef __MANGLE__
156 #define __MANGLE__ __LINKAGE__
157 
158 #endif
159