Update.
[glibc.git] / locale / programs / charmap.h
bloba4a6d3833ba7182ebd2461a63f649cfca4a708f3
1 /* Copyright (C) 1996-1999, 2001, 2003 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
20 #ifndef _CHARMAP_H
21 #define _CHARMAP_H
23 #include <obstack.h>
24 #include <stdbool.h>
26 #include "repertoire.h"
27 #include "simple-hash.h"
30 struct width_rule
32 struct charseq *from;
33 struct charseq *to;
34 unsigned int width;
38 struct charmap_t
40 const char *code_set_name;
41 const char *repertoiremap;
42 int mb_cur_min;
43 int mb_cur_max;
45 struct width_rule *width_rules;
46 size_t nwidth_rules;
47 size_t nwidth_rules_max;
48 unsigned int width_default;
50 struct obstack mem_pool;
51 hash_table char_table;
52 hash_table byte_table;
53 hash_table ucs4_table;
57 /* This is the structure used for entries in the hash table. It represents
58 the sequence of bytes used for the coded character. */
59 struct charseq
61 const char *name;
62 uint32_t ucs4;
63 int nbytes;
64 unsigned char bytes[0];
68 /* True if the encoding is not ASCII compatible. */
69 extern bool enc_not_ascii_compatible;
72 /* Prototypes for charmap handling functions. */
73 extern struct charmap_t *charmap_read (const char *filename, int verbose,
74 int be_quiet, int use_default);
76 /* Return the value stored under the given key in the hashing table. */
77 extern struct charseq *charmap_find_value (const struct charmap_t *charmap,
78 const char *name, size_t len);
80 /* Return symbol for given multibyte sequence. */
81 extern struct charseq *charmap_find_symbol (const struct charmap_t *charmap,
82 const char *name, size_t len);
84 #endif /* charmap.h */