#include "heap.h"
#include "lbm_types.h"
#include "lbm_constants.h"
Go to the source code of this file.
|
int | lbm_extensions_init (lbm_extension_t *extension_storage, lbm_uint extension_storage_size) |
|
lbm_uint | lbm_get_max_extensions (void) |
|
lbm_uint | lbm_get_num_extensions (void) |
|
bool | lbm_lookup_extension_id (char *sym_str, lbm_uint *ix) |
|
extension_fptr | lbm_get_extension (lbm_uint sym) |
|
bool | lbm_clr_extension (lbm_uint sym_id) |
|
bool | lbm_add_extension (char *sym_str, extension_fptr ext) |
|
static bool | lbm_is_extension (lbm_value exp) |
|
bool | lbm_check_true_false (lbm_value v) |
|
bool | lbm_check_number_all (lbm_value *args, lbm_uint argn) |
|
bool | lbm_check_argn (lbm_uint argn, lbm_uint n) |
|
bool | lbm_check_argn_number (lbm_value *args, lbm_uint argn, lbm_uint n) |
|
lbm_value | lbm_extensions_default (lbm_value *args, lbm_uint argn) |
|
lbm_value | make_list (int num,...) |
|
bool | strmatch (const char *str1, const char *str2) |
|
static lbm_value | mk_lam (lbm_value args, lbm_value body) |
|
static lbm_value | mk_call_cc (lbm_value body) |
|
static lbm_value | mk_let (lbm_value bindings, lbm_value body) |
|
static lbm_value | mk_if (lbm_value cond, lbm_value tb, lbm_value fb) |
|
static lbm_value | mk_inc (lbm_value v) |
|
static lbm_value | mk_lt (lbm_value a, lbm_value b) |
|
static lbm_value | mk_eq (lbm_value a, lbm_value b) |
|
static lbm_value | mk_car (lbm_value a) |
|
static lbm_value | mk_cdr (lbm_value a) |
|
◆ 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.
◆ make_list()
◆ mk_call_cc()
◆ mk_car()
◆ mk_cdr()
◆ mk_eq()
◆ mk_if()
◆ mk_inc()
◆ mk_lam()
◆ mk_let()
◆ mk_lt()
◆ strmatch()
bool strmatch |
( |
const char * |
str1, |
|
|
const char * |
str2 |
|
) |
| |
◆ extension_table