Tilde Friends
JS binary serialization

Typedefs

typedef struct _tf_task_t tf_task_t
 
typedef struct _tf_taskstub_t tf_taskstub_t
 

Functions

void tf_serialize_store (tf_task_t *task, tf_taskstub_t *to, void **out_buffer, size_t *out_size, JSValue value)
 
JSValue tf_serialize_load (tf_task_t *task, tf_taskstub_t *from, const char *buffer, size_t size)
 

Detailed Description

Converts JS data to a basic binary format with support for exporting functions so that they can be called across the barrier, too.

Typedef Documentation

◆ tf_task_t

typedef struct _tf_task_t tf_task_t

A task.

◆ tf_taskstub_t

typedef struct _tf_taskstub_t tf_taskstub_t

A handle to a remote task.

Function Documentation

◆ tf_serialize_load()

JSValue tf_serialize_load ( tf_task_t task,
tf_taskstub_t from,
const char *  buffer,
size_t  size 
)

Retrieve JS data from a binary blob.

Parameters
taskThe calling task.
fromThe handle to the task from which the data was received.
bufferThe data.
sizeThe size of the data.
Returns
The received JS data.

◆ tf_serialize_store()

void tf_serialize_store ( tf_task_t task,
tf_taskstub_t to,
void **  out_buffer,
size_t *  out_size,
JSValue  value 
)

Store JS data in a binary blob.

Parameters
taskThe calling task.
toThe handle to the task to which the data will be sent.
[out]out_bufferPopulated with the stored data.
[out]out_sizePopulated with the size of out_data.
valueThe JS value to store.