diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-06-18 18:39:56 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-06-18 18:39:56 -0300 |
| commit | b90b4bbd3aaa287b53663d0892d0ff85fe04b812 (patch) | |
| tree | 760b4ab926daf7d3ea9dea8a515f2a64b5b8c0d6 | |
| parent | f6d95140aeec014f904cf74bdc79bb99ee69f299 (diff) | |
| download | lua-b90b4bbd3aaa287b53663d0892d0ff85fe04b812.tar.gz lua-b90b4bbd3aaa287b53663d0892d0ff85fe04b812.tar.bz2 lua-b90b4bbd3aaa287b53663d0892d0ff85fe04b812.zip | |
macros don't need prototypes.
| -rw-r--r-- | zio.h | 10 |
1 files changed, 4 insertions, 6 deletions
| @@ -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 | ||
| 23 | typedef struct zio ZIO; | 24 | typedef struct zio ZIO; |
| 24 | 25 | ||
| 25 | int zgetc(ZIO* z); /* get next byte */ | ||
| 26 | int zungetc(ZIO* z); /* put back last byte read */ | ||
| 27 | int zread(ZIO* z, void* b, int n); /* read next n bytes */ | ||
| 28 | int zclose(ZIO* z); /* close stream */ | ||
| 29 | |||
| 30 | ZIO* zFopen(ZIO* z, FILE* f); /* open FILEs */ | 26 | ZIO* zFopen(ZIO* z, FILE* f); /* open FILEs */ |
| 31 | ZIO* zfopen(ZIO* z, char* s, char* m); /* file by name */ | 27 | ZIO* zfopen(ZIO* z, char* s, char* m); /* file by name */ |
| 32 | ZIO* zpopen(ZIO* z, char* s, char* m); /* pipe */ | 28 | ZIO* zpopen(ZIO* z, char* s, char* m); /* pipe */ |
| 33 | ZIO* zsopen(ZIO* z, char* s); /* string */ | 29 | ZIO* zsopen(ZIO* z, char* s); /* string */ |
| 34 | ZIO* zmopen(ZIO* z, char* b, int size); /* memory */ | 30 | ZIO* zmopen(ZIO* z, char* b, int size); /* memory */ |
| 35 | 31 | ||
| 32 | int 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) |
