-
Notifications
You must be signed in to change notification settings - Fork 0
TIL Compiler API
A stack data type that works with bytes. It is used inside the compiler to store bytecode.
struct _til_bytes;
typedef struct _til_bytes* til_bytes_t;
Alloc and initialize a til_bytes_t instance.
til_bytes_t til_bytes_create();
Append a byte to a til_bytes_t instance.
void til_bytes_add
(til_bytes_t bytes, unsigned char b);
Append a bytes array to a til_bytes_t instance.
void til_bytes_add_str
(til_bytes_t bytes, unsigned char* a, size_t l);
Serialize and append a signed 16 bit integer to a til_bytes_t instance. Little-endian format is used for serialization.
void til_bytes_add_short
(til_bytes_t bytes, int16_t n);
Serialize and append an unsigned 16 bit integer to a til_bytes_t instance. Little-endian format is used for serialization.
void til_bytes_add_ushort
(til_bytes_t bytes, uint16_t n);
Serialize and append a signed 32 bit integer to a til_bytes_t instance. Little-endian format is used for serialization.
void til_bytes_add_int
(til_bytes_t bytes, int32_t n);
Serialize and append an unsigned 32 bit integer to a til_bytes_t instance. Little-endian format is used for serialization.
void til_bytes_add_uint
(til_bytes_t bytes, uint32_t n);
Serialize and append a signed 64 bit integer to a til_bytes_t instance. Little-endian format is used for serialization.
void til_bytes_add_long
(til_bytes_t bytes, int64_t n);
Serialize and append an unsigned 64 bit integer to a til_bytes_t instance. Little-endian format is used for serialization.
void til_bytes_add_ulong
(til_bytes_t bytes, uint64_t n);