Updated to fedora-glibc-20050523T1354
[glibc.git] / locale / programs / repertoire.h
blobd463c81690a5d3deeb76cd69ea52b03e17fe652b
1 /* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
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 _REPERTOIREMAP_H
21 #define _REPERTOIREMAP_H 1
23 #include <obstack.h>
24 #include <stdint.h>
26 #include "charmap.h"
27 #include "simple-hash.h"
29 struct repertoire_t
31 const char *name;
32 struct obstack mem_pool;
33 hash_table char_table;
34 hash_table reverse_table;
35 hash_table seq_table;
39 /* We need one value to mark the error case. Let's use 0xffffffff.
40 I.e., it is placed in the last page of ISO 10646. For now only the
41 first is used and we have plenty of room. */
42 #define ILLEGAL_CHAR_VALUE ((uint32_t) 0xffffffffu)
44 /* Another value is needed to signal that a value is not yet determined. */
45 #define UNINITIALIZED_CHAR_VALUE ((uint32_t) 0xfffffffeu)
48 /* Prototypes for repertoire map handling functions. */
49 extern struct repertoire_t *repertoire_read (const char *filename);
51 /* Report missing repertoire map. */
52 extern void repertoire_complain (const char *name);
54 /* Return UCS4 value of character with given NAME. */
55 extern uint32_t repertoire_find_value (const struct repertoire_t *repertoire,
56 const char *name, size_t len);
58 /* Return symbol for given UCS4 value. */
59 extern const char *repertoire_find_symbol (const struct repertoire_t *repertoire,
60 uint32_t ucs);
62 /* Query the has table to memoize mapping from UCS4 to byte sequences. */
63 extern struct charseq *repertoire_find_seq (const struct repertoire_t *rep,
64 uint32_t ucs);
66 #endif /* repertoiremap.h */