Embryo Data String Functions

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

Functions

int embryo_data_string_length_get (Embryo_Program *ep, Embryo_Cell *str_cell)
 Retrieves the length of the string starting at the given cell.
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.
void embryo_data_string_set (Embryo_Program *ep, char *src, Embryo_Cell *str_cell)
 Copies string in the given buffer into the virtual machine memory starting at the given cell.
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.

Detailed Description

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


Function Documentation

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:
ep The program whose virtual machine address is being queried.
addr The given cell.
Returns:
A pointer to the cell at the given address.

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:
ep The program the cell is part of.
str_cell Pointer to the first cell of the string.
dst The given buffer.

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:
ep The program the cell is part of.
str_cell Pointer to the first cell of the string.
Returns:
The length of the string. 0 is returned if there is an error.

void embryo_data_string_set Embryo_Program *  ep,
char *  src,
Embryo_Cell *  str_cell
 

Copies string in the given buffer into the virtual machine memory starting at the given cell.

Parameters:
ep The program the cell is part of.
src The given buffer.
str_cell Pointer to the first cell to copy the string to.