SysV shared memory definitions for Linux/PA.
[glibc.git] / locale / programs / charmap.h
blobf4ca3abe6c684a5a57af886cb57a00d78d07b1be
1 /* Copyright (C) 1996, 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
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 _CHARMAP_H
21 #define _CHARMAP_H
23 #include <obstack.h>
25 #include "repertoire.h"
26 #include "simple-hash.h"
29 struct width_rule
31 struct charseq *from;
32 struct charseq *to;
33 unsigned int width;
37 struct charmap_t
39 const char *code_set_name;
40 const char *repertoiremap;
41 int mb_cur_min;
42 int mb_cur_max;
44 struct width_rule *width_rules;
45 size_t nwidth_rules;
46 size_t nwidth_rules_max;
47 unsigned int width_default;
49 struct obstack mem_pool;
50 hash_table char_table;
51 hash_table byte_table;
52 hash_table ucs4_table;
56 /* This is the structure used for entries in the hash table. It represents
57 the sequence of bytes used for the coded character. */
58 struct charseq
60 const char *name;
61 uint32_t ucs4;
62 int nbytes;
63 unsigned char bytes[0];
67 /* Prototypes for charmap handling functions. */
68 extern struct charmap_t *charmap_read (const char *filename, int verbose,
69 int be_quiet, int use_default);
71 /* Return the value stored under the given key in the hashing table. */
72 extern struct charseq *charmap_find_value (const struct charmap_t *charmap,
73 const char *name, size_t len);
75 /* Return symbol for given multibyte sequence. */
76 extern struct charseq *charmap_find_symbol (const struct charmap_t *charmap,
77 const char *name, size_t len);
79 #endif /* charmap.h */