Blame locale/programs/repertoire.h

Packit 6c4009
/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
Packit 6c4009
Packit 6c4009
   This program is free software; you can redistribute it and/or modify
Packit 6c4009
   it under the terms of the GNU General Public License as published
Packit 6c4009
   by the Free Software Foundation; version 2 of the License, or
Packit 6c4009
   (at your option) any later version.
Packit 6c4009
Packit 6c4009
   This program is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 6c4009
   GNU General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU General Public License
Packit 6c4009
   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _REPERTOIREMAP_H
Packit 6c4009
#define _REPERTOIREMAP_H	1
Packit 6c4009
Packit 6c4009
#include <obstack.h>
Packit 6c4009
#include <stdint.h>
Packit 6c4009
Packit 6c4009
#include "charmap.h"
Packit 6c4009
#include "simple-hash.h"
Packit 6c4009
Packit 6c4009
struct repertoire_t
Packit 6c4009
{
Packit 6c4009
  const char *name;
Packit 6c4009
  struct obstack mem_pool;
Packit 6c4009
  hash_table char_table;
Packit 6c4009
  hash_table reverse_table;
Packit 6c4009
  hash_table seq_table;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* We need one value to mark the error case.  Let's use 0xffffffff.
Packit 6c4009
   I.e., it is placed in the last page of ISO 10646.  For now only the
Packit 6c4009
   first is used and we have plenty of room.  */
Packit 6c4009
#define ILLEGAL_CHAR_VALUE ((uint32_t) 0xffffffffu)
Packit 6c4009
Packit 6c4009
/* Another value is needed to signal that a value is not yet determined.  */
Packit 6c4009
#define UNINITIALIZED_CHAR_VALUE ((uint32_t) 0xfffffffeu)
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Prototypes for repertoire map handling functions.  */
Packit 6c4009
extern struct repertoire_t *repertoire_read (const char *filename);
Packit 6c4009
Packit 6c4009
/* Report missing repertoire map.  */
Packit 6c4009
extern void repertoire_complain (const char *name);
Packit 6c4009
Packit 6c4009
/* Return UCS4 value of character with given NAME.  */
Packit 6c4009
extern uint32_t repertoire_find_value (const struct repertoire_t *repertoire,
Packit 6c4009
				       const char *name, size_t len);
Packit 6c4009
Packit 6c4009
/* Return symbol for given UCS4 value.  */
Packit 6c4009
extern const char *repertoire_find_symbol (const struct repertoire_t *repertoire,
Packit 6c4009
					   uint32_t ucs);
Packit 6c4009
Packit 6c4009
/* Query the has table to memoize mapping from UCS4 to byte sequences.  */
Packit 6c4009
extern struct charseq *repertoire_find_seq (const struct repertoire_t *rep,
Packit 6c4009
					    uint32_t ucs);
Packit 6c4009
Packit 6c4009
#endif /* repertoiremap.h */