ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

lzio.h

Go to the documentation of this file.
00001 /*
00002 ** Buffered streams
00003 ** See Copyright Notice in lua.h
00004 */
00005 
00006 
00007 #ifndef GRIM_LZIO_H
00008 #define GRIM_LZIO_H
00009 
00010 #include "common/scummsys.h"
00011 
00012 namespace Common {
00013     class File;
00014 }
00015 
00016 namespace Grim {
00017 
00018 // For Lua only
00019 #define zopen   luaZ_mopen
00020 
00021 #define EOZ (-1)            // end of stream
00022 
00023 typedef struct zio ZIO;
00024 
00025 ZIO *zopen(ZIO *z, const char *b, int32 size, const char *name);
00026 int32 zread(ZIO *z, void *b, int32 n);  // read next n bytes
00027 int32 zgeteoz(ZIO *);
00028 
00029 #define zgetc(z)    (--(z)->n >= 0 ? ((int32)*(z)->p++): zgeteoz(z))
00030 #define zungetc(z)  (++(z)->n, --(z)->p)
00031 #define zname(z)    ((z)->name)
00032 
00033 
00034 // --------- Private Part ------------------
00035 
00036 #define ZBSIZE  256         // buffer size
00037 
00038 struct zio {
00039     int32 n;                    // bytes still unread
00040     const byte *p;              // current position in buffer
00041     const char *name;
00042     byte buffer[ZBSIZE];        // buffer
00043 };
00044 
00045 } // end of namespace Grim
00046 
00047 #endif


Generated on Sat Oct 12 2019 05:00:51 for ResidualVM by doxygen 1.7.1
curved edge   curved edge