]> git.ipfire.org Git - thirdparty/glibc.git/blame - locale/programs/charmap.h
Update.
[thirdparty/glibc.git] / locale / programs / charmap.h
CommitLineData
4b10dd6c 1/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
6d52618b 2 This file is part of the GNU C Library.
4b10dd6c 3 Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
19bc17a9 4
6d52618b
UD
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
19bc17a9 9
6d52618b
UD
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 Library General Public License for more details.
19bc17a9 14
6d52618b
UD
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
19bc17a9 19
4b10dd6c
UD
20#ifndef _CHARMAP_H
21#define _CHARMAP_H
19bc17a9
RM
22
23#include <obstack.h>
24
69f155d4 25#include "repertoire.h"
19bc17a9 26#include "simple-hash.h"
19bc17a9
RM
27
28
75cd5204
RM
29struct width_rule
30{
4b10dd6c
UD
31 struct charseq *from;
32 struct charseq *to;
75cd5204
RM
33 unsigned int width;
34};
35
36
4b10dd6c 37struct charmap_t
19bc17a9
RM
38{
39 const char *code_set_name;
4b10dd6c 40 const char *repertoiremap;
19bc17a9
RM
41 int mb_cur_min;
42 int mb_cur_max;
75cd5204
RM
43
44 struct width_rule *width_rules;
45 size_t nwidth_rules;
46 size_t nwidth_rules_max;
ba1ffaa1 47 unsigned int width_default;
19bc17a9
RM
48
49 struct obstack mem_pool;
50 hash_table char_table;
4b10dd6c
UD
51 hash_table byte_table;
52 hash_table ucs4_table;
19bc17a9
RM
53};
54
55
4b10dd6c
UD
56/* This is the structure used for entries in the hash table. It represents
57 the sequence of bytes used for the coded character. */
58struct charseq
59{
60 const char *name;
61 uint32_t ucs4;
62 int nbytes;
63 unsigned char bytes[0];
64};
19bc17a9 65
c84142e8 66
19bc17a9 67/* Prototypes for charmap handling functions. */
4b10dd6c 68extern struct charmap_t *charmap_read (const char *filename);
19bc17a9 69
69f155d4 70/* Return the value stored under the given key in the hashing table. */
4b10dd6c
UD
71extern struct charseq *charmap_find_value (const struct charmap_t *charmap,
72 const char *name, size_t len);
73
74/* Return symbol for given multibyte sequence. */
75extern struct charseq *charmap_find_symbol (const struct charmap_t *charmap,
76 const char *name, size_t len);
19bc17a9 77
4b10dd6c 78#endif /* charmap.h */