xref: /illumos-gate/usr/src/cmd/localedef/localedef.h (revision 7262c8a6)
16b5e5868SGarrett D'Amore /*
26b5e5868SGarrett D'Amore  * This file and its contents are supplied under the terms of the
36b5e5868SGarrett D'Amore  * Common Development and Distribution License ("CDDL"), version 1.0.
45aec55ebSGarrett D'Amore  * You may only use this file in accordance with the terms of version
56b5e5868SGarrett D'Amore  * 1.0 of the CDDL.
66b5e5868SGarrett D'Amore  *
76b5e5868SGarrett D'Amore  * A full copy of the text of the CDDL should have accompanied this
86b5e5868SGarrett D'Amore  * source.  A copy is of the CDDL is also available via the Internet
96b5e5868SGarrett D'Amore  * at http://www.illumos.org/license/CDDL.
106b5e5868SGarrett D'Amore  */
116b5e5868SGarrett D'Amore 
126b5e5868SGarrett D'Amore /*
13e1508819SYuri Pankov  * Copyright 2017 Nexenta Systems, Inc.
142da1cd3aSGarrett D'Amore  * Copyright 2013 DEY Storage Systmes, Inc.
156b5e5868SGarrett D'Amore  */
166b5e5868SGarrett D'Amore 
176b5e5868SGarrett D'Amore /*
186b5e5868SGarrett D'Amore  * POSIX localedef.
196b5e5868SGarrett D'Amore  */
206b5e5868SGarrett D'Amore 
216b5e5868SGarrett D'Amore /* Common header files. */
226b5e5868SGarrett D'Amore #include <stdio.h>
236b5e5868SGarrett D'Amore #include <stdlib.h>
246b5e5868SGarrett D'Amore #include <stdarg.h>
256b5e5868SGarrett D'Amore #include <sys/types.h>
266b5e5868SGarrett D'Amore #include <libintl.h>
276b5e5868SGarrett D'Amore 
286b5e5868SGarrett D'Amore extern int com_char;
296b5e5868SGarrett D'Amore extern int esc_char;
306b5e5868SGarrett D'Amore extern int mb_cur_max;
316b5e5868SGarrett D'Amore extern int mb_cur_min;
326b5e5868SGarrett D'Amore extern int last_kw;
336b5e5868SGarrett D'Amore extern int verbose;
346b5e5868SGarrett D'Amore extern int yydebug;
356b5e5868SGarrett D'Amore extern int lineno;
366b5e5868SGarrett D'Amore extern int undefok;	/* mostly ignore undefined symbols */
376b5e5868SGarrett D'Amore extern int warnok;
386b5e5868SGarrett D'Amore extern int warnings;
396b5e5868SGarrett D'Amore 
406b5e5868SGarrett D'Amore void yyerror(const char *);
416b5e5868SGarrett D'Amore void errf(const char *, ...);
426b5e5868SGarrett D'Amore void warn(const char *, ...);
436b5e5868SGarrett D'Amore 
446b5e5868SGarrett D'Amore int putl_category(const char *, FILE *);
456b5e5868SGarrett D'Amore int wr_category(void *, size_t, FILE *);
466b5e5868SGarrett D'Amore FILE *open_category(void);
47e1508819SYuri Pankov void delete_category(FILE *);
486b5e5868SGarrett D'Amore void close_category(FILE *);
496b5e5868SGarrett D'Amore void copy_category(char *);
506b5e5868SGarrett D'Amore 
516b5e5868SGarrett D'Amore int get_category(void);
526b5e5868SGarrett D'Amore void reset_scanner(const char *);
536b5e5868SGarrett D'Amore void scan_to_eol(void);
546b5e5868SGarrett D'Amore void add_wcs(wchar_t);
556b5e5868SGarrett D'Amore wchar_t *get_wcs(void);
566b5e5868SGarrett D'Amore 
576b5e5868SGarrett D'Amore /* charmap.c - CHARMAP handling */
586b5e5868SGarrett D'Amore void init_charmap(void);
59*7262c8a6SYuri Pankov void add_charmap(const char *, int);
606b5e5868SGarrett D'Amore void add_charmap_undefined(char *);
616b5e5868SGarrett D'Amore void add_charmap_posix(void);
626b5e5868SGarrett D'Amore void add_charmap_range(char *, char *, int);
63*7262c8a6SYuri Pankov void add_charmap_char(const char *name, int val);
646b5e5868SGarrett D'Amore int lookup_charmap(const char *, wchar_t *);
656b5e5868SGarrett D'Amore int check_charmap_undefined(char *);
666b5e5868SGarrett D'Amore int check_charmap(wchar_t);
676b5e5868SGarrett D'Amore 
686b5e5868SGarrett D'Amore /* collate.o - LC_COLLATE handling */
696b5e5868SGarrett D'Amore typedef struct collelem collelem_t;
706b5e5868SGarrett D'Amore typedef struct collsym collsym_t;
716b5e5868SGarrett D'Amore void init_collate(void);
726b5e5868SGarrett D'Amore void define_collsym(char *);
736b5e5868SGarrett D'Amore void define_collelem(char *, wchar_t *);
746b5e5868SGarrett D'Amore void add_order_directive(void);
756b5e5868SGarrett D'Amore void add_order_bit(int);
766b5e5868SGarrett D'Amore void dump_collate(void);
776b5e5868SGarrett D'Amore collsym_t *lookup_collsym(char *);
786b5e5868SGarrett D'Amore collelem_t *lookup_collelem(char *);
796b5e5868SGarrett D'Amore void start_order_collelem(collelem_t *);
806b5e5868SGarrett D'Amore void start_order_undefined(void);
816b5e5868SGarrett D'Amore void start_order_symbol(char *);
826b5e5868SGarrett D'Amore void start_order_char(wchar_t);
836b5e5868SGarrett D'Amore void start_order_ellipsis(void);
846b5e5868SGarrett D'Amore void end_order_collsym(collsym_t *);
856b5e5868SGarrett D'Amore void end_order(void);
866b5e5868SGarrett D'Amore void add_weight_num(int);
876b5e5868SGarrett D'Amore void add_order_collelem(collelem_t *);
886b5e5868SGarrett D'Amore void add_order_collsym(collsym_t *);
896b5e5868SGarrett D'Amore void add_order_char(wchar_t);
906b5e5868SGarrett D'Amore void add_order_ignore(void);
916b5e5868SGarrett D'Amore void add_order_ellipsis(void);
926b5e5868SGarrett D'Amore void add_order_symbol(char *);
936b5e5868SGarrett D'Amore void add_order_subst(void);
946b5e5868SGarrett D'Amore void add_subst_char(wchar_t);
956b5e5868SGarrett D'Amore void add_subst_collsym(collsym_t *);
966b5e5868SGarrett D'Amore void add_subst_collelem(collelem_t *);
976b5e5868SGarrett D'Amore void add_subst_symbol(char *);
986b5e5868SGarrett D'Amore 
996b5e5868SGarrett D'Amore /* ctype.c - LC_CTYPE handling */
1006b5e5868SGarrett D'Amore void init_ctype(void);
1016b5e5868SGarrett D'Amore void add_ctype(int);
102*7262c8a6SYuri Pankov void add_ctype_range(wchar_t);
1032da1cd3aSGarrett D'Amore void add_width(int, int);
1042da1cd3aSGarrett D'Amore void add_width_range(int, int, int);
1056b5e5868SGarrett D'Amore void add_caseconv(int, int);
1066b5e5868SGarrett D'Amore void dump_ctype(void);
1076b5e5868SGarrett D'Amore 
1086b5e5868SGarrett D'Amore /* messages.c - LC_MESSAGES handling */
1096b5e5868SGarrett D'Amore void init_messages(void);
1106b5e5868SGarrett D'Amore void add_message(wchar_t *);
1116b5e5868SGarrett D'Amore void dump_messages(void);
1126b5e5868SGarrett D'Amore 
1136b5e5868SGarrett D'Amore /* monetary.c - LC_MONETARY handling */
1146b5e5868SGarrett D'Amore void init_monetary(void);
1156b5e5868SGarrett D'Amore void add_monetary_str(wchar_t *);
1166b5e5868SGarrett D'Amore void add_monetary_num(int);
1176b5e5868SGarrett D'Amore void reset_monetary_group(void);
1186b5e5868SGarrett D'Amore void add_monetary_group(int);
1196b5e5868SGarrett D'Amore void dump_monetary(void);
1206b5e5868SGarrett D'Amore 
1216b5e5868SGarrett D'Amore /* numeric.c - LC_NUMERIC handling */
1226b5e5868SGarrett D'Amore void init_numeric(void);
1236b5e5868SGarrett D'Amore void add_numeric_str(wchar_t *);
1246b5e5868SGarrett D'Amore void reset_numeric_group(void);
1256b5e5868SGarrett D'Amore void add_numeric_group(int);
1266b5e5868SGarrett D'Amore void dump_numeric(void);
1276b5e5868SGarrett D'Amore 
1286b5e5868SGarrett D'Amore /* time.c - LC_TIME handling */
1296b5e5868SGarrett D'Amore void init_time(void);
1306b5e5868SGarrett D'Amore void add_time_str(wchar_t *);
1316b5e5868SGarrett D'Amore void reset_time_list(void);
1326b5e5868SGarrett D'Amore void add_time_list(wchar_t *);
1336b5e5868SGarrett D'Amore void check_time_list(void);
1346b5e5868SGarrett D'Amore void dump_time(void);
1356b5e5868SGarrett D'Amore 
1366b5e5868SGarrett D'Amore /* wide.c -  Wide character handling. */
1376b5e5868SGarrett D'Amore int to_wide(wchar_t *, const char *);
1386b5e5868SGarrett D'Amore int to_mbs(char *, wchar_t);
1396b5e5868SGarrett D'Amore char *to_mb_string(const wchar_t *);
1406b5e5868SGarrett D'Amore void set_wide_encoding(const char *);
1416b5e5868SGarrett D'Amore const char *get_wide_encoding(void);
142723fee08SGarrett D'Amore int max_wide(void);
1436b5e5868SGarrett D'Amore 
1446b5e5868SGarrett D'Amore #define	_(x)	gettext(x)
1456b5e5868SGarrett D'Amore #define	INTERR	errf(_("internal fault (%s:%d)"), __FILE__, __LINE__)
146