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