2 Generic object-oriented reading/writing.
4 Part of the swftools package.
6 Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
8 This file is distributed under the GPL, see file COPYING for details */#include <stdio.h>
10 #ifndef __rfxswf_bitio_h__
11 #define __rfxswf_bitio_h__
13 #define READER_TYPE_FILE 0
14 #define READER_TYPE_MEM 1
15 #define READER_TYPE_ZLIB 2
16 #define WRITER_TYPE_FILE 0
17 #define WRITER_TYPE_MEM 1
18 #define WRITER_TYPE_ZLIB 2
22 int (*read)(struct reader_t*, void*data, int len);
33 int (*write)(struct writer_t*, void*data, int len);
34 void (*finish)(struct writer_t*);
43 void reader_resetbits(struct reader_t*r);
44 unsigned int reader_readbit(struct reader_t*r);
45 unsigned int reader_readbits(struct reader_t*r, int num);
47 void writer_resetbits(struct writer_t*w);
48 void writer_writebit(struct writer_t*w, int bit);
49 void writer_writebits(struct writer_t*w, unsigned int data, int bits);
51 /* standard readers / writers */
53 void reader_init_filereader(struct reader_t*r, int handle);
54 void reader_init_zlibinflate(struct reader_t*r, struct reader_t*input);
55 void reader_init_memreader(struct reader_t*r, void*data, int length);
57 void writer_init_filewriter(struct writer_t*w, int handle);
58 void writer_init_zlibdeflate(struct writer_t*w, struct writer_t*output);
59 void writer_init_memwriter(struct writer_t*r, void*data, int length);
61 #endif //__rfxswf_bitio_h__