lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

In message <199703171724.OAA27152@server02> lhf writes:

 > I suggest you write a simple stdio replacement that reads from strings.
 > Something like:
 > typedef struct {
 >      char* buffer; /* original string */
 >      char* current;
 >      int size;
 >      ...     
 > } FILE;
 > int getc(FILE* f)
 > {
 >      if (current<(buffer+size)) return *current++
 > }

Thanks, this is about what I intended to do; it might take me a week
or so to find the time, however...
 > With this replacement, you should be able to use undump.c as is.
 > Also, you can arrange so that stdin, stdout and stderr act as /dev/null/.
 > This should be compatible with the rest of the stdio code in Lua.
 > Now, someone in the world probably has already written such a replacement for
 > stdio, although it's pretty easy to write too. If you do write it, I'd be
 > interested.

Me too, anyone care to respond?

--  Mark Ian Barlow                Non-Linear Control Consultants Ltd.
    -----------------------------------------------------------------            Voice / Fax: +44 (0)1207 562 154