4 |
|
*/ |
5 |
|
#ifndef _RAD_META_H_ |
6 |
|
#define _RAD_META_H_ |
7 |
– |
#ifdef __cplusplus |
8 |
– |
extern "C" { |
9 |
– |
#endif |
7 |
|
|
8 |
|
#include "copyright.h" |
9 |
|
|
10 |
|
#include <stdio.h> |
11 |
|
#include <stdlib.h> |
15 |
– |
#include <malloc.h> |
16 |
– |
|
12 |
|
#include <ctype.h> |
13 |
|
|
14 |
+ |
#include "rterror.h" |
15 |
|
|
16 |
+ |
#ifdef __cplusplus |
17 |
+ |
extern "C" { |
18 |
+ |
#endif |
19 |
+ |
|
20 |
|
#define TRUE 1 |
21 |
|
#define FALSE 0 |
22 |
|
|
23 |
|
#define PEOF 'F' /* end of file global */ |
24 |
|
#define PEOP 'E' /* end of page global */ |
25 |
< |
#define PPAUSE 'P' /* pause global */ |
25 |
> |
#define PPAUS 'P' /* pause global */ |
26 |
|
#define PDRAW 'D' /* draw global */ |
27 |
|
#define POPEN 'O' /* open segment */ |
28 |
|
#define PCLOSE 'C' /* close segment */ |
46 |
|
#define ADELIM '`' /* additional argument delimiter */ |
47 |
|
#define CDELIM '#' /* comment delimiter */ |
48 |
|
|
49 |
< |
#define MAXARGS 512 /* maximum # of arguments for primitive */ |
49 |
> |
#define MAXARGS 2048 /* maximum argument string for primitive */ |
50 |
|
|
51 |
|
#define SALL 0 /* set all */ |
52 |
|
#define SPAT0 04 /* set pattern 0 */ |
54 |
|
#define SPAT2 06 /* set pattern 2 */ |
55 |
|
#define SPAT3 07 /* set pattern 3 */ |
56 |
|
|
57 |
– |
#define SYSTEM 0 /* system error, internal, fatal */ |
58 |
– |
#define USER 1 /* user error, fatal */ |
59 |
– |
#define WARNING 2 /* user error, not fatal */ |
57 |
|
|
58 |
< |
#ifdef UNIX |
58 |
> |
#if defined(_WIN32) || defined(_WIN64) /* XXX */ |
59 |
> |
#define MDIR "C:\\tmp\\" /* XXX we just need something to compile for now */ |
60 |
> |
#define TTY "CON:" /* XXX this probably doesn't work */ |
61 |
> |
#define TDIR "C:\\tmp\\" /* XXX we just need something to compile for now */ |
62 |
> |
#else /* XXX */ |
63 |
> |
|
64 |
|
#define TDIR "/tmp/" /* directory for temporary files */ |
65 |
|
#ifndef MDIR |
66 |
|
#define MDIR "/usr/local/lib/meta/" /* directory for metafiles */ |
68 |
|
#define TTY "/dev/tty" /* console name */ |
69 |
|
#endif |
70 |
|
|
69 |
– |
#ifdef MAC |
70 |
– |
#define TDIR "5:tmp/" /* directory for temporary files */ |
71 |
– |
#define MDIR "/meta/" /* directory for metafiles */ |
72 |
– |
#define TTY ".con" /* console name */ |
73 |
– |
#endif |
74 |
– |
|
75 |
– |
#ifdef CPM |
76 |
– |
#define TDIR "0/" /* directory for temporary files */ |
77 |
– |
#define MDIR "0/" /* directory for metafiles */ |
78 |
– |
#define TTY "CON:" /* console name */ |
79 |
– |
#endif |
80 |
– |
|
81 |
– |
#ifdef _WIN32 /* XXX */ |
82 |
– |
#define MDIR "c\\tmp\\" /* XXX we just need something to compile for now */ |
83 |
– |
#define TTY "CON:" /* XXX this probably doesn't work */ |
84 |
– |
#endif /* XXX */ |
85 |
– |
|
71 |
|
#define MAXFNAME 64 /* maximum file name length */ |
72 |
|
|
73 |
|
#define XYSIZE (1<<14) /* metafile coordinate size */ |
120 |
|
* External declarations |
121 |
|
*/ |
122 |
|
|
123 |
< |
char *savestr(); |
123 |
> |
char *savestr(const char *str); |
124 |
|
|
125 |
< |
PRIMITIVE *pop(); |
125 |
> |
PRIMITIVE *pop(PLIST *pl); |
126 |
|
|
127 |
< |
FILE *efopen(), *mfopen(); |
127 |
> |
FILE *efopen(const char *fn, const char *mode); |
128 |
> |
FILE *mfopen(const char *fn, const char *mode); |
129 |
|
|
130 |
|
extern char coms[]; |
131 |
|
extern char errmsg[]; |
135 |
|
extern void expand(FILE *infp, short *exlist); |
136 |
|
/* palloc.c */ |
137 |
|
extern PRIMITIVE *palloc(void); |
138 |
< |
extern void pfree(register PRIMITIVE *p); |
139 |
< |
extern void plfree(register PLIST *pl); |
138 |
> |
extern void pfree(PRIMITIVE *p); |
139 |
> |
extern void plfree(PLIST *pl); |
140 |
|
/* sort.c */ |
141 |
|
extern void sort(FILE *infp, int (*pcmp)()); |
142 |
< |
extern void mergesort(FILE *fi[], int nf, PLIST *pl, int (*pcmp)(), FILE *ofp); |
142 |
> |
extern void pmergesort(FILE *fi[], int nf, PLIST *pl, int (*pcmp)(), FILE *ofp); |
143 |
|
/* metacalls.c */ |
144 |
|
extern void mdraw(int x, int y); |
145 |
|
extern void msegment(int xmin, int ymin, int xmax, int ymax, char *sname, |
159 |
|
extern void minclude(char *fname); |
160 |
|
extern void mdone(void); |
161 |
|
extern void mendpage(void); |
162 |
+ |
/* misc.c */ |
163 |
+ |
extern int comndx(int c); |
164 |
+ |
extern PRIMITIVE *pop(PLIST *pl); |
165 |
+ |
extern void push(PRIMITIVE *p, PLIST *pl); |
166 |
+ |
extern void add(PRIMITIVE *p, PLIST *pl); |
167 |
+ |
extern void append(PLIST *pl1, PLIST *pl2); |
168 |
+ |
extern void fargs(PRIMITIVE *p); |
169 |
+ |
extern char * nextscan(char *start, char *format, char *result); |
170 |
+ |
extern void mcopy(char *p1, char *p2, int n); |
171 |
+ |
/* segment.c */ |
172 |
+ |
extern int inseg(void); |
173 |
+ |
extern void closeseg(void); |
174 |
+ |
extern void openseg(char *name); |
175 |
+ |
extern void segprim(PRIMITIVE *p); |
176 |
+ |
extern void segment(PRIMITIVE *p, void (*funcp)(PRIMITIVE *p)); |
177 |
+ |
extern int xlate(short extrema, PRIMITIVE *p, PRIMITIVE *px); |
178 |
+ |
/* cgraph.c */ |
179 |
+ |
extern void cgraph(int width, int length); |
180 |
+ |
extern void cplot(void); |
181 |
+ |
extern void cpoint(int c, double x, double y); |
182 |
+ |
/* gcalc.c */ |
183 |
+ |
extern void gcalc(char *types); |
184 |
+ |
/* hfio.c, mfio.c */ |
185 |
+ |
extern int readp(PRIMITIVE *p, FILE *fp); |
186 |
+ |
extern void writep(PRIMITIVE *p, FILE *fp); |
187 |
+ |
extern void writeof(FILE *fp); |
188 |
|
|
189 |
|
|
190 |
|
#ifdef __cplusplus |