Back to index

glibc  2.9
repertoire.h
Go to the documentation of this file.
00001 /* Copyright (C) 1998, 1999, 2000, 2005 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published
00007    by the Free Software Foundation; version 2 of the License, or
00008    (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software Foundation,
00017    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
00018 
00019 #ifndef _REPERTOIREMAP_H
00020 #define _REPERTOIREMAP_H    1
00021 
00022 #include <obstack.h>
00023 #include <stdint.h>
00024 
00025 #include "charmap.h"
00026 #include "simple-hash.h"
00027 
00028 struct repertoire_t
00029 {
00030   const char *name;
00031   struct obstack mem_pool;
00032   hash_table char_table;
00033   hash_table reverse_table;
00034   hash_table seq_table;
00035 };
00036 
00037 
00038 /* We need one value to mark the error case.  Let's use 0xffffffff.
00039    I.e., it is placed in the last page of ISO 10646.  For now only the
00040    first is used and we have plenty of room.  */
00041 #define ILLEGAL_CHAR_VALUE ((uint32_t) 0xffffffffu)
00042 
00043 /* Another value is needed to signal that a value is not yet determined.  */
00044 #define UNINITIALIZED_CHAR_VALUE ((uint32_t) 0xfffffffeu)
00045 
00046 
00047 /* Prototypes for repertoire map handling functions.  */
00048 extern struct repertoire_t *repertoire_read (const char *filename);
00049 
00050 /* Report missing repertoire map.  */
00051 extern void repertoire_complain (const char *name);
00052 
00053 /* Return UCS4 value of character with given NAME.  */
00054 extern uint32_t repertoire_find_value (const struct repertoire_t *repertoire,
00055                                    const char *name, size_t len);
00056 
00057 /* Return symbol for given UCS4 value.  */
00058 extern const char *repertoire_find_symbol (const struct repertoire_t *repertoire,
00059                                       uint32_t ucs);
00060 
00061 /* Query the has table to memoize mapping from UCS4 to byte sequences.  */
00062 extern struct charseq *repertoire_find_seq (const struct repertoire_t *rep,
00063                                        uint32_t ucs);
00064 
00065 #endif /* repertoiremap.h */