Functions
Embryo Data String Functions

Functions that operate on strings in the memory of a virtual machine. More...

Functions

EAPI int embryo_data_string_length_get (Embryo_Program *ep, Embryo_Cell *str_cell)
 Retrieves the length of the string starting at the given cell. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

Functions that operate on strings in the memory of a virtual machine.

Function Documentation

◆ embryo_data_string_length_get()

EAPI int embryo_data_string_length_get ( Embryo_Program *  ep,
Embryo_Cell *  str_cell 
)

Retrieves the length of the string starting at the given cell.

Parameters
epThe program the cell is part of.
str_cellPointer to the first cell of the string.
Returns
The length of the string. 0 is returned if there is an error.

◆ embryo_data_string_get()

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.

Parameters
epThe program the cell is part of.
str_cellPointer to the first cell of the string.
dstThe given buffer.

◆ embryo_data_string_set()

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.

Parameters
epThe program the cell is part of.
srcThe given buffer.
str_cellPointer to the first cell to copy the string to.

◆ embryo_data_address_get()

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.

Parameters
epThe program whose virtual machine address is being queried.
addrThe given cell.
Returns
A pointer to the cell at the given address.