struct Vyt?Trans2
2d transformation matrix
Y coordinate shift
VytStream
Any stream type
VytPtr vyt_alloc( VytPtr old, VytU size )
(re)allocate memory in current frame
void vyt_frame( bool openNew )
open new frame or close current
if called with true, creates a new frame to remember allocations
if called with false, frees all vyt_alloc-ed memory in the frame
and destroys frame itself
VytPtr vyt_raise( VytPtr )
raises allocation of memory to previous frame
dies if there is no previous frame
VtlMem
Resizable allocated memory
VytU (* VytStreamOp)( VytStream stream, VytPtr mem, VytU size )
Custom read or write operation
stream Pointer to the stream
mem Pointer to data
size Number of bytes to read or write
return Number of bytes successfully read or written
VytU vyt_fread( VytStream stream, VytPtr mem, VytU size )
fread as
VytStreamOp
VytU vyt_fread_part( VytStream stream, VytPtr mem, VytU size )
fread as
VytStreamOp, can read less than full block
VytU vyt_fwrite( VytStream stream, VytPtr mem, VytU size )
fwrite as
VytStreamOp
VytU vyt_mread( VytStream stream, VytPtr mem, VytU size )
memory copy from (VytPtr *)stream to mem
VytU vyt_mwrite( VytStream stream, VytPtr mem, VytU size )
memory copy form mem to (VytPtr *)stream
bool vyt_block_op( VytStream stream, VytStreamOp op, VytPtr mem, VytU size )
write or read a complete block using
VytStreamOp.
Keeps calling
op until
size is reached or
0 is returned
stream Pointer to the stream
op The read or write operation
mem Pointer to data
size Total number of bytes to write
return true if all size bytes are read or written
bool vyt_read_skip( VytStream stream, VytStreamOp read, VytU size )
skip reading bytes.
Calls
read without using the data read
stream Pointer to the stream
read The read or write operation
size Total number of bytes to skip
return true if all size bytes are skipped
vyt_ewrite( ... )
write line to std error.
vyt_die( ... )
write line to std error and exit program.
bool vyt_nat( VytStr s, VytU * nat )
converts string to natural number
s The string
nat Number is returned here
return true on success
bool vyt_same( VytStr a, VytStr b )
same strings (
NULL proof)
a First string
b Second string
return true if both are NULL or the two are the same
VytStr vyt_sprintf( VytStr fmt, ... )
format string (uses static buffer)
fmt Format string
return The formatted string
VytZ vyt_stamp()
milliseconds passed since epoch
VytU vyt_stamp_diff()
milliseconds passed since last call to
vyt_stamp_diff