2 /* Copyright (C) 2014-2018 Free Software Foundation, Inc.
4 This file is part of groff.
6 groff is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
11 groff is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You can find the license text at
17 <http://www.gnu.org/licenses/gpl-2.0.txt>. */
22 * descriptions for mapping dvi names to
23 * font indexes and back. Dvi fonts are all
24 * 256 elements (actually only 256-32 are usable).
26 * The encoding names are taken from X -
27 * case insensitive, a dash separating the
28 * CharSetRegistry from the CharSetEncoding
31 # define DVI_MAX_SYNONYMS 10
32 # define DVI_MAP_SIZE 256
33 # define DVI_HASH_SIZE 256
35 typedef struct _dviCharNameHash {
36 struct _dviCharNameHash *next;
41 typedef struct _dviCharNameMap {
44 const char *dvi_names[DVI_MAP_SIZE][DVI_MAX_SYNONYMS];
45 DviCharNameHash *buckets[DVI_HASH_SIZE];
48 DviCharNameMap *DviFindMap (char *);
49 void DviRegisterMap (DviCharNameMap *);
51 char *DviCharName (DviCharNameMap *, int, int);
53 #define DviCharName(map,index,synonym) ((map)->dvi_names[index][synonym])
55 int DviCharIndex (DviCharNameMap *, const char *);