upgrade to xpdf 3.00.
[swftools.git] / lib / bitio.h
index e79bea1..fe54471 100644 (file)
@@ -4,24 +4,45 @@
    Part of the swftools package.
    
    Copyright (c) 2001 Matthias Kramm <kramm@quiss.org> 
+   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 <stdio.h>
 
 #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__