/* max number of open files */
#define MAXFILES  32

struct simplefile_info {
  int extfd;
  int siofd;
  int cached;
  long maxbyteaccessed;
  long offset;
  char filename[128];
};

typedef  struct simplefile_info *  simplefile_infop;



#define ARRAYLIST_INIT(name, structp) \
     structp name[MAXFILES]; int nameCOUNT=0;

     
#define ARRAYLIST_DELETE(name,num,elt) \
      elt= name[num]; \
      nameCOUNT--; \
      name[num]=NULL;
  
#define ARRAYLIST_ADD(name,elt) \
      assert(nameCOUNT < MAXFILES); \
      name[nameCOUNT]=elt; \
      nameCOUNT++;    


#define ARRAYLIST_LOOKUP(name,value,field,ret) \
      ret=0; \
      while(ret < MAXFILES) { \
        if (name[ret] && name[ret]->field == value) { break; } \
        else {ret++;} \
      };  \
      if (ret == MAXFILES) ret=-1;

