istream68_def.hGo to the documentation of this file.00001
00014
00015
00016 #ifndef _ISTREAM68_DEF_H_
00017 #define _ISTREAM68_DEF_H_
00018
00019 #include "file68/istream68.h"
00020
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024
00031 #define ISTREAM_OPEN_READ_BIT 0
00032
00034 #define ISTREAM_OPEN_READ (1<<ISTREAM_OPEN_READ_BIT)
00035
00037 #define ISTREAM_OPEN_WRITE_BIT 1
00038
00040 #define ISTREAM_OPEN_WRITE (1<<ISTREAM_OPEN_WRITE_BIT)
00041
00043 #define ISTREAM_OPEN_MASK (ISTREAM_OPEN_READ|ISTREAM_OPEN_WRITE)
00044
00046 #define ISTREAM_IS_OPEN(V) (!!((V)&(ISTREAM_OPEN_READ|ISTREAM_OPEN_WRITE)))
00047
00049 #define ISTREAM_IS_OPEN_READ(V) (((V)>>ISTREAM_OPEN_READ_BIT)&1)
00050
00052 #define ISTREAM_IS_OPEN_WRITE(V) (((V)>>ISTREAM_OPEN_WRITE_BIT)&1)
00053
00060 typedef const char * (* istream_name_t) (istream_t *);
00061 typedef int (* istream_open_t) (istream_t *);
00062 typedef int (* istream_close_t) (istream_t *);
00063 typedef int (* istream_length_t) (istream_t *);
00064 typedef int (* istream_tell_t) (istream_t *);
00065 typedef int (* istream_seek_t) (istream_t *, int);
00066 typedef int (* istream_read_t) (istream_t *, void *, int);
00067 typedef int (* istream_write_t) (istream_t *, const void *, int);
00068 typedef void (* istream_destroy_t) (istream_t *);
00077 struct _istream_t {
00078 istream_name_t name;
00079 istream_open_t open;
00080 istream_close_t close;
00081 istream_read_t read;
00082 istream_write_t write;
00083 istream_length_t length;
00084 istream_tell_t tell;
00085 istream_seek_t seekf;
00086 istream_seek_t seekb;
00087 istream_destroy_t destroy;
00088 };
00089
00090 #ifdef __cplusplus
00091 }
00092 #endif
00093
00094 #endif
|