typedef struct IMem {char *data; int used; int alloced; int at; int iseof; } IMEM;

int mem_have(IMEM *f, int len);
char *mem_fgets(char *data, int len, IMEM *f);
int mem_fclose(IMEM *f);
int mem_fseek(IMEM *f, int x);
int mem_fread(IMEM *f,char *bf, int len);
int mem_fwrite(IMEM *f, char *bf, int len);
int mem_feof(IMEM *f);
IMEM *mem_fopen(int sz);
