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
171
172
173
174
175
176
177
178
|
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
/*
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
* All Rights Reserved.
*/
/* from "e.h 1.5 05/06/02 SMI" "ucbeqn:e.h 1.1" */
/*
* Portions Copyright (c) 2005 Gunnar Ritter, Freiburg i. Br., Germany
*
* Sccsid @(#)e.h 1.13 (gritter) 1/13/08
*/
/*
* Changes Copyright (c) 2014 Carsten Kunze (carsten.kunze at arcor.de)
*/
#include <stdio.h>
#include <inttypes.h>
#include "global.h"
#define FATAL 1
#define ROM '1'
#ifndef NEQN
#define ITAL '2'
#define BLD '3'
#else /* NEQN */
#define ITAL '1'
#define BLD '1'
#endif /* NEQN */
#define rom(c) (((c) & 0177) == ROM)
#define ital(c) (((c) & 0177) == ITAL)
#define bld(c) (((c) & 0177) == BLD)
#define OP 0200
#define op(c) ((c) & OP)
#ifndef NEQN
#define VERT(n) (n)
#define POINT 72
#define EM(m, ps) ((((float)(m)*(ps) * resolution) / POINT))
#else /* NEQN */
#define VERT(n) (20 * (n))
#endif /* NEQN */
#define EFFPS(p) ((p) >= 6 ? (p) : 6)
extern int dbg;
extern int ct;
extern int lp[];
extern int used[]; /* available registers */
extern float ps; /* dflt init pt size */
#define resolution 72 /* was: resolution of ditroff */
extern float deltaps; /* default change in ps */
extern float gsize; /* global size */
extern int gfont; /* global font */
extern int ft; /* dflt font */
extern FILE *curfile; /* current input file */
extern int ifile; /* input file number */
extern int linect; /* line number in current file */
extern int eqline; /* line where eqn started */
extern int svargc;
extern char **svargv;
#ifndef NEQN
extern float eht[100];
extern float ebase[100];
#else /* NEQN */
extern int eht[100];
extern int ebase[100];
#endif /* NEQN */
extern int lfont[100];
extern int rfont[100];
extern int eqnreg, eqnht;
extern int lefteq, righteq;
extern int lastchar; /* last character read by lex */
extern int markline; /* 1 if this EQ/EN contains mark or lineup */
extern char *progname;
typedef struct s_tbl {
const char *name;
const char *defn;
struct s_tbl *next;
} tbl;
extern char *spaceval; /* use in place of normal \x (for pic) */
/* diacrit.c */
void diacrit(int, int);
/* e.c */
int yyparse(void);
/* eqnbox.c */
void eqnbox(int, int, int);
/* font.c */
void setfont(char);
void font(int, int);
void fatbox(int);
void globfont(void);
/* fromto.c */
void fromto(int, int, int);
/* funny.c */
void funny(int);
/* glob.c */
/* integral.c */
void integral(int, int, int);
void setintegral(void);
/* io.c */
int main(int, char **);
void eqnexit(int);
int eqn(int, char **);
#define getline(s, n) eqngetline(s, n)
int getline(char **, size_t *);
void do_inline(void);
void putout(int);
int oalloc(void);
void ofree(int);
void setps(float);
void nrwid(int, float, int);
void setfile(int, char **);
void yyerror(char *);
void init(void);
void error(int, const char *, ...);
/* lex.c */
int gtc(void);
int openinfile(void);
void pbstr(register const char *);
int yylex(void);
int getstr(char *, register int);
int cstr(char *, int, int);
void define(int);
void space(void);
char *strsave(char *);
void include(void);
void delim(void);
/* lookup.c */
tbl *lookup(tbl **, const char *, const char *);
void init_tbl(void);
/* mark.c */
void mark(int);
void lineup(int);
/* matrix.c */
void column(int, int);
void matrix(int);
/* move.c */
void move(int, int, int);
/* over.c */
void boverb(int, int);
/* paren.c */
void paren(int, int, int);
void brack(int, const char *, const char *, const char *);
/* pile.c */
void lpile(int, int, int);
/* shift.c */
void bshiftb(int, int, int);
void shift(int);
void shift2(int, int, int);
/* size.c */
void setsize(char *);
void size(float, int);
void globsize(void);
char *tsize(float);
/* sqrt.c */
#define sqrt(n) eqnsqrt(n)
void sqrt(int);
/* text.c */
void text(int, char *);
int trans(int, char *);
void shim(int);
void roman(int);
void name4(int, int);
|