define.h/*
* Global defines.
* See "cif2ps.c" for authors' names and addresses.
* Please honor the authors by not removing their attributions.
*/
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;
/* The following dimensions are all in points (1/72 in.) */
#define PAGEMARGIN 36
#define PAGEWIDTH ( 8.5 * 72 - 2 * PAGEMARGIN)
#define PAGELENGTH (11.0 * 72 - 2 * PAGEMARGIN)
#define DEFPOINTS 6 /* default points size of text */
#define BIGINT 0x7FFFFF
#define MAXTOKEN 64
#define MAXSYMBOLS 256
#define MAXLINE 1024
#define LNAMELEN 7
#define MAXLAYERS 32
#define MAXNINETY_FOUR 64
#define DSTYPE 1
#define BOXTYPE 2
#define CALLTYPE 3
#define NINETY_FOURTYPE 4
#define NGONTYPE 5
#define ROUNDTYPE 6
#define WIRETYPE 7
#define WHITE ' '
#define COMMA ','
class cifobj {
public:
virtual void print() { printf("cif object\n"); }
};
class cifpoint {
public:
int x, y;
void set(int xv, int yv) { x = xv; y = yv; }
};
class cifbox: public cifobj {
public:
int layer;
int llx,lly,urx,ury;
void print() {
printf("box layer(%d) %d %d %d %d\n",layer,llx,lly,urx,ury);
}
};
class cifpath {
public:
cifpoint *ptr;
int numpts;
int maxpts;
static const int BLOCKSIZE;
cifpath();
~cifpath();
int add(int x, int y);
};
class cifngon: public cifpath, public cifobj {
public:
int layer;
void print() { printf("polygon with %d points\n",numpts); }
};
class cifround: public cifobj {
public:
int layer;
int x,y,r;
};
class cifwire: public cifpath, public cifobj {
public:
int layer;
int width;
void print() {
printf("wire layer(%d) width(%d) with %d points\n",layer,width,numpts);
}
};
class cifds: public cifobj {
public:
int name, a, b;
void print() {
printf("ds %d a %d b %d\n",name,a,b);
}
};
class ninety_four: public cifobj {
public:
string name;
int x, y, layer;
ninety_four();
void print();
};
class cifcall: public cifobj {
public:
int symbol;
double matrix[3][3];
cifcall();
void print() {printf("call symbol %d\n",symbol); }
};
class cifsymbol: public cifobj {
public:
cifsymbol *next;
int typer;
cifobj *obj;
cifsymbol();
void print();
};
class ciftable {
public:
int symbol, a, b;
string name;
cifsymbol *pointer;
cifpoint ll, ur;
};
class ciflayer {
public:
string name;
string style;
};
extern ciflayer layers[MAXLAYERS];
extern int order[MAXLAYERS];
extern int layer, numlayers;
Maintained by John Loomis, updated Mon Feb 12 23:32:57 2007