/* fmstream.h */
/* A union so that functions can have the same prototypes whether
   using file or memory streams */
#ifndef FMSTREAM_H
#define FMSTREAM_H

typedef struct mstream mstream;
typedef struct osfstream osfstream;

typedef union {
  osfstream *fp;
  mstream *mp;
} fmstream;

/* This is the type for 16-bit reads, I've chosen int because shorts are
   erky on Acorns */
typedef int fms_t16;

#undef BYTEROUND
#define BYTEROUND(a) (((a) + 7) & ~7)

#undef WORDALIGN16
#define WORDALIGN16(a) (((a) + 1l) & ~1l)

#undef WORDALIGN32
#define WORDALIGN32(a) (((a) + 3l) & ~3l)

#endif
