xref: /titanic_44/usr/src/lib/libast/amd64/include/ast/lc.h (revision 1cb875ae88fb9463b368e725c2444776595895cb)
1 /***********************************************************************
2 *                                                                      *
3 *               This software is part of the ast package               *
4 *          Copyright (c) 1985-2009 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_debug		0x00004
42 #define LC_default		0x00008
43 #define LC_defined		0x00010
44 #define LC_local		0x00020
45 #define LC_primary		0x00040
46 #define LC_qualified		0x00080
47 #define LC_undefined		0x00100
48 #define LC_utf8			0x00200
49 #define LC_verbose		0x00400
50 #define LC_user			0x10000
51 #define LC_language_attribute_max		2
52 #define LC_territory_language_max		4
53 
54 struct Lc_s;
55 
56 typedef struct Lc_info_s
57 {
58 	const struct Lc_s*	lc;
59 	unsigned long		number;
60 	__V_*			data;
61 } Lc_info_t;
62 
63 typedef struct Lc_attribute_s
64 {
65 	const char*		name;
66 	unsigned long		flags;
67 	unsigned long		index;
68 } Lc_attribute_t;
69 
70 typedef struct Lc_charset_s
71 {
72 	const char*		code;
73 	const char*		alternates;
74 	const char*		ms;
75 	unsigned long		index;
76 } Lc_charset_t;
77 
78 typedef struct Lc_language_s
79 {
80 	const char*		code;
81 	const char*		name;
82 	const char*		alternates;
83 	const Lc_charset_t*	charset;
84 	unsigned long		flags;
85 	unsigned long		index;
86 	const Lc_attribute_t*	attributes[LC_language_attribute_max];
87 } Lc_language_t;
88 
89 typedef struct Lc_territory_s
90 {
91 	const char*		code;
92 	const char*		name;
93 	unsigned long		flags;
94 	unsigned long		index;
95 	const Lc_language_t*	languages[LC_territory_language_max];
96 #ifdef _LC_TERRITORY_PRIVATE_
97 	_LC_TERRITORY_PRIVATE_
98 #endif
99 } Lc_territory_t;
100 
101 typedef struct Lc_map_s
102 {
103 	const char*		code;
104 	const Lc_language_t*	language;
105 	const Lc_territory_t*	territory;
106 	const Lc_charset_t*	charset;
107 	const Lc_attribute_t*	attribute;
108 } Lc_map_t;
109 
110 typedef struct Lc_attribute_list_s
111 {
112 	struct Lc_attribute_list_s*	next;
113 	const Lc_attribute_t*		attribute;
114 } Lc_attribute_list_t;
115 
116 typedef struct Lc_s
117 {
118 	const char*		name;
119 	const char*		code;
120 	const Lc_language_t*	language;
121 	const Lc_territory_t*	territory;
122 	const Lc_charset_t*	charset;
123 	const Lc_attribute_list_t*	attributes;
124 	unsigned long		flags;
125 	unsigned long		index;
126 #ifdef _LC_PRIVATE_
127 	_LC_PRIVATE_
128 #endif
129 } Lc_t;
130 
131 struct Lc_category_s;
132 
133 typedef int (*Lc_category_set_f) __PROTO__((struct Lc_category_s*));
134 
135 typedef struct Lc_category_s
136 {
137 	const char*		name;
138 	int			external;
139 	int			internal;
140 	Lc_category_set_f	setf;
141 	Lc_t*			prev;
142 } Lc_category_t;
143 
144 #if _BLD_ast && defined(__EXPORT__)
145 #undef __MANGLE__
146 #define __MANGLE__ __LINKAGE__		__EXPORT__
147 #endif
148 
149 extern __MANGLE__ size_t		lccanon __PROTO__((Lc_t*, unsigned long flags, char*, size_t));
150 extern __MANGLE__ Lc_category_t*	lccategories __PROTO__((void));
151 extern __MANGLE__ int		lcindex __PROTO__((int, int));
152 extern __MANGLE__ Lc_info_t*	lcinfo __PROTO__((int));
153 extern __MANGLE__ Lc_t*		lcmake __PROTO__((const char*));
154 extern __MANGLE__ Lc_t*		lcscan __PROTO__((Lc_t*));
155 
156 #undef __MANGLE__
157 #define __MANGLE__ __LINKAGE__
158 
159 #endif
160