summaryrefslogtreecommitdiff
path: root/dviware/ivd2dvi/global.h
blob: 27bcb6736784dc4c8d750beea4c1f09070f53fc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
 *  Global definitions for ivd2dvi.  Copyright 1988 by Larry Denenberg.
 *  May be freely distributed as long as this notice is retained.
 */

#define TRUE		  1
#define FALSE		  0


/*
 *  Buffer sizing and allocation is explained in io.c.
 */
#define BUFDEFAULTSIZE 1024
#define SMALLBUFDIVISOR	 16
#define MAXFILENAMESIZE 256
#define TFMAREADEFAULT	"/usr/local/lib/tex/fonts"


/*
 *  Values of /State/;  see the overview in ivd2dvi.c.
 */
#define LTYPESETTING	  0
#define RTYPESETTING	  1
#define SIMULATING	  2


/*
 *  Allocate an object of type T or a sequence of N such objects.
 */
#define OBJALLOC(T)	((T *) malloc(sizeof(T)))
#define SEQALLOC(N,T)	((T *) calloc((unsigned) N, sizeof(T)))


/*
 *  Library routines declared to avoid lint errors.
 */
extern char *calloc(), *malloc(), *rindex(), *index(), *getenv();
extern void exit();


/*
 *  Useful types.  If your compiler doesn't recognize unsigned char,
 *  you'll have to find another one-byte unsigned integer.
 */
typedef unsigned char unsigned_byte;
typedef short boolean;


/*
 *  Structure for font information.  Note that /charwidths/ is a table
 *  of length ec-bc+1 giving the width of each character;  each entry
 *  in this table is an index into the /widths/ table where the widths
 *  really reside.  Further information is in the file auxiliary.c.
 */
typedef struct font {
  long number;			/*  font number in the DVI file		*/
  char *area, *name;		/*  strings naming the associated file 	*/
  long checksum, scalefactor;   /*  you figure this one out		*/
  boolean loaded;		/*  TRUE iff we've read the TFM file	*/
  int nw;			/*  number of distinct widths		*/
  long *widths;			/*  the distinct widths 		*/
  int bc, ec;			/*  beginning and ending char numbers	*/
  unsigned_byte *charwidths;	/*  widths of the individual characters	*/
  struct font *nextfont;	/*  pointer to the next font		*/
} font;