///////////////////////////////////////////////////////////////////////////////
//
//           ファイルストリーム


#ifndef FISTRM_C_H
#define FISTRM_C_H


#include "stdio.h"
#include "istrm_c.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct _fileInputStream {
 // InputStream の実装
  InputStream_available      available;       // self->available(self);
  InputStream_progress_bytes progress_bytes;  // self->progress_bytes(self, bytes);
  InputStream_show8          show8;           // self->show8(self);
  InputStream_show16         show16;          // self->show16(self);
  InputStream_read8          read8;           // self->read8(self);
  InputStream_read16         read16;          // self->read16(self);
  InputStream_get_bit_pos    get_bit_pos;     // self->get_bit_pos(self);
  InputStream_read_bits      read_bits;       // self->read_bits(self,bits);

 // FIS 仕様
  FILE *fp;
  unsigned int fsize;
  unsigned int bufsize;
  unsigned int pos;
  unsigned int bit_pos;

  unsigned char buffer[0x100];

} FileInputStream;


void FIS_initialize( FileInputStream *, const char * );
void FIS_finalize( FileInputStream * );


#ifdef __cplusplus
}
#endif


#endif // FISTRM_C_H


