Skip to content

TIL Compiler API

Andrea Fioraldi edited this page Mar 8, 2017 · 2 revisions

Data types

til_bytes_t

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;

Functions

til_bytes_create

Alloc and initialize a til_bytes_t instance.

til_bytes_t til_bytes_create();

til_bytes_add

Append a byte to a til_bytes_t instance.

void til_bytes_add
	(til_bytes_t bytes, unsigned char b);

til_bytes_add_str

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);

til_bytes_add_short

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);

til_bytes_add_ushort

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);

til_bytes_add_int

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);

til_bytes_add_uint

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);

til_bytes_add_long

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);

til_bytes_add_ulong

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);
Clone this wiki locally