From 03f3f9e707ceaf46efb4917f8d32ea62283b9358 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 22 Dec 1997 18:57:18 -0200 Subject: "zio" now keeps its "name". --- lzio.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lzio.c') diff --git a/lzio.c b/lzio.c index eebecb08..35a2d6a7 100644 --- a/lzio.c +++ b/lzio.c @@ -1,5 +1,5 @@ /* -** $Id: lzio.c,v 1.1 1997/09/16 19:25:59 roberto Exp roberto $ +** $Id: lzio.c,v 1.2 1997/11/21 19:00:46 roberto Exp roberto $ ** a generic input stream interface ** See Copyright Notice in lua.h */ @@ -20,22 +20,23 @@ static int zmfilbuf (ZIO* z) return EOZ; } -ZIO* zmopen (ZIO* z, char* b, int size) +ZIO* zmopen (ZIO* z, char* b, int size, char *name) { if (b==NULL) return NULL; z->n=size; z->p= (unsigned char *)b; z->filbuf=zmfilbuf; z->u=NULL; + z->name=name; return z; } /* ------------------------------------------------------------ strings --- */ -ZIO* zsopen (ZIO* z, char* s) +ZIO* zsopen (ZIO* z, char* s, char *name) { if (s==NULL) return NULL; - return zmopen(z,s,strlen(s)); + return zmopen(z,s,strlen(s),name); } /* -------------------------------------------------------------- FILEs --- */ @@ -50,13 +51,14 @@ static int zffilbuf (ZIO* z) } -ZIO* zFopen (ZIO* z, FILE* f) +ZIO* zFopen (ZIO* z, FILE* f, char *name) { if (f==NULL) return NULL; z->n=0; z->p=z->buffer; z->filbuf=zffilbuf; z->u=f; + z->name=name; return z; } -- cgit v1.2.3-55-g6feb