parrotcode: IO Layer Handling | |
Contents | C |
src/io/io_layers.c - IO Layer Handling
The Parrot IO subsystem uses a per-interpreter stack to provide a layer-based approach to IO.
Each layer implements a subset of the ParrotIOLayerAPI
vtable.
To find an IO function the layer stack is searched downwards until a non-NULL
function pointer is found for that particular slot.
PIO_base_new_layer
ParrotIOLayer
.
If a prototype *proto
is supplied then its values will be copied to the new instance.PIO_base_delete_layer
*layer
.PIO_push_layer
*pmc
) or the default stack.PIO_get_layer
PIO_push_layer_str
*pmc
).PIO_pop_layer
*pmc
) or the default stack.PIO_pop_layer_str
*pmc
) and return the name of the popped layer.
The layer gets freed.PIO_copy_stack
|