|
LispBM
|
#include <lbm_memory.h>#include <stdio.h>#include <stdlib.h>#include <stdbool.h>#include <string.h>#include <eval_cps.h>#include "extensions.h"#include "lbm_utils.h"
Functions | |
| void | lbm_extensions_set_next (lbm_uint i) |
| lbm_value | lbm_extensions_default (lbm_value *args, lbm_uint argn) |
| bool | 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) |
| extension_fptr | lbm_get_extension (lbm_uint sym) |
| bool | lbm_clr_extension (lbm_uint sym_id) |
| bool | lbm_lookup_extension_id (char *sym_str, lbm_uint *ix) |
| bool | lbm_add_extension (char *sym_str, extension_fptr ext) |
| static bool | lbm_is_number_all (lbm_value *args, lbm_uint argn) |
| 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 | make_list (int num,...) |
| bool | strmatch (const char *str1, const char *str2) |
Variables | |
| static lbm_uint | ext_max = 0 |
| static lbm_uint | next_extension_ix = 0 |
| lbm_extension_t * | extension_table = NULL |
| bool lbm_add_extension | ( | char * | sym_str, |
| extension_fptr | ext | ||
| ) |
Adds a symbol-extension mapping.
| sym_str | String representation of symbol to use as key. |
| ext | The extension function pointer. |
Check if the number of arguments is n. Sets error-reason if result is false.
| argn | number of arguments. |
| n | number of expected arguments. |
Check if all arguments are numbers and that there is n of them. Sets error-reason if result is false.
| args | The argument array. |
| argn | The number of arguments. |
| n | The expected number of arguments. |
Check if all arguments are numbers. Sets error-reason if result is false.
| args | The argument array. |
| argn | The number of arguments. |
| 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.
| sym_id | Symbol id of the extension to clear. |
| bool lbm_extensions_init | ( | lbm_extension_t * | extension_storage, |
| lbm_uint | extension_storage_size | ||
| ) |
Initialize the extensions subsystem. Extension storage is allocated on lbm_memory.
| extension_storage_size | Size of function pointer array. |
| void lbm_extensions_set_next | ( | lbm_uint | i | ) |
Set the next index to be given out to the next added extension.
| i | Next index. |
| extension_fptr lbm_get_extension | ( | lbm_uint | sym | ) |
Look up an extension associated with a key symbol.
| sym | Symbol bound to the extension to look for. |
| lbm_uint lbm_get_max_extensions | ( | void | ) |
The number of extensions that can be allocated.
| lbm_uint lbm_get_num_extensions | ( | void | ) |
Get the number of allocated extensions
| bool lbm_lookup_extension_id | ( | char * | sym_str, |
| lbm_uint * | ix | ||
| ) |
Lookup an extensions index.
| sym_str | Extension name to look up. |
| ix | Pointer used to store result. |
| lbm_value make_list | ( | int | num, |
| ... | |||
| ) |
| bool strmatch | ( | const char * | str1, |
| const char * | str2 | ||
| ) |
|
static |
| lbm_extension_t* extension_table = NULL |
|
static |