xref: /netbsd-src/external/gpl2/groff/dist/src/include/DviChar.h (revision 89a07cf815a29524268025a1139fac4c5190f765)
1 /*	$NetBSD: DviChar.h,v 1.1.1.1 2016/01/13 18:41:48 christos Exp $	*/
2 
3 /*
4  * DviChar.h
5  *
6  * descriptions for mapping dvi names to
7  * font indexes and back.  Dvi fonts are all
8  * 256 elements (actually only 256-32 are usable).
9  *
10  * The encoding names are taken from X -
11  * case insensitive, a dash separating the
12  * CharSetRegistry from the CharSetEncoding
13  */
14 
15 # define DVI_MAX_SYNONYMS	10
16 # define DVI_MAP_SIZE		256
17 # define DVI_HASH_SIZE		256
18 
19 typedef struct _dviCharNameHash {
20 	struct _dviCharNameHash	*next;
21 	const char		*name;
22 	int			position;
23 } DviCharNameHash;
24 
25 typedef struct _dviCharNameMap {
26     const char		*encoding;
27     int			special;
28     const char		*dvi_names[DVI_MAP_SIZE][DVI_MAX_SYNONYMS];
29     DviCharNameHash	*buckets[DVI_HASH_SIZE];
30 } DviCharNameMap;
31 
32 DviCharNameMap		*DviFindMap (char *);
33 void			DviRegisterMap (DviCharNameMap *);
34 #ifdef NOTDEF
35 char			*DviCharName (DviCharNameMap *, int, int);
36 #else
37 #define DviCharName(map,index,synonym)	((map)->dvi_names[index][synonym])
38 #endif
39 int			DviCharIndex (DviCharNameMap *, const char *);
40