--- ray/src/meta/meta.h 2003/02/22 02:07:26 1.1 +++ ray/src/meta/meta.h 2003/10/27 10:28:59 1.8 @@ -1,20 +1,28 @@ -/* RCSid: $Id: meta.h,v 1.1 2003/02/22 02:07:26 greg Exp $ */ +/* RCSid: $Id: meta.h,v 1.8 2003/10/27 10:28:59 schorsch Exp $ */ /* * Standard meta-file definitions and limits */ +#ifndef _RAD_META_H_ +#define _RAD_META_H_ +#include "copyright.h" #include - +#include #include +#include "rterror.h" +#ifdef __cplusplus +extern "C" { +#endif + #define TRUE 1 #define FALSE 0 #define PEOF 'F' /* end of file global */ #define PEOP 'E' /* end of page global */ -#define PPAUSE 'P' /* pause global */ +#define PPAUS 'P' /* pause global */ #define PDRAW 'D' /* draw global */ #define POPEN 'O' /* open segment */ #define PCLOSE 'C' /* close segment */ @@ -46,11 +54,13 @@ #define SPAT2 06 /* set pattern 2 */ #define SPAT3 07 /* set pattern 3 */ -#define SYSTEM 0 /* system error, internal, fatal */ -#define USER 1 /* user error, fatal */ -#define WARNING 2 /* user error, not fatal */ -#ifdef UNIX +#ifdef _WIN32 /* XXX */ +#define MDIR "C:\\tmp\\" /* XXX we just need something to compile for now */ +#define TTY "CON:" /* XXX this probably doesn't work */ +#define TDIR "C:\\tmp\\" /* XXX we just need something to compile for now */ +#else /* XXX */ + #define TDIR "/tmp/" /* directory for temporary files */ #ifndef MDIR #define MDIR "/usr/local/lib/meta/" /* directory for metafiles */ @@ -58,24 +68,16 @@ #define TTY "/dev/tty" /* console name */ #endif -#ifdef MAC -#define TDIR "5:tmp/" /* directory for temporary files */ -#define MDIR "/meta/" /* directory for metafiles */ -#define TTY ".con" /* console name */ -#endif - -#ifdef CPM -#define TDIR "0/" /* directory for temporary files */ -#define MDIR "0/" /* directory for metafiles */ -#define TTY "CON:" /* console name */ -#endif - #define MAXFNAME 64 /* maximum file name length */ #define XYSIZE (1<<14) /* metafile coordinate size */ +#ifndef max #define max(x, y) ((x) > (y) ? (x) : (y)) +#endif +#ifndef min #define min(x, y) ((x) < (y) ? (x) : (y)) +#endif #define abs(x) ((x) < 0 ? -(x) : (x)) @@ -118,14 +120,48 @@ typedef struct plist PLIST; * External declarations */ -char *malloc(), *savestr(); +char *savestr(); -PRIMITIVE *palloc(), *pop(); +PRIMITIVE *pop(); FILE *efopen(), *mfopen(); extern char coms[]; - extern char errmsg[]; - extern char *progname; + + /* expand.c */ +extern void expand(FILE *infp, short *exlist); + /* palloc.c */ +extern PRIMITIVE *palloc(void); +extern void pfree(register PRIMITIVE *p); +extern void plfree(register PLIST *pl); + /* sort.c */ +extern void sort(FILE *infp, int (*pcmp)()); +extern void pmergesort(FILE *fi[], int nf, PLIST *pl, int (*pcmp)(), FILE *ofp); + /* metacalls.c */ +extern void mdraw(int x, int y); +extern void msegment(int xmin, int ymin, int xmax, int ymax, char *sname, + int d, int thick, int color); +extern void mvstr(int xmin, int ymin, int xmax, int ymax, char *s, + int d, int thick, int color); +extern void mtext(int x, int y, char *s, int cpi, int color); +extern void mpoly(int x, int y, int border, int pat, int color); +extern void mtriangle(int xmin, int ymin, int xmax, int ymax, + int d, int pat, int color); +extern void mrectangle(int xmin, int ymin, int xmax, int ymax, + int pat, int color); +extern void mline(int x, int y, int type, int thick, int color); +extern void mcloseseg(void); +extern void mopenseg(char *sname); +extern void msetpat(int pn, char *pat); +extern void minclude(char *fname); +extern void mdone(void); +extern void mendpage(void); + + +#ifdef __cplusplus +} +#endif +#endif /* _RAD_META_H_ */ +