| parrotcode: Parrot IO | |
| Contents | PMCs |

src/pmc/parrotio.pmc - Parrot IO

These are the vtable functions for Parrot IO.

METHOD INTVAL say(STRING *s)METHOD PMC *open(STRING *file, STRING *mode, STRING *layer)METHOD INTVAL set_readline_interactive(INTVAL) -1 ... readline isn't configured
-2 ... file not open/not input or not a tty, if turning on interactive
0 / 1 old interactive setting
METHOD STRING *readline(STRING *prompt)readline opcode (which will be removed anyway). In interactive mode non-empty lines are added to the readline history. NULL ... end of input (e.g. after ^D or end of file)
pio = getstdin
$I0 = pio.'set_readline_interactive'(1)
if $I0 >= 0 goto loop
printerr "set_readline_interactive failed: "
...
loop:
s = pio.'readline'('hello polly> ')
if null s goto ex
..
goto loop
ex:
void class_init()METHOD INTVAL eof()METHOD void flush()METHOD INTVAL setbuf(INTVAL)METHOD INTVAL setlinebuf()void init()void destroy()PMC *clone()ParrotIO object. If we have different IO layers, we might copy data and struct_val.INTVAL get_bool()EOF or not.STRING *get_string_keyed_int(INTVAL n)void push_string (STRING *value)value onto the PIO's layer stack.STRING *pop_string ()
Initial version by leo 2003/06/23.
|
|
|