Home Download Musics Developers
API Sources Tools File Format Technicals

istream68_def.h

Go to the documentation of this file.
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 
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   /*const*/ istream_name_t name;     
00079   /*const*/ istream_open_t open;     
00080   /*const*/ istream_close_t close;   
00081   /*const*/ istream_read_t read;     
00082   /*const*/ istream_write_t write;   
00083   /*const*/ istream_length_t length; 
00084   /*const*/ istream_tell_t tell;     
00085   /*const*/ istream_seek_t seekf;    
00086   /*const*/ istream_seek_t seekb;    
00087   /*const*/ istream_destroy_t destroy; 
00088 };
00089 
00090 #ifdef __cplusplus
00091 }
00092 #endif
00093 
00094 #endif /* #ifndef _ISTREAM68_DEF_H_ */