Here is a start for the IO skeleton. I implemented
open, close, read, write, setbuf and some constants in io.h
-Implements a simple ParrotIO PMC with null vtable
-open() takes a string for mode which is Perl-ish (<, >, >>, |, +>, +<)
Comments? Would the group prefer numeric constants here?
-write() does block buffering or no-buffering, (still need line
buffering)-read (currently raw read, unbuffered)
-setbuf() allows buffer control although it doesn't allow a user
supplied buffer at the moment (they are good sometimes because
automatic buffers are faster)
-close() just flushes the stream and closes
Added a sample file.pasm that does a open/write/close/open/read
test.
TODO: Lots and lots. Standard in/out/err streams so we can ditch stdio.
Read buffering, Line buffering, Pipes, Random access, filters,
async stuff.
I need feedback on this patch before I continue down the road.
Thanks,
Melvin
io-v2.patch
Description: Binary data