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 2011 Nexenta Systems, Inc. All rights reserved. 14 */ 15 16 #ifndef _CHARMAP_H 17 #define _CHARMAP_H 18 19 /* 20 * CHARMAP file handling for iconv. 21 */ 22 23 /* Common header files. */ 24 #include <stdio.h> 25 #include <stdlib.h> 26 #include <stdarg.h> 27 #include <sys/types.h> 28 #include <libintl.h> 29 30 enum cmap_pass { 31 CMAP_PASS_FROM, 32 CMAP_PASS_TO 33 }; 34 35 extern int com_char; 36 extern int esc_char; 37 extern int mb_cur_max; 38 extern int mb_cur_min; 39 extern int last_kw; 40 extern int verbose; 41 extern int yydebug; 42 extern int lineno; 43 extern int debug; 44 extern int warnings; 45 extern int cflag; 46 extern int sflag; 47 48 int yyparse(void); 49 int yyerror(const char *) __NORETURN; 50 void errf(const char *, ...); 51 void warn(const char *, ...); 52 53 void reset_scanner(const char *); 54 void scan_to_eol(void); 55 56 /* charmap.c - CHARMAP handling */ 57 void init_charmap(void); 58 void add_charmap(char *, char *); 59 void add_charmap_posix(void); 60 void add_charmap_range(char *, char *, char *); 61 62 void charmap_init(char *to, char *fr); 63 size_t cm_iconv(const char **iptr, size_t *ileft, char **optr, size_t *oleft); 64 void charmap_dump(void); 65 66 #define _(x) gettext(x) 67 68 #endif /* _CHARMAP_H */ 69