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 /* 136b5e5868SGarrett D'Amore * Copyright 2010 Nexenta Systems, Inc. All rights reserved. 14*2da1cd3aSGarrett 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); 476b5e5868SGarrett D'Amore void close_category(FILE *); 486b5e5868SGarrett D'Amore void copy_category(char *); 496b5e5868SGarrett D'Amore 506b5e5868SGarrett D'Amore int get_category(void); 516b5e5868SGarrett D'Amore void reset_scanner(const char *); 526b5e5868SGarrett D'Amore void scan_to_eol(void); 536b5e5868SGarrett D'Amore void add_wcs(wchar_t); 546b5e5868SGarrett D'Amore wchar_t *get_wcs(void); 556b5e5868SGarrett D'Amore 566b5e5868SGarrett D'Amore /* charmap.c - CHARMAP handling */ 576b5e5868SGarrett D'Amore void init_charmap(void); 586b5e5868SGarrett D'Amore void add_charmap(char *, int); 596b5e5868SGarrett D'Amore void add_charmap_undefined(char *); 606b5e5868SGarrett D'Amore void add_charmap_posix(void); 616b5e5868SGarrett D'Amore void add_charmap_range(char *, char *, int); 626b5e5868SGarrett D'Amore int lookup_charmap(const char *, wchar_t *); 636b5e5868SGarrett D'Amore int check_charmap_undefined(char *); 646b5e5868SGarrett D'Amore int check_charmap(wchar_t); 656b5e5868SGarrett D'Amore 666b5e5868SGarrett D'Amore /* collate.o - LC_COLLATE handling */ 676b5e5868SGarrett D'Amore typedef struct collelem collelem_t; 686b5e5868SGarrett D'Amore typedef struct collsym collsym_t; 696b5e5868SGarrett D'Amore void init_collate(void); 706b5e5868SGarrett D'Amore void define_collsym(char *); 716b5e5868SGarrett D'Amore void define_collelem(char *, wchar_t *); 726b5e5868SGarrett D'Amore void add_order_directive(void); 736b5e5868SGarrett D'Amore void add_order_bit(int); 746b5e5868SGarrett D'Amore void dump_collate(void); 756b5e5868SGarrett D'Amore collsym_t *lookup_collsym(char *); 766b5e5868SGarrett D'Amore collelem_t *lookup_collelem(char *); 776b5e5868SGarrett D'Amore void start_order_collelem(collelem_t *); 786b5e5868SGarrett D'Amore void start_order_undefined(void); 796b5e5868SGarrett D'Amore void start_order_symbol(char *); 806b5e5868SGarrett D'Amore void start_order_char(wchar_t); 816b5e5868SGarrett D'Amore void start_order_ellipsis(void); 826b5e5868SGarrett D'Amore void end_order_collsym(collsym_t *); 836b5e5868SGarrett D'Amore void end_order(void); 846b5e5868SGarrett D'Amore void add_weight_num(int); 856b5e5868SGarrett D'Amore void add_order_collelem(collelem_t *); 866b5e5868SGarrett D'Amore void add_order_collsym(collsym_t *); 876b5e5868SGarrett D'Amore void add_order_char(wchar_t); 886b5e5868SGarrett D'Amore void add_order_ignore(void); 896b5e5868SGarrett D'Amore void add_order_ellipsis(void); 906b5e5868SGarrett D'Amore void add_order_symbol(char *); 916b5e5868SGarrett D'Amore void add_order_subst(void); 926b5e5868SGarrett D'Amore void add_subst_char(wchar_t); 936b5e5868SGarrett D'Amore void add_subst_collsym(collsym_t *); 946b5e5868SGarrett D'Amore void add_subst_collelem(collelem_t *); 956b5e5868SGarrett D'Amore void add_subst_symbol(char *); 966b5e5868SGarrett D'Amore 976b5e5868SGarrett D'Amore /* ctype.c - LC_CTYPE handling */ 986b5e5868SGarrett D'Amore void init_ctype(void); 996b5e5868SGarrett D'Amore void add_ctype(int); 1006b5e5868SGarrett D'Amore void add_ctype_range(int); 101*2da1cd3aSGarrett D'Amore void add_width(int, int); 102*2da1cd3aSGarrett D'Amore void add_width_range(int, int, int); 1036b5e5868SGarrett D'Amore void add_caseconv(int, int); 1046b5e5868SGarrett D'Amore void dump_ctype(void); 1056b5e5868SGarrett D'Amore 1066b5e5868SGarrett D'Amore /* messages.c - LC_MESSAGES handling */ 1076b5e5868SGarrett D'Amore void init_messages(void); 1086b5e5868SGarrett D'Amore void add_message(wchar_t *); 1096b5e5868SGarrett D'Amore void dump_messages(void); 1106b5e5868SGarrett D'Amore 1116b5e5868SGarrett D'Amore /* monetary.c - LC_MONETARY handling */ 1126b5e5868SGarrett D'Amore void init_monetary(void); 1136b5e5868SGarrett D'Amore void add_monetary_str(wchar_t *); 1146b5e5868SGarrett D'Amore void add_monetary_num(int); 1156b5e5868SGarrett D'Amore void reset_monetary_group(void); 1166b5e5868SGarrett D'Amore void add_monetary_group(int); 1176b5e5868SGarrett D'Amore void dump_monetary(void); 1186b5e5868SGarrett D'Amore 1196b5e5868SGarrett D'Amore /* numeric.c - LC_NUMERIC handling */ 1206b5e5868SGarrett D'Amore void init_numeric(void); 1216b5e5868SGarrett D'Amore void add_numeric_str(wchar_t *); 1226b5e5868SGarrett D'Amore void reset_numeric_group(void); 1236b5e5868SGarrett D'Amore void add_numeric_group(int); 1246b5e5868SGarrett D'Amore void dump_numeric(void); 1256b5e5868SGarrett D'Amore 1266b5e5868SGarrett D'Amore /* time.c - LC_TIME handling */ 1276b5e5868SGarrett D'Amore void init_time(void); 1286b5e5868SGarrett D'Amore void add_time_str(wchar_t *); 1296b5e5868SGarrett D'Amore void reset_time_list(void); 1306b5e5868SGarrett D'Amore void add_time_list(wchar_t *); 1316b5e5868SGarrett D'Amore void check_time_list(void); 1326b5e5868SGarrett D'Amore void dump_time(void); 1336b5e5868SGarrett D'Amore 1346b5e5868SGarrett D'Amore /* wide.c - Wide character handling. */ 1356b5e5868SGarrett D'Amore int to_wide(wchar_t *, const char *); 1366b5e5868SGarrett D'Amore int to_mbs(char *, wchar_t); 1376b5e5868SGarrett D'Amore char *to_mb_string(const wchar_t *); 1386b5e5868SGarrett D'Amore void set_wide_encoding(const char *); 1396b5e5868SGarrett D'Amore const char *get_wide_encoding(void); 140723fee08SGarrett D'Amore int max_wide(void); 1416b5e5868SGarrett D'Amore 1426b5e5868SGarrett D'Amore #define _(x) gettext(x) 1436b5e5868SGarrett D'Amore #define INTERR errf(_("internal fault (%s:%d)"), __FILE__, __LINE__) 144