blob: e2c36ea9e716fd245d4ba0d0de641dda3d443de8 [file] [log] [blame]
Gordon Ross48edc7c2011-05-28 21:30:16 -04001/*
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
30enum cmap_pass {
31 CMAP_PASS_FROM,
32 CMAP_PASS_TO
33};
34
35extern int com_char;
36extern int esc_char;
37extern int mb_cur_max;
38extern int mb_cur_min;
39extern int last_kw;
40extern int verbose;
41extern int yydebug;
42extern int lineno;
43extern int debug;
44extern int warnings;
45extern int cflag;
46extern int sflag;
47
48int yyparse(void);
49void yyerror(const char *);
50void errf(const char *, ...);
51void warn(const char *, ...);
52
53void reset_scanner(const char *);
54void scan_to_eol(void);
55
56/* charmap.c - CHARMAP handling */
57void init_charmap(void);
58void add_charmap(char *, char *);
59void add_charmap_posix(void);
60void add_charmap_range(char *, char *, char *);
61
62void charmap_init(char *to, char *fr);
63size_t cm_iconv(const char **iptr, size_t *ileft, char **optr, size_t *oleft);
64void charmap_dump(void);
65
66#define _(x) gettext(x)
67
68#endif /* _CHARMAP_H */