| parrotcode: Fetch/store packfile data | |
| Contents | C |

src/packfile/pf_items.c - Fetch/store packfile data

Low level packfile functions to fetch and store Parrot data,
i.e.
INTVAL,
FLOATVAL,
STRING ...
PF_fetch_<item>() functions retrieve the datatype item from the opcode stream and convert byteordering or binary format on the fly,
depending on the packfile header.
PF_store_<item>() functions write the datatype item to the stream as is.
These functions don't check the available size.
PF_size_<item>() functions return the store size of item in opcode_t units.

PF_fetch_opcodeopcode_t from the stream,
converting byteorder if needed.PF_store_opcodeopcode_t to stream as is.PF_size_opcodeopcode_t units,
which is 1 per definitionem.PF_fetch_integerINTVAL from the stream,
converting byteorder if needed.sizeof (INTVAL) == sizeof (opcode_t) - we don't have INTVAL size in the PackFile header.PF_store_integerINTVAL to stream as is.PF_size_integerINTVAL in opcode_t units.PF_fetch_numberFLOATVAL from the stream,
converting byteorder if needed.
Then advance stream pointer by amount of packfile float size.PF_store_numberFLOATVAL to the opcode stream as is.PF_size_numberPF_fetch_stringSTRING from bytecode and return a new STRING. opcode_t flags
opcode_t encoding
opcode_t type
opcode_t size
* data
PF_store_stringPF_size_stringSTRING in opcode_t units.PF_fetch_cstringPF_store_cstringPF_size_cstringopcode_t units.PackFile_assign_transforms
Initial review by leo 2003.11.21
Most routines moved from src/packfile.c.
Renamed PackFile_* to PF_*

<PF_store_<type()>> - write an opcode_t stream to cursor in natural byte-ordering.
<PF_fetch_<type()>> - read items and possibly convert the foreign format.
<PF_size_<type()>> - return the needed size in opcode_t units.
|
|
|