sc68fordevelopers
2.2.1
|
00001 00014 /* Copyright (C) 1998-2003 Benjamin Gerard */ 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 00030 #define ISTREAM_OPEN_READ_BIT 0 00031 00033 #define ISTREAM_OPEN_READ (1<<ISTREAM_OPEN_READ_BIT) 00034 00036 #define ISTREAM_OPEN_WRITE_BIT 1 00037 00039 #define ISTREAM_OPEN_WRITE (1<<ISTREAM_OPEN_WRITE_BIT) 00040 00042 #define ISTREAM_IS_OPEN(V) (!!((V)&(ISTREAM_OPEN_READ|ISTREAM_OPEN_WRITE))) 00043 00045 #define ISTREAM_IS_OPEN_READ(V) (((V)>>ISTREAM_OPEN_READ_BIT)&1) 00046 00048 #define ISTREAM_IS_OPEN_WRITE(V) (((V)>>ISTREAM_OPEN_WRITE_BIT)&1) 00049 00055 typedef const char * (* istream_name_t) (istream_t *); 00056 typedef int (* istream_open_t) (istream_t *); 00057 typedef int (* istream_close_t) (istream_t *); 00058 typedef int (* istream_length_t) (istream_t *); 00059 typedef int (* istream_tell_t) (istream_t *); 00060 typedef int (* istream_seek_t) (istream_t *, int); 00061 typedef int (* istream_read_t) (istream_t *, void *, int); 00062 typedef int (* istream_write_t) (istream_t *, const void *, int); 00063 typedef void (* istream_destroy_t) (istream_t *); 00067 struct _istream_t { 00068 /*const*/ istream_name_t name; 00069 /*const*/ istream_open_t open; 00070 /*const*/ istream_close_t close; 00071 /*const*/ istream_read_t read; 00072 /*const*/ istream_write_t write; 00073 /*const*/ istream_length_t length; 00074 /*const*/ istream_tell_t tell; 00075 /*const*/ istream_seek_t seekf; 00076 /*const*/ istream_seek_t seekb; 00077 /*const*/ istream_destroy_t destroy; 00078 }; 00079 00080 #ifdef __cplusplus 00081 } 00082 #endif 00083 00084 #endif /* #ifndef _ISTREAM68_DEF_H_ */