2.9
[glibc/nacl-glibc.git] / locale / programs / repertoire.h
blob2e1f7ae1926d592e5b23cb0ba18d700b780d3383
1 /* Copyright (C) 1998, 1999, 2000, 2005 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, write to the Free Software Foundation,
17 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
19 #ifndef _REPERTOIREMAP_H
20 #define _REPERTOIREMAP_H 1
22 #include <obstack.h>
23 #include <stdint.h>
25 #include "charmap.h"
26 #include "simple-hash.h"
28 struct repertoire_t
30 const char *name;
31 struct obstack mem_pool;
32 hash_table char_table;
33 hash_table reverse_table;
34 hash_table seq_table;
38 /* We need one value to mark the error case. Let's use 0xffffffff.
39 I.e., it is placed in the last page of ISO 10646. For now only the
40 first is used and we have plenty of room. */
41 #define ILLEGAL_CHAR_VALUE ((uint32_t) 0xffffffffu)
43 /* Another value is needed to signal that a value is not yet determined. */
44 #define UNINITIALIZED_CHAR_VALUE ((uint32_t) 0xfffffffeu)
47 /* Prototypes for repertoire map handling functions. */
48 extern struct repertoire_t *repertoire_read (const char *filename);
50 /* Report missing repertoire map. */
51 extern void repertoire_complain (const char *name);
53 /* Return UCS4 value of character with given NAME. */
54 extern uint32_t repertoire_find_value (const struct repertoire_t *repertoire,
55 const char *name, size_t len);
57 /* Return symbol for given UCS4 value. */
58 extern const char *repertoire_find_symbol (const struct repertoire_t *repertoire,
59 uint32_t ucs);
61 /* Query the has table to memoize mapping from UCS4 to byte sequences. */
62 extern struct charseq *repertoire_find_seq (const struct repertoire_t *rep,
63 uint32_t ucs);
65 #endif /* repertoiremap.h */