1 /* Copyright (C) 1998-2019 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; version 2 of the License, or
8 (at your option) any later version.
10 This program 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
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, see <https://www.gnu.org/licenses/>. */
18 #ifndef _REPERTOIREMAP_H
19 #define _REPERTOIREMAP_H 1
25 #include "simple-hash.h"
30 struct obstack mem_pool
;
31 hash_table char_table
;
32 hash_table reverse_table
;
37 /* We need one value to mark the error case. Let's use 0xffffffff.
38 I.e., it is placed in the last page of ISO 10646. For now only the
39 first is used and we have plenty of room. */
40 #define ILLEGAL_CHAR_VALUE ((uint32_t) 0xffffffffu)
42 /* Another value is needed to signal that a value is not yet determined. */
43 #define UNINITIALIZED_CHAR_VALUE ((uint32_t) 0xfffffffeu)
46 /* Prototypes for repertoire map handling functions. */
47 extern struct repertoire_t
*repertoire_read (const char *filename
);
49 /* Report missing repertoire map. */
50 extern void repertoire_complain (const char *name
);
52 /* Return UCS4 value of character with given NAME. */
53 extern uint32_t repertoire_find_value (const struct repertoire_t
*repertoire
,
54 const char *name
, size_t len
);
56 /* Return symbol for given UCS4 value. */
57 extern const char *repertoire_find_symbol (const struct repertoire_t
*repertoire
,
60 /* Query the has table to memoize mapping from UCS4 to byte sequences. */
61 extern struct charseq
*repertoire_find_seq (const struct repertoire_t
*rep
,
64 #endif /* repertoiremap.h */