]> git.ipfire.org Git - thirdparty/glibc.git/blame - locale/programs/repertoire.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / locale / programs / repertoire.h
CommitLineData
04277e02 1/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
69f155d4
UD
2 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
4
43bc8ac6 5 This program is free software; you can redistribute it and/or modify
2e2efe65
RM
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.
69f155d4 9
43bc8ac6 10 This program is distributed in the hope that it will be useful,
69f155d4 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
43bc8ac6
UD
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
69f155d4 14
43bc8ac6 15 You should have received a copy of the GNU General Public License
59ba27a6 16 along with this program; if not, see <http://www.gnu.org/licenses/>. */
69f155d4
UD
17
18#ifndef _REPERTOIREMAP_H
19#define _REPERTOIREMAP_H 1
20
21#include <obstack.h>
4b10dd6c 22#include <stdint.h>
69f155d4 23
4b10dd6c 24#include "charmap.h"
69f155d4 25#include "simple-hash.h"
69f155d4
UD
26
27struct repertoire_t
28{
4b10dd6c 29 const char *name;
69f155d4
UD
30 struct obstack mem_pool;
31 hash_table char_table;
4b10dd6c
UD
32 hash_table reverse_table;
33 hash_table seq_table;
69f155d4
UD
34};
35
36
4b10dd6c
UD
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)
41
42/* Another value is needed to signal that a value is not yet determined. */
43#define UNINITIALIZED_CHAR_VALUE ((uint32_t) 0xfffffffeu)
44
45
69f155d4 46/* Prototypes for repertoire map handling functions. */
4b10dd6c
UD
47extern struct repertoire_t *repertoire_read (const char *filename);
48
3c833378
UD
49/* Report missing repertoire map. */
50extern void repertoire_complain (const char *name);
51
4b10dd6c
UD
52/* Return UCS4 value of character with given NAME. */
53extern uint32_t repertoire_find_value (const struct repertoire_t *repertoire,
54 const char *name, size_t len);
55
56/* Return symbol for given UCS4 value. */
57extern const char *repertoire_find_symbol (const struct repertoire_t *repertoire,
58 uint32_t ucs);
59
60/* Query the has table to memoize mapping from UCS4 to byte sequences. */
61extern struct charseq *repertoire_find_seq (const struct repertoire_t *rep,
62 uint32_t ucs);
69f155d4
UD
63
64#endif /* repertoiremap.h */