aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-06-18 18:39:56 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-06-18 18:39:56 -0300
commitb90b4bbd3aaa287b53663d0892d0ff85fe04b812 (patch)
tree760b4ab926daf7d3ea9dea8a515f2a64b5b8c0d6
parentf6d95140aeec014f904cf74bdc79bb99ee69f299 (diff)
downloadlua-b90b4bbd3aaa287b53663d0892d0ff85fe04b812.tar.gz
lua-b90b4bbd3aaa287b53663d0892d0ff85fe04b812.tar.bz2
lua-b90b4bbd3aaa287b53663d0892d0ff85fe04b812.zip
macros don't need prototypes.
-rw-r--r--zio.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/zio.h b/zio.h
index abb054a3..8f2e45da 100644
--- a/zio.h
+++ b/zio.h
@@ -1,7 +1,7 @@
1/* 1/*
2* zio.h 2* zio.h
3* a generic input stream interface 3* a generic input stream interface
4* $Id: zio.h,v 1.1 1997/06/16 16:50:22 roberto Exp roberto $ 4* $Id: zio.h,v 1.2 1997/06/18 20:30:52 roberto Exp roberto $
5*/ 5*/
6 6
7#ifndef zio_h 7#ifndef zio_h
@@ -17,22 +17,20 @@
17#define zpopen luaz_popen 17#define zpopen luaz_popen
18#define zsopen luaz_sopen 18#define zsopen luaz_sopen
19#define zmopen luaz_mopen 19#define zmopen luaz_mopen
20#define zread luaz_read
20 21
21#define EOZ (-1) /* end of stream */ 22#define EOZ (-1) /* end of stream */
22 23
23typedef struct zio ZIO; 24typedef struct zio ZIO;
24 25
25int zgetc(ZIO* z); /* get next byte */
26int zungetc(ZIO* z); /* put back last byte read */
27int zread(ZIO* z, void* b, int n); /* read next n bytes */
28int zclose(ZIO* z); /* close stream */
29
30ZIO* zFopen(ZIO* z, FILE* f); /* open FILEs */ 26ZIO* zFopen(ZIO* z, FILE* f); /* open FILEs */
31ZIO* zfopen(ZIO* z, char* s, char* m); /* file by name */ 27ZIO* zfopen(ZIO* z, char* s, char* m); /* file by name */
32ZIO* zpopen(ZIO* z, char* s, char* m); /* pipe */ 28ZIO* zpopen(ZIO* z, char* s, char* m); /* pipe */
33ZIO* zsopen(ZIO* z, char* s); /* string */ 29ZIO* zsopen(ZIO* z, char* s); /* string */
34ZIO* zmopen(ZIO* z, char* b, int size); /* memory */ 30ZIO* zmopen(ZIO* z, char* b, int size); /* memory */
35 31
32int zread(ZIO* z, void* b, int n); /* read next n bytes */
33
36#define zgetc(z) (--(z)->n>=0 ? ((int)*(z)->p++): (z)->filbuf(z)) 34#define zgetc(z) (--(z)->n>=0 ? ((int)*(z)->p++): (z)->filbuf(z))
37#define zungetc(z) (++(z)->n,--(z)->p) 35#define zungetc(z) (++(z)->n,--(z)->p)
38#define zclose(z) (*(z)->close)(z) 36#define zclose(z) (*(z)->close)(z)