(register_dump): Don't write '\0' to the fd.
[glibc/history.git] / locale / programs / repertoire.h
blob75877044ca441405808203ce0ee7b54b3e465870
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 version 2 as
7 published by the Free Software Foundation.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software Foundation,
16 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
18 #ifndef _REPERTOIREMAP_H
19 #define _REPERTOIREMAP_H 1
21 #include <obstack.h>
22 #include <stdint.h>
24 #include "charmap.h"
25 #include "simple-hash.h"
27 struct repertoire_t
29 const char *name;
30 struct obstack mem_pool;
31 hash_table char_table;
32 hash_table reverse_table;
33 hash_table seq_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,
58 uint32_t ucs);
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,
62 uint32_t ucs);
64 #endif /* repertoiremap.h */