]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/groff/src/include/DviChar.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / groff / src / include / DviChar.h
1 /*
2  * DviChar.h
3  *
4  * descriptions for mapping dvi names to
5  * font indexes and back.  Dvi fonts are all
6  * 256 elements (actually only 256-32 are usable).
7  *
8  * The encoding names are taken from X -
9  * case insensitive, a dash separating the
10  * CharSetRegistry from the CharSetEncoding
11  */
12
13 # define DVI_MAX_SYNONYMS       10
14 # define DVI_MAP_SIZE           256
15 # define DVI_HASH_SIZE          256
16
17 typedef struct _dviCharNameHash {
18         struct _dviCharNameHash *next;
19         const char              *name;
20         int                     position;
21 } DviCharNameHash;
22
23 typedef struct _dviCharNameMap {
24     const char          *encoding;
25     int                 special;
26     const char          *dvi_names[DVI_MAP_SIZE][DVI_MAX_SYNONYMS];
27     DviCharNameHash     *buckets[DVI_HASH_SIZE];
28 } DviCharNameMap;
29
30 DviCharNameMap          *DviFindMap (char *);
31 void                    DviRegisterMap (DviCharNameMap *);
32 #ifdef NOTDEF
33 char                    *DviCharName (DviCharNameMap *, int, int);
34 #else
35 #define DviCharName(map,index,synonym)  ((map)->dvi_names[index][synonym])
36 #endif
37 int                     DviCharIndex (DviCharNameMap *, const char *);