11#ifndef LOADERS_GP_IO_PARSER_H
12#define LOADERS_GP_IO_PARSER_H
90#define GP_IO_TYPE_MASK 0xff00
I/O abstraction for gfxprim loaders.
int gp_io_readf(gp_io *self, const uint16_t *types,...)
Parses a data accodingly to the array of types.
int gp_io_read_b4(gp_io *self, uint32_t *val)
Reads a single 32bit big endian integer.
gp_io_fmt_types
Formatted binary read and write types.
@ GP_IO_CONST
A constant byte in lower half of the 16bit integer.
@ GP_IO_L2
Reads or writes two bytes in a little endian order.
@ GP_IO_L4
Reads or writes four bytes in a little endian order.
@ GP_IO_B2
Reads or writes two bytes in a big endian order.
@ GP_IO_IGN
Ignore bytes on read, size in lower half.
@ GP_IO_BYTE
Reads or writes a single byte.
@ GP_IO_ARRAY
Pointer to byte array, size in lower half.
@ GP_IO_B4
Reads or writes four bytes in a big endian order.
@ GP_IO_I1
Ignore single byte on read.
@ GP_IO_I2
Ignore two bytes on read.
@ GP_IO_I3
Ignore three bytes on read.
@ GP_IO_I4
Ignore four bytes on read.
@ GP_IO_PPSTR
A photoshop pascal string.
@ GP_IO_END
End of the types array.
int gp_io_writef(gp_io *self, const uint16_t *types,...)
Writes a data accodingly to the array of types.
char * gp_io_read_b2_utf16(gp_io *io, size_t nchars)
Reads unicode string stored in big endian utf16 format.
int gp_io_read_b2(gp_io *self, uint16_t *val)
Reads a single 16bit big endian integer.