#ifndef __IMPINCLUDES 
#define __IMPINCLUDES
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <assert.h>
#include <errno.h>
#define _IMP_MONITOR_ (0==1)
#define nl 10
#define BADSWITCH(val,line,file) \
  (fprintf(stderr, "* Missing switch label %d\n", val),     \
   assert(_IMP_MONITOR_))

extern FILE *_ttyin;
extern FILE *_nullin;
extern FILE *_ttyout;
extern FILE *_nullout;

extern FILE *inmap[128];
extern FILE *outmap[128];

extern int instream, outstream;
#define in_file inmap[instream]
#define out_file outmap[outstream]

extern char *inputname; // needed for pass2
extern char *outputname;

extern int openinput(int stream, char *filename);
extern int openoutput(int stream, char *filename);
extern void closeinput(void);
extern void closeoutput(void);
extern void setinput(int pos);
extern void setoutput(int pos);
extern void selectinput(int pos);
extern void selectoutput(int pos);
extern void printsymbol(int c);
extern void skipsymbol(void);
extern void readsymbol_(int *sym);
#define readsymbol(name) readsymbol_(&name)
extern int nextsymbol(void);
extern void newline(void);
extern void space(void);
extern void newlines(int lines);
extern void spaces(int sp);
extern void write(int num, int prec);
extern void printstring_(char *s);
#define printstring(s) printstring_((char *)(s))
extern char *itos(int i, int sp);
extern char *int2ascii(int i, int base, int sp); // needed for pass2
// static int _imptempint;
// static char _imptempstring[256];
 char *concat_( char *,char *);
#define concat(a,b) concat_((char *)(a), (char *)(b))
 int imp_resolve(char *, char *, char *,char *);
 char *tostring(int );
 void * imp_strjam(char *,char *,int);
 void imp_stop();
 char * imp_substring(char *,int ,int );

#define addr(x) ((int)&(x))
#define byteinteger(x) (* (unsigned char *) ((int)(x)))

#endif

