xref: /titanic_50/usr/src/cmd/localedef/localedef.h (revision b3700b074e637f8c6991b70754c88a2cfffb246b)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy is of the CDDL is also available via the Internet
9  * at http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
14  * Copyright 2013 DEY Storage Systmes, Inc.
15  */
16 
17 /*
18  * POSIX localedef.
19  */
20 
21 /* Common header files. */
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <stdarg.h>
25 #include <sys/types.h>
26 #include <libintl.h>
27 
28 extern int com_char;
29 extern int esc_char;
30 extern int mb_cur_max;
31 extern int mb_cur_min;
32 extern int last_kw;
33 extern int verbose;
34 extern int yydebug;
35 extern int lineno;
36 extern int undefok;	/* mostly ignore undefined symbols */
37 extern int warnok;
38 extern int warnings;
39 
40 void yyerror(const char *);
41 void errf(const char *, ...);
42 void warn(const char *, ...);
43 
44 int putl_category(const char *, FILE *);
45 int wr_category(void *, size_t, FILE *);
46 FILE *open_category(void);
47 void close_category(FILE *);
48 void copy_category(char *);
49 
50 int get_category(void);
51 void reset_scanner(const char *);
52 void scan_to_eol(void);
53 void add_wcs(wchar_t);
54 wchar_t *get_wcs(void);
55 
56 /* charmap.c - CHARMAP handling */
57 void init_charmap(void);
58 void add_charmap(char *, int);
59 void add_charmap_undefined(char *);
60 void add_charmap_posix(void);
61 void add_charmap_range(char *, char *, int);
62 int lookup_charmap(const char *, wchar_t *);
63 int check_charmap_undefined(char *);
64 int check_charmap(wchar_t);
65 
66 /* collate.o - LC_COLLATE handling */
67 typedef struct collelem collelem_t;
68 typedef struct collsym collsym_t;
69 void init_collate(void);
70 void define_collsym(char *);
71 void define_collelem(char *, wchar_t *);
72 void add_order_directive(void);
73 void add_order_bit(int);
74 void dump_collate(void);
75 collsym_t *lookup_collsym(char *);
76 collelem_t *lookup_collelem(char *);
77 void start_order_collelem(collelem_t *);
78 void start_order_undefined(void);
79 void start_order_symbol(char *);
80 void start_order_char(wchar_t);
81 void start_order_ellipsis(void);
82 void end_order_collsym(collsym_t *);
83 void end_order(void);
84 void add_weight_num(int);
85 void add_order_collelem(collelem_t *);
86 void add_order_collsym(collsym_t *);
87 void add_order_char(wchar_t);
88 void add_order_ignore(void);
89 void add_order_ellipsis(void);
90 void add_order_symbol(char *);
91 void add_order_subst(void);
92 void add_subst_char(wchar_t);
93 void add_subst_collsym(collsym_t *);
94 void add_subst_collelem(collelem_t *);
95 void add_subst_symbol(char *);
96 
97 /* ctype.c - LC_CTYPE handling */
98 void init_ctype(void);
99 void add_ctype(int);
100 void add_ctype_range(int);
101 void add_width(int, int);
102 void add_width_range(int, int, int);
103 void add_caseconv(int, int);
104 void dump_ctype(void);
105 
106 /* messages.c - LC_MESSAGES handling */
107 void init_messages(void);
108 void add_message(wchar_t *);
109 void dump_messages(void);
110 
111 /* monetary.c - LC_MONETARY handling */
112 void init_monetary(void);
113 void add_monetary_str(wchar_t *);
114 void add_monetary_num(int);
115 void reset_monetary_group(void);
116 void add_monetary_group(int);
117 void dump_monetary(void);
118 
119 /* numeric.c - LC_NUMERIC handling */
120 void init_numeric(void);
121 void add_numeric_str(wchar_t *);
122 void reset_numeric_group(void);
123 void add_numeric_group(int);
124 void dump_numeric(void);
125 
126 /* time.c - LC_TIME handling */
127 void init_time(void);
128 void add_time_str(wchar_t *);
129 void reset_time_list(void);
130 void add_time_list(wchar_t *);
131 void check_time_list(void);
132 void dump_time(void);
133 
134 /* wide.c -  Wide character handling. */
135 int to_wide(wchar_t *, const char *);
136 int to_mbs(char *, wchar_t);
137 char *to_mb_string(const wchar_t *);
138 void set_wide_encoding(const char *);
139 const char *get_wide_encoding(void);
140 int max_wide(void);
141 
142 #define	_(x)	gettext(x)
143 #define	INTERR	errf(_("internal fault (%s:%d)"), __FILE__, __LINE__)
144