typedef struct direntry {
  struct direntry *next;
  struct direntry *prev;
  char *name;
  unsigned char rawname[16];
  unsigned int size;
  int type;
  int closed;
  int locked;
  int track;
  int sector;
  int tagged;
  long mtime;
} DirEntry;

typedef struct dir {
  int numentries;
  char *title;
  DirEntry *firstentry;
  int blocksfree;  /* -1 if not a disk image */
} Dir;

extern char *dir_type[];


Dir *dir_read(const char *path);
void dir_free(Dir *dir);
DirEntry *dir_find(Dir *dir, int entrynum);
