X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fbitio.h;h=fe544710e2d05c7d2c864e8fcfd5974238d6b08b;hb=c7432833fe3a6469d63fad135151a92e12877b94;hp=e79bea17123f45aecdc32b3c0d80a03043609357;hpb=92773cba50562ec860e38816fac9676678530c46;p=swftools.git diff --git a/lib/bitio.h b/lib/bitio.h index e79bea1..fe54471 100644 --- a/lib/bitio.h +++ b/lib/bitio.h @@ -4,24 +4,45 @@ Part of the swftools package. Copyright (c) 2001 Matthias Kramm + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - This file is distributed under the GPL, see file COPYING for details */ #include #ifndef __rfxswf_bitio_h__ #define __rfxswf_bitio_h__ -#define READER_TYPE_FILE 0 -#define READER_TYPE_MEM 1 -#define READER_TYPE_ZLIB 2 -#define WRITER_TYPE_FILE 0 -#define WRITER_TYPE_MEM 1 -#define WRITER_TYPE_ZLIB 2 -#define WRITER_TYPE_NULL 3 +#define READER_TYPE_FILE 1 +#define READER_TYPE_MEM 2 +#define READER_TYPE_ZLIB_U 3 +#define READER_TYPE_ZLIB_C 4 +#define READER_TYPE_ZLIB READER_TYPE_ZLIB_U +#define READER_TYPE_NULL 5 + +#define WRITER_TYPE_FILE 1 +#define WRITER_TYPE_MEM 2 +#define WRITER_TYPE_ZLIB_C 3 +#define WRITER_TYPE_ZLIB_U 4 +#define WRITER_TYPE_NULL 5 +#define WRITER_TYPE_GROWING_MEM 6 +#define WRITER_TYPE_ZLIB WRITER_TYPE_ZLIB_C struct reader_t { int (*read)(struct reader_t*, void*data, int len); + void (*dealloc)(struct reader_t*); void *internal; int type; @@ -55,6 +76,7 @@ void writer_writebits(struct writer_t*w, unsigned int data, int bits); void reader_init_filereader(struct reader_t*r, int handle); void reader_init_zlibinflate(struct reader_t*r, struct reader_t*input); void reader_init_memreader(struct reader_t*r, void*data, int length); +void reader_init_nullreader(struct reader_t*r); void writer_init_filewriter(struct writer_t*w, int handle); void writer_init_filewriter2(struct writer_t*w, char*filename); @@ -62,4 +84,7 @@ void writer_init_zlibdeflate(struct writer_t*w, struct writer_t*output); void writer_init_memwriter(struct writer_t*r, void*data, int length); void writer_init_nullwriter(struct writer_t*w); +void writer_init_growingmemwriter(struct writer_t*r); +void* writer_growmemwrite_getmem(struct writer_t*w); + #endif //__rfxswf_bitio_h__