diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-12-22 18:57:18 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-12-22 18:57:18 -0200 |
commit | 03f3f9e707ceaf46efb4917f8d32ea62283b9358 (patch) | |
tree | cdf8e8d255fc95e09b94521dff35cd4f0f57d1e6 /lzio.h | |
parent | a78eecee48c725549316629b9a8d936c990b65de (diff) | |
download | lua-03f3f9e707ceaf46efb4917f8d32ea62283b9358.tar.gz lua-03f3f9e707ceaf46efb4917f8d32ea62283b9358.tar.bz2 lua-03f3f9e707ceaf46efb4917f8d32ea62283b9358.zip |
"zio" now keeps its "name".
Diffstat (limited to 'lzio.h')
-rw-r--r-- | lzio.h | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lzio.h,v 1.1 1997/09/16 19:25:59 roberto Exp roberto $ | 2 | ** $Id: lzio.h,v 1.2 1997/11/21 19:00:46 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 | */ |
@@ -22,15 +22,15 @@ | |||
22 | 22 | ||
23 | typedef struct zio ZIO; | 23 | typedef struct zio ZIO; |
24 | 24 | ||
25 | ZIO* zFopen (ZIO* z, FILE* f); /* open FILEs */ | 25 | ZIO* zFopen (ZIO* z, FILE* f, char *name); /* open FILEs */ |
26 | ZIO* zsopen (ZIO* z, char* s); /* string */ | 26 | ZIO* zsopen (ZIO* z, char* s, char *name); /* string */ |
27 | ZIO* zmopen (ZIO* z, char* b, int size); /* memory */ | 27 | ZIO* zmopen (ZIO* z, char* b, int size, char *name); /* memory */ |
28 | 28 | ||
29 | int zread (ZIO* z, void* b, int n); /* read next n bytes */ | 29 | int zread (ZIO* z, void* b, int 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 | 33 | #define zname(z) ((z)->name) | |
34 | 34 | ||
35 | 35 | ||
36 | /* --------- Private Part ------------------ */ | 36 | /* --------- Private Part ------------------ */ |
@@ -43,6 +43,7 @@ struct zio { | |||
43 | int (*filbuf)(ZIO* z); | 43 | int (*filbuf)(ZIO* z); |
44 | void* u; /* additional data */ | 44 | void* u; /* additional data */ |
45 | unsigned char buffer[ZBSIZE]; /* buffer */ | 45 | unsigned char buffer[ZBSIZE]; /* buffer */ |
46 | char *name; | ||
46 | }; | 47 | }; |
47 | 48 | ||
48 | 49 | ||