#ifndef _MODE_H
#define _MODE_H
#include <unistd.h>
#ifdef pdp11
typedef char BOOL;
#else
typedef short BOOL;
#endif
#define BYTESPERWORD (sizeof (char *))
#define ALIGNSIZ (sizeof (double))
#define NIL ((char *)0)
#define Rcheat(a) ((int)(a))
typedef union
{
struct forknod *_forkptr;
struct comnod *_comptr;
struct fndnod *_fndptr;
struct parnod *_parptr;
struct ifnod *_ifptr;
struct whnod *_whptr;
struct fornod *_forptr;
struct lstnod *_lstptr;
struct blk *_blkptr;
struct namnod *_namptr;
char *_bytptr;
} address;
struct blk
{
struct blk *word;
char pad[ALIGNSIZ - sizeof (struct blk *)];
};
#define BUFFERSIZE 128
struct fileblk
{
int fdes;
unsigned flin;
BOOL feof;
unsigned char fsiz;
unsigned char *fnxt;
unsigned char *fend;
off_t nxtoff;
off_t endoff;
unsigned char **feval;
struct fileblk *fstak;
unsigned char fbuf[BUFFERSIZE];
};
struct tempblk
{
int fdes;
struct tempblk *fstak;
};
struct filehdr
{
int fdes;
unsigned flin;
BOOL feof;
unsigned char fsiz;
unsigned char *fnxt;
unsigned char *fend;
off_t nxtoff;
off_t endoff;
unsigned char **feval;
struct fileblk *fstak;
unsigned char _fbuf[1];
};
struct sysnod
{
char *sysnam;
int sysval;
};
struct trenod
{
int tretyp;
struct ionod *treio;
};
struct argnod
{
struct argnod *argnxt;
unsigned char argval[1];
};
struct dolnod
{
struct dolnod *dolnxt;
int doluse;
unsigned char **dolarg;
};
struct forknod
{
int forktyp;
struct ionod *forkio;
struct trenod *forktre;
};
struct comnod
{
int comtyp;
struct ionod *comio;
struct argnod *comarg;
struct argnod *comset;
};
struct fndnod
{
int fndtyp;
unsigned char *fndnam;
struct trenod *fndval;
int fndref;
};
struct ifnod
{
int iftyp;
struct trenod *iftre;
struct trenod *thtre;
struct trenod *eltre;
};
struct whnod
{
int whtyp;
struct trenod *whtre;
struct trenod *dotre;
};
struct fornod
{
int fortyp;
struct trenod *fortre;
unsigned char *fornam;
struct comnod *forlst;
};
struct swnod
{
int swtyp;
unsigned char *swarg;
struct regnod *swlst;
};
struct regnod
{
struct argnod *regptr;
struct trenod *regcom;
struct regnod *regnxt;
};
struct parnod
{
int partyp;
struct trenod *partre;
};
struct lstnod
{
int lsttyp;
struct trenod *lstlef;
struct trenod *lstrit;
};
struct ionod
{
int iofile;
char *ioname;
char *iolink;
struct ionod *ionxt;
struct ionod *iolst;
};
struct fdsave
{
int org_fd;
int dup_fd;
};
#define fndptr(x) ((struct fndnod *)x)
#define comptr(x) ((struct comnod *)x)
#define forkptr(x) ((struct forknod *)x)
#define parptr(x) ((struct parnod *)x)
#define lstptr(x) ((struct lstnod *)x)
#define forptr(x) ((struct fornod *)x)
#define whptr(x) ((struct whnod *)x)
#define ifptr(x) ((struct ifnod *)x)
#define swptr(x) ((struct swnod *)x)
#endif