00001
00014
00015
00016 #ifndef _ISTREAM68_DEF_H_
00017 #define _ISTREAM68_DEF_H_
00018
00019 #include "file68/istream68.h"
00020
00026 #define ISTREAM_OPEN_READ_BIT 0
00027
00029 #define ISTREAM_OPEN_READ (1<<ISTREAM_OPEN_READ_BIT)
00030
00032 #define ISTREAM_OPEN_WRITE_BIT 1
00033
00035 #define ISTREAM_OPEN_WRITE (1<<ISTREAM_OPEN_WRITE_BIT)
00036
00038 #define ISTREAM_IS_OPEN(V) (!!((V)&(ISTREAM_OPEN_READ|ISTREAM_OPEN_WRITE)))
00039
00041 #define ISTREAM_IS_OPEN_READ(V) (((V)>>ISTREAM_OPEN_READ_BIT)&1)
00042
00044 #define ISTREAM_IS_OPEN_WRITE(V) (((V)>>ISTREAM_OPEN_WRITE_BIT)&1)
00045
00051 typedef const char * (* istream_name_t) (istream_t *);
00052 typedef int (* istream_open_t) (istream_t *);
00053 typedef int (* istream_close_t) (istream_t *);
00054 typedef int (* istream_length_t) (istream_t *);
00055 typedef int (* istream_tell_t) (istream_t *);
00056 typedef int (* istream_seek_t) (istream_t *, int);
00057 typedef int (* istream_read_t) (istream_t *, void *, int);
00058 typedef int (* istream_write_t) (istream_t *, const void *, int);
00059 typedef void (* istream_destroy_t) (istream_t *);
00063 struct _istream_t {
00064 istream_name_t name;
00065 istream_open_t open;
00066 istream_close_t close;
00067 istream_read_t read;
00068 istream_write_t write;
00069 istream_length_t length;
00070 istream_tell_t tell;
00071 istream_seek_t seekf;
00072 istream_seek_t seekb;
00073 istream_destroy_t destroy;
00074 };
00075
00076 #endif