aboutsummaryrefslogtreecommitdiff
path: root/lzio.h
diff options
context:
space:
mode:
Diffstat (limited to 'lzio.h')
-rw-r--r--lzio.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/lzio.h b/lzio.h
index 448ef059..bcecd0d9 100644
--- a/lzio.h
+++ b/lzio.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lzio.h,v 1.4 1998/01/09 14:57:43 roberto Exp roberto $ 2** $Id: lzio.h,v 1.5 1999/08/16 20:52:00 roberto Exp roberto $
3** Buffered streams 3** Buffered streams
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -24,11 +24,11 @@ typedef struct zio ZIO;
24 24
25ZIO* zFopen (ZIO* z, FILE* f, const char *name); /* open FILEs */ 25ZIO* zFopen (ZIO* z, FILE* f, const char *name); /* open FILEs */
26ZIO* zsopen (ZIO* z, const char* s, const char *name); /* string */ 26ZIO* zsopen (ZIO* z, const char* s, const char *name); /* string */
27ZIO* zmopen (ZIO* z, const char* b, int size, const char *name); /* memory */ 27ZIO* zmopen (ZIO* z, const char* b, size_t size, const char *name); /* memory */
28 28
29int zread (ZIO* z, void* b, int n); /* read next n bytes */ 29size_t zread (ZIO* z, void* b, size_t n); /* read next n bytes */
30 30
31#define zgetc(z) (--(z)->n>=0 ? ((int)*(z)->p++): (z)->filbuf(z)) 31#define zgetc(z) (((z)->n--)>0 ? ((int)*(z)->p++): (z)->filbuf(z))
32#define zungetc(z) (++(z)->n,--(z)->p) 32#define zungetc(z) (++(z)->n,--(z)->p)
33#define zname(z) ((z)->name) 33#define zname(z) ((z)->name)
34 34
@@ -38,7 +38,7 @@ int zread (ZIO* z, void* b, int n); /* read next n bytes */
38#define ZBSIZE 256 /* buffer size */ 38#define ZBSIZE 256 /* buffer size */
39 39
40struct zio { 40struct zio {
41 int n; /* bytes still unread */ 41 size_t n; /* bytes still unread */
42 const unsigned char* p; /* current position in buffer */ 42 const unsigned char* p; /* current position in buffer */
43 int (*filbuf)(ZIO* z); 43 int (*filbuf)(ZIO* z);
44 void* u; /* additional data */ 44 void* u; /* additional data */