summaryrefslogtreecommitdiff
path: root/dviware/dvitops/dvitops.h
blob: eea8bc85c2187de353838d638c61bb3916e24d4d (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
/* $Header: /usr/jjc/dvitops/RCS/dvitops.h,v 1.7 90/08/14 13:14:07 jjc Rel $ */

#include "util.h"
 
#define MAXCHARS 256
 
#define NO_REGION -1
#define PASS1 1
#define PASS2 2
 
#define ID_BYTE		2
#define SIZE_MAX UINT_MAX
#define uread1(fp) ((unsigned char)(getc((fp))))
 
#define used_char(f, c) (page_used[f][c] = TRUE)
 
typedef long integer;
 
struct depend_list {
	struct postscript_f_list *f;
	struct depend_list *next;
};
 
struct postscript_f_list {
	struct postscript_f_list *next;
	char *file;
	int in_prolog; /* download it in the prolog or it's resident anyway */
	int nuses;
	char s[1];
};
 
 
struct page_info {
	integer address;
	integer count[10];
	integer num;
	integer den;
	integer max_drift;
	int mag;
	double hoffset;
	double voffset;
	int copies;
	char *paper;
};
 
#define WILD LONG_MAX
 
struct option_info {
	int mag;
	int reverse;
	int sort;
	int copies;
	int maxpages;
	char *paper;
	double hoffset;
	double voffset;
	long start_page[10]; /* WILD if it's a * */
};
 
extern char *texfonts;
extern char *texinputs;
extern char *texpk;
extern int dpi;
extern char *page_used[MAXFONTS];
extern long f_memory;
extern int nprolog_fonts;
extern int current_region;
extern int nregions;
extern int landscape;
extern int magnification;
extern int quiet;
 
#ifdef PROTO
integer sread4(FILE *fp);
integer sread3(FILE *fp);
int sread2(FILE *fp);
int sread1(FILE *fp);
integer uread3(FILE *fp);
integer uread2(FILE *fp);
void store_page_usage(void);
void used_font(int f);
integer f_space(int f);
integer f_width(int f, PROMOTED_UNSIGNED_CHAR c);
integer f_rounded_width(int f, PROMOTED_UNSIGNED_CHAR c);
int f_is_blank(int f);
void f_comment(FILE *);
void f_prologue(FILE *);
void f_set(int, FILE *); /* used characters are in page_used */
void f_def(integer fontno, char *name, char *area,
integer checksum, integer at_size, integer design_size, int magnification);
int same_font(int f);
void f_emit(int i, FILE *fp);
void emit_ps_font(char *font, FILE *psfp);
void need_ps_font(char *name, FILE *psfp);
integer scale(integer x, integer z);
void set_string(char *p, int n, int f, integer h, integer v);
void set_rule(integer a, integer b, integer h, integer v);
void eop(struct page_info *p);
void trailer(void);
void prologue(FILE *, int, int, char*);
struct postscript_f_list *add_postscript_font(char *font);
void read_dvi_file(FILE *fp, FILE *ofp, struct option_info *option);
int bigpoint(char *str, char **ptr, double *res);
void p_import_list(FILE *psfp, struct page_info *page);
void special(int pass, char *s, integer h, integer v);
void p_inline_list(FILE *psfp);
void p_tpic_list(FILE *psfp, struct page_info *page);
void p_form_list(FILE *psfp);
void p_special_prologues(FILE *psfp);
int include_file(char *filename, FILE *psfp);
/* returns 1 if it can load it 0 if not */
int load_pk_font(int n, char *name, char *used, integer at_size, 
	  integer checksum, integer *width, integer *rounded_width);
/* returns number of bytes of vm used, roughly */
char *find_pk_file(char *name, int mag);
integer emit_pk_font(int n, char *psname, char *used, FILE *fp);
void free_pk_font(int n);
void do_transform(int n, integer *origin_x, integer *origin_y, FILE *psfp);
char *strsave(char *);
/* return number of bytes output */
int put_dim(long, FILE *);
int tpic_special(int, char *, integer, integer);
#else
integer sread4();
integer sread3();
int sread2();
int sread1();
integer uread3();
integer uread2();
void store_page_usage();
void used_font();
integer f_space();
integer f_width();
integer f_rounded_width();
int f_is_blank();
void f_comment();
void f_prologue();
void f_set(); /* used characters are in page_used */
void f_def();
int same_font();
void f_emit();
void emit_ps_font();
void need_ps_font();
integer scale();
void set_string();
void set_rule();
void eop();
void trailer();
void prologue();
struct postscript_f_list *add_postscript_font();
void read_dvi_file();
int bigpoint();
void p_import_list();
void special();
void p_inline_list();
void p_tpic_list();
void p_form_list();
void p_special_prologues();
int include_file();
/* returns 1 if it can load it 0 if not */
int load_pk_font();
char *find_pk_file();
integer emit_pk_font();
void free_pk_font();
void do_transform();
char *strsave();
int put_dim();
int tpic_special();
#endif