#ifndef DISK_H
#define DISK_H

# ifdef DISK_C

static const char *dummy_suffix_gzip[] = {".gz", ".Z", ".z", NULL};
static const char *dummy_suffix_bzip2[] = {".bz2", NULL};

struct
{
 const char *program_path;
 const char *program_flags;
 const char **suffixs; /* first one in the list is the one to write out in */
} file_io_compress_types[] =
{
 {"/usr/bin/gzip", "-dc", dummy_suffix_gzip},
 {"/usr/bin/bzip2", "-dc", dummy_suffix_bzip2},
 {0}
};

# endif

#define FILE_IO_MAX_PREFIX_TAGS 8
#define FILE_TAG_MAX_SIZE 32 /* 3 gets added to this for the type info */

typedef struct file_io
{
 FILE *io;
#ifndef NDEBUG
 char prev_tags[FILE_IO_MAX_PREFIX_TAGS + 1][FILE_TAG_MAX_SIZE + 3];
#endif

 struct
 {
  char tag[FILE_IO_MAX_PREFIX_TAGS + 1][FILE_TAG_MAX_SIZE + 3];
  int len[FILE_IO_MAX_PREFIX_TAGS + 1];
#ifndef NDEBUG
  const char *type[FILE_IO_MAX_PREFIX_TAGS + 1];
#endif
  int used;
 } disk_tags;

 struct
 {
  const char *tag[FILE_IO_MAX_PREFIX_TAGS];
  /* type will always be FILE_TAG_TYPE_OBJECT */
  int used;
 } prefix_tags;

 int version;

 /* 1 struct for read and write... but we only open read only or write only */
 unsigned int found_on_disk : 1;
 unsigned int read_only : 1;
 unsigned int used_popen : 1;
} file_io;


#endif
