aboutsummaryrefslogtreecommitdiff
path: root/lzio.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-11-21 17:00:46 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-11-21 17:00:46 -0200
commitaccd7bc25355be4350db6d117515c672121a67f2 (patch)
treee351b89ca86b67a3c60874c230626a13517524b8 /lzio.c
parent6153200bc25bd99f9d3d25d7caa486b03b6535d5 (diff)
downloadlua-accd7bc25355be4350db6d117515c672121a67f2.tar.gz
lua-accd7bc25355be4350db6d117515c672121a67f2.tar.bz2
lua-accd7bc25355be4350db6d117515c672121a67f2.zip
small modifications (format, small optimizations, etc)
Diffstat (limited to 'lzio.c')
-rw-r--r--lzio.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lzio.c b/lzio.c
index bd714ea1..eebecb08 100644
--- a/lzio.c
+++ b/lzio.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: zio.c,v 1.2 1997/06/20 19:25:54 roberto Exp $ 2** $Id: lzio.c,v 1.1 1997/09/16 19:25:59 roberto Exp roberto $
3** a generic input stream interface 3** a generic input stream interface
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -15,12 +15,12 @@
15 15
16/* ----------------------------------------------------- memory buffers --- */ 16/* ----------------------------------------------------- memory buffers --- */
17 17
18static int zmfilbuf(ZIO* z) 18static int zmfilbuf (ZIO* z)
19{ 19{
20 return EOZ; 20 return EOZ;
21} 21}
22 22
23ZIO* zmopen(ZIO* z, char* b, int size) 23ZIO* zmopen (ZIO* z, char* b, int size)
24{ 24{
25 if (b==NULL) return NULL; 25 if (b==NULL) return NULL;
26 z->n=size; 26 z->n=size;
@@ -32,7 +32,7 @@ ZIO* zmopen(ZIO* z, char* b, int size)
32 32
33/* ------------------------------------------------------------ strings --- */ 33/* ------------------------------------------------------------ strings --- */
34 34
35ZIO* zsopen(ZIO* z, char* s) 35ZIO* zsopen (ZIO* z, char* s)
36{ 36{
37 if (s==NULL) return NULL; 37 if (s==NULL) return NULL;
38 return zmopen(z,s,strlen(s)); 38 return zmopen(z,s,strlen(s));
@@ -40,7 +40,7 @@ ZIO* zsopen(ZIO* z, char* s)
40 40
41/* -------------------------------------------------------------- FILEs --- */ 41/* -------------------------------------------------------------- FILEs --- */
42 42
43static int zffilbuf(ZIO* z) 43static int zffilbuf (ZIO* z)
44{ 44{
45 int n=fread(z->buffer,1,ZBSIZE,z->u); 45 int n=fread(z->buffer,1,ZBSIZE,z->u);
46 if (n==0) return EOZ; 46 if (n==0) return EOZ;
@@ -50,7 +50,7 @@ static int zffilbuf(ZIO* z)
50} 50}
51 51
52 52
53ZIO* zFopen(ZIO* z, FILE* f) 53ZIO* zFopen (ZIO* z, FILE* f)
54{ 54{
55 if (f==NULL) return NULL; 55 if (f==NULL) return NULL;
56 z->n=0; 56 z->n=0;
@@ -62,7 +62,7 @@ ZIO* zFopen(ZIO* z, FILE* f)
62 62
63 63
64/* --------------------------------------------------------------- read --- */ 64/* --------------------------------------------------------------- read --- */
65int zread(ZIO *z, void *b, int n) 65int zread (ZIO *z, void *b, int n)
66{ 66{
67 while (n) { 67 while (n) {
68 int m; 68 int m;