LispBM
Functions
lbm_variables.h File Reference
#include "lbm_types.h"
Include dependency graph for lbm_variables.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int lbm_variables_init (lbm_value *variable_storage, int variable_storage_size)
 
lbm_valuelbm_get_variable_table (void)
 
lbm_value lbm_get_variable_by_index (int i)
 
const char * lbm_get_variable_name_by_index (int index)
 
lbm_value lbm_get_var (lbm_uint index)
 
lbm_value lbm_set_var (lbm_uint index, lbm_value value)
 

Function Documentation

◆ lbm_get_var()

lbm_value lbm_get_var ( lbm_uint  index)

Get value of variable at index.

Parameters
indexvariable index to access.
Returns
Value of variable at index. This value if NIL if there is no binding.

◆ lbm_get_variable_by_index()

lbm_value lbm_get_variable_by_index ( int  i)

Get the value of a variable index.

Parameters
iIndex of variable to access.
Returns
Value of variable at index.

◆ lbm_get_variable_name_by_index()

const char* lbm_get_variable_name_by_index ( int  index)

Lookup what the name of the variable associated with a specific index in the variable storage is.

Parameters
indexIndex of variable of interes.
Returns
Pointer to a string on success or null if no variable is associated with that index.

◆ lbm_get_variable_table()

lbm_value* lbm_get_variable_table ( void  )

Get a pointer to the variable storage area.

Returns
Pointer to storage area or NULL on failure.

◆ lbm_set_var()

lbm_value lbm_set_var ( lbm_uint  index,
lbm_value  value 
)

Set value of a variable

Parameters
indexIndex of variable to set. \paran value Value to set the variable to.
Returns
Value of variable or NIL if index is out of range.

◆ lbm_variables_init()

int lbm_variables_init ( lbm_value variable_storage,
int  variable_storage_size 
)

Initialize the variable storage area

Parameters
variable_storagePointer to array where variables are stored.
variable_storage_sizeNumber of variables that can be stored in the array.
Returns
1 on success and 0 on failure.