#include "heap.h"
#include "lbm_types.h"
#include "lbm_constants.h"
Go to the source code of this file.
◆ LBM_CHECK_ARGN
◆ LBM_CHECK_ARGN_NUMBER
◆ LBM_CHECK_NUMBER_ALL
◆ LBM_EXTENSION
◆ extension_fptr
Type representing an extension function.
- Parameters
-
Pointer | to array of lbm_values. |
Number | of arguments. |
- Returns
- Result value.
◆ lbm_add_extension()
Adds a symbol-extension mapping.
- Parameters
-
sym_str | String representation of symbol to use as key. |
ext | The extension function pointer. |
- Returns
- true on success and false on failure.
◆ lbm_check_argn()
Check if the number of arguments is n. Sets error-reason if result is false.
- Parameters
-
argn | number of arguments. |
n | number of expected arguments. |
- Returns
- true if the number of arguments is correct. false otherwise
◆ lbm_check_argn_number()
Check if all arguments are numbers and that there is n of them. Sets error-reason if result is false.
- Parameters
-
args | The argument array. |
argn | The number of arguments. |
n | The expected number of arguments. |
- Returns
- true or false.
◆ lbm_check_number_all()
Check if all arguments are numbers. Sets error-reason if result is false.
- Parameters
-
args | The argument array. |
argn | The number of arguments. |
- Returns
- true if all arguments are numbers, false otherwise.
◆ lbm_check_true_false()
Check if a value is the symbol t or the symbol nil
- Parameters
-
- Returns
- true if the value is t or nil otherwise false.
◆ lbm_clr_extension()
bool lbm_clr_extension |
( |
lbm_uint |
sym_id | ) |
|
Reset an extension back to the default value. Trying to apply the extension after clearing it will result in an eval error.
- Parameters
-
sym_id | Symbol id of the extension to clear. |
- Returns
- true if successfully cleared an extension otherwise false.
◆ lbm_extensions_default()
◆ lbm_extensions_init()
Initialize the extensions subsystem. Extension storage is allocated on lbm_memory.
- Parameters
-
extension_storage_size | Size of function pointer array. |
- Returns
- 1 on success and 0 for failure
◆ lbm_get_extension()
Look up an extension associated with a key symbol.
- Parameters
-
sym | Symbol bound to the extension to look for. |
- Returns
- extension_fptr on success or NULL on failure.
◆ lbm_get_max_extensions()
lbm_uint lbm_get_max_extensions |
( |
void |
| ) |
|
The number of extensions that can be allocated.
- Returns
- The maximum number of extensions that can be added.
◆ lbm_get_num_extensions()
lbm_uint lbm_get_num_extensions |
( |
void |
| ) |
|
Get the number of allocated extensions
- Returns
- The number of extensions that have been added.
◆ lbm_is_extension()
static bool lbm_is_extension |
( |
lbm_value |
exp | ) |
|
|
inlinestatic |
Check if an lbm_value is a symbol that is bound to an extension.
- Parameters
-
- Returns
- true if the lbm_value respresents an extension otherwise false.
◆ lbm_lookup_extension_id()
bool lbm_lookup_extension_id |
( |
char * |
sym_str, |
|
|
lbm_uint * |
ix |
|
) |
| |
Lookup an extensions index.
- Parameters
-
sym_str | Extension name to look up. |
ix | Pointer used to store result. |
- Returns
- true on success, false otherwise.
◆ extension_table