|
EAPI int | embryo_init (void) |
| Initialises the Embryo library.
|
EAPI int | embryo_shutdown (void) |
| Shuts down the Embryo library.
|
EAPI Embryo_Program * | embryo_program_new (void *data, int size) |
| Creates a new Embryo program, with bytecode data that can be freed.
|
EAPI Embryo_Program * | embryo_program_const_new (void *data, int size) |
| Creates a new Embryo program, with bytecode data that cannot be freed.
|
EAPI Embryo_Program * | embryo_program_load (const char *file) |
| Creates a new Embryo program based on the bytecode data stored in the given file.
|
EAPI void | embryo_program_free (Embryo_Program *ep) |
| Frees the given Embryo program.
|
EAPI void | embryo_program_vm_push (Embryo_Program *ep) |
| Starts a new virtual machine session for the given program.
|
EAPI void | embryo_program_vm_pop (Embryo_Program *ep) |
| Frees the current virtual machine session associated with the given program.
|
EAPI void | embryo_swap_32 (unsigned int *v) |
| Ensures that the given unsigned integer is in the small endian format.
|
EAPI Embryo_Function | embryo_program_function_find (Embryo_Program *ep, const char *name) |
| Returns the function in the given program with the given name.
|
EAPI int | embryo_program_variable_count_get (Embryo_Program *ep) |
| Retrieves the number of public variables in the given program.
|
EAPI Embryo_Cell | embryo_program_variable_get (Embryo_Program *ep, int num) |
| Retrieves the location of the public variable in the given program with the given identifier.
|
EAPI Embryo_Error | embryo_program_error_get (Embryo_Program *ep) |
| Retrieves the current error code for the given program.
|
EAPI void * | embryo_program_data_get (Embryo_Program *ep) |
| Retrieves the data associated to the given program.
|
EAPI const char * | embryo_error_string_get (Embryo_Error error) |
| Retrieves a string describing the given error code.
|
EAPI void | embryo_data_string_get (Embryo_Program *ep, Embryo_Cell *str_cell, char *dst) |
| Copies the string starting at the given cell to the given buffer.
|
EAPI void | embryo_data_string_set (Embryo_Program *ep, const char *src, Embryo_Cell *str_cell) |
| Copies string in the given buffer into the virtual machine memory starting at the given cell.
|
EAPI Embryo_Cell * | embryo_data_address_get (Embryo_Program *ep, Embryo_Cell addr) |
| Retreives a pointer to the address in the virtual machine given by the given cell.
|
EAPI void | embryo_data_heap_pop (Embryo_Program *ep, Embryo_Cell down_to) |
| Decreases the size of the heap of the given virtual machine down to the given size.
|
EAPI Embryo_Status | embryo_program_run (Embryo_Program *ep, Embryo_Function func) |
| Runs the given function of the given Embryo program in the current virtual machine.
|
EAPI Embryo_Cell | embryo_program_return_value_get (Embryo_Program *ep) |
| Retreives the return value of the last called function of the given program.
|
EAPI void | embryo_program_max_cycle_run_set (Embryo_Program *ep, int max) |
| Sets the maximum number of abstract machine cycles any given program run can execute before being put to sleep and returning.
|
EAPI int | embryo_program_max_cycle_run_get (Embryo_Program *ep) |
| Retreives the maximum number of abstract machine cycles a program is allowed to run.
|
EAPI int | embryo_parameter_string_push (Embryo_Program *ep, const char *str) |
| Pushes a string onto the function stack to use as a parameter for the next function that is called in the given program.
|
EAPI int | embryo_parameter_cell_array_push (Embryo_Program *ep, Embryo_Cell *cells, int num) |
| Pushes an array of Embryo_Cells onto the function stack to be used as parameters for the next function that is called in the given program.
|
Embryo virtual machine library.
This file includes the routines needed for Embryo library interaction. This is the only file you need to include.