Retro Rocket Kernel BASIC-Powered Operating System

Data Structures | Macros | Typedefs | Enumerations | Functions
ubasic.h File Reference

Retro Rocket BASIC interpreter. More...

## Data Structures
struct | for_state
| State for a FOR...NEXT loop. More...
struct | ub_var_int
| An integer variable. More...
struct | ub_var_double
| A real (double) variable. More...
struct | ub_var_string
| A string variable. More...
struct | ub_param
| FN/PROC parameter. More...
struct | ub_proc_fn_def
| Procedure or function definition Each has a name, a type, a starting line and a parameter list. More...
struct | ub_var_int_array
| An array of integers. More...
struct | ub_var_string_array
| An array of strings. More...
struct | ub_var_double_array
| An array of real (double) More...
struct | ub_var_generic_array
| A generic array, we can use this to represent any array regardless of its contained type. More...
struct | ub_line_ref
| Line reference in program. Each program has a hashmap of these so it can find a line number in O(1) time. More...
struct | ubasic_ctx
| BASIC program context. Every instance of a BASIC program has one of these,* also certain structures such as functions will clone the context and run on the clone until the function completes. Cloned contexts share variables and you should never call ubasic_destroy() on them! More...
struct | ubasic_int_fn
| Builtin integer function. More...
struct | ubasic_double_fn
| Builtin real (double) function. More...
struct | ubasic_str_fn
| Builtin string function. More...

## Macros
#define | MAX_STRINGLEN 1024
| Maximum length of a string variable. More...
#define | MAX_CALL_STACK_DEPTH 255
| Maximum stack depth of GOSUB, PROC, FN. More...
#define | MAX_LOOP_STACK_DEPTH 255
| Maximum stack depth of FOR...NEXT. More...
#define | EVAL_LINE 999999998
| Specil line number where EVAL code is inserted dynamically. More...
#define | EVAL_END_LINE 999999999
| RETURN statement after EVAL code. More...
#define | AUX(x) #x
#define | STRINGIFY(x) AUX(x)
#define | PARAMS_START
| Begin parsing function parameters. More...
#define | PARAMS_GET_ITEM(type)
| Get a function parameter of type. More...
#define | PARAMS_END(NAME)
| Ends fetching of function parameters, throwing an error if parameters still remain. More...

## Typedefs
typedef int64_t(* | builtin_int_fn) (struct ubasic_ctx *ctx)
| Integer function signature. More...
typedef char *(* | builtin_str_fn) (struct ubasic_ctx *ctx)
| String function signature. More...
typedef void(* | builtin_double_fn) (struct ubasic_ctx *ctx, double *res)
| Real (double) function signature. More...

## Enumerations
enum | ub_fn_type { FT_FN , FT_PROC }
| Function or procedure. More...
enum | ub_return_type { RT_MAIN , RT_NONE , RT_STRING , RT_INT , RT_FLOAT }
| Return type of FN, PROC. More...
enum | parameter_type_t { BIP_STRING , BIP_INT , BIP_DOUBLE , BIP_VARIABLE }

## Functions
bool | valid_int_var (const char *name)
bool | valid_string_var (const char *name)
bool | valid_double_var (const char *name)
int64_t | ubasic_abs (struct ubasic_ctx *ctx)
int64_t | ubasic_len (struct ubasic_ctx *ctx)
int64_t | ubasic_openin (struct ubasic_ctx *ctx)
int64_t | ubasic_openout (struct ubasic_ctx *ctx)
int64_t | ubasic_openup (struct ubasic_ctx *ctx)
int64_t | ubasic_eof (struct ubasic_ctx *ctx)
int64_t | ubasic_read (struct ubasic_ctx *ctx)
int64_t | ubasic_instr (struct ubasic_ctx *ctx)
int64_t | ubasic_asc (struct ubasic_ctx *ctx)
int64_t | ubasic_getnamecount (struct ubasic_ctx *ctx)
int64_t | ubasic_getsize (struct ubasic_ctx *ctx)
int64_t | ubasic_get_text_max_x (struct ubasic_ctx *ctx)
int64_t | ubasic_get_text_max_y (struct ubasic_ctx *ctx)
int64_t | ubasic_get_text_cur_x (struct ubasic_ctx *ctx)
int64_t | ubasic_get_text_cur_y (struct ubasic_ctx *ctx)
int64_t | ubasic_getproccount (struct ubasic_ctx *ctx)
int64_t | ubasic_getprocid (struct ubasic_ctx *ctx)
int64_t | ubasic_getprocparent (struct ubasic_ctx *ctx)
int64_t | ubasic_getproccpuid (struct ubasic_ctx *ctx)
int64_t | ubasic_rgb (struct ubasic_ctx *ctx)
int64_t | ubasic_get_free_mem (struct ubasic_ctx *ctx)
int64_t | ubasic_get_used_mem (struct ubasic_ctx *ctx)
int64_t | ubasic_get_total_mem (struct ubasic_ctx *ctx)
int64_t | ubasic_sockstatus (struct ubasic_ctx *ctx)
int64_t | ubasic_ctrlkey (struct ubasic_ctx *ctx)
int64_t | ubasic_shiftkey (struct ubasic_ctx *ctx)
int64_t | ubasic_altkey (struct ubasic_ctx *ctx)
int64_t | ubasic_capslock (struct ubasic_ctx *ctx)
int64_t | ubasic_random (struct ubasic_ctx *ctx)
char * | ubasic_netinfo (struct ubasic_ctx *ctx)
char * | ubasic_left (struct ubasic_ctx *ctx)
char * | ubasic_right (struct ubasic_ctx *ctx)
char * | ubasic_mid (struct ubasic_ctx *ctx)
char * | ubasic_chr (struct ubasic_ctx *ctx)
char * | ubasic_readstring (struct ubasic_ctx *ctx)
char * | ubasic_getname (struct ubasic_ctx *ctx)
char * | ubasic_getprocname (struct ubasic_ctx *ctx)
char * | ubasic_dns (struct ubasic_ctx *ctx)
char * | ubasic_ramdisk_from_device (struct ubasic_ctx *ctx)
char * | ubasic_ramdisk_from_size (struct ubasic_ctx *ctx)
char * | ubasic_inkey (struct ubasic_ctx *ctx)
char * | ubasic_insocket (struct ubasic_ctx *ctx)
char * | ubasic_upper (struct ubasic_ctx *ctx)
char * | ubasic_lower (struct ubasic_ctx *ctx)
char * | ubasic_tokenize (struct ubasic_ctx *ctx)
char * | ubasic_csd (struct ubasic_ctx *ctx)
void | openin_statement (struct ubasic_ctx *ctx)
void | openup_statement (struct ubasic_ctx *ctx)
void | openout_statement (struct ubasic_ctx *ctx)
void | read_statement (struct ubasic_ctx *ctx)
void | close_statement (struct ubasic_ctx *ctx)
void | eof_statement (struct ubasic_ctx *ctx)
void | delete_statement (struct ubasic_ctx *ctx)
void | mkdir_statement (struct ubasic_ctx *ctx)
void | mount_statement (struct ubasic_ctx *ctx)
void | rmdir_statement (struct ubasic_ctx *ctx)
void | write_statement (struct ubasic_ctx *ctx)
void | chdir_statement (struct ubasic_ctx *ctx)
char * | ubasic_filetype (struct ubasic_ctx *ctx)
void | ubasic_sin (struct ubasic_ctx *ctx, double *res)
void | ubasic_cos (struct ubasic_ctx *ctx, double *res)
void | ubasic_tan (struct ubasic_ctx *ctx, double *res)
void | ubasic_pow (struct ubasic_ctx *ctx, double *res)
struct ubasic_ctx * | ubasic_init (const char *program, console *cons, uint32_t pid, const char *file, char **error)
void | ubasic_destroy (struct ubasic_ctx *ctx)
void | ubasic_run (struct ubasic_ctx *ctx)
bool | ubasic_finished (struct ubasic_ctx *ctx)
bool | jump_linenum (int64_t linenum, struct ubasic_ctx *ctx)
void | line_statement (struct ubasic_ctx *ctx)
void | statement (struct ubasic_ctx *ctx)
void | accept (int token, struct ubasic_ctx *ctx)
void | ubasic_parse_fn (struct ubasic_ctx *ctx)
int64_t | ubasic_get_int_variable (const char *varname, struct ubasic_ctx *ctx)
bool | ubasic_get_double_variable (const char *var, struct ubasic_ctx *ctx, double *res)
const char * | ubasic_get_string_variable (const char *var, struct ubasic_ctx *ctx)
void | ubasic_set_string_variable (const char *var, const char *value, struct ubasic_ctx *ctx, bool local, bool global)
void | ubasic_set_double_variable (const char *var, const double value, struct ubasic_ctx *ctx, bool local, bool global)
void | ubasic_set_int_variable (const char *var, int64_t value, struct ubasic_ctx *ctx, bool local, bool global)
ub_return_type | ubasic_get_numeric_variable (const char *var, struct ubasic_ctx *ctx, double *res)
int64_t | ubasic_get_numeric_int_variable (const char *var, struct ubasic_ctx *ctx)
void | ubasic_set_int_array_variable (const char *var, int64_t index, int64_t value, struct ubasic_ctx *ctx)
void | ubasic_set_string_array_variable (const char *var, int64_t index, const char *value, struct ubasic_ctx *ctx)
void | ubasic_set_double_array_variable (const char *var, int64_t index, double value, struct ubasic_ctx *ctx)
bool | ubasic_get_double_array_variable (const char *var, int64_t index, struct ubasic_ctx *ctx, double *ret)
int64_t | ubasic_get_int_array_variable (const char *var, int64_t index, struct ubasic_ctx *ctx)
const char * | ubasic_get_string_array_variable (const char *var, int64_t index, struct ubasic_ctx *ctx)
bool | ubasic_dim_string_array (const char *var, int64_t size, struct ubasic_ctx *ctx)
bool | ubasic_dim_int_array (const char *var, int64_t size, struct ubasic_ctx *ctx)
bool | ubasic_dim_double_array (const char *var, int64_t size, struct ubasic_ctx *ctx)
bool | ubasic_redim_string_array (const char *var, int64_t size, struct ubasic_ctx *ctx)
bool | ubasic_redim_int_array (const char *var, int64_t size, struct ubasic_ctx *ctx)
bool | ubasic_redim_double_array (const char *var, int64_t size, struct ubasic_ctx *ctx)
bool | varname_is_int_array_access (struct ubasic_ctx *ctx, const char *varname)
bool | varname_is_string_array_access (struct ubasic_ctx *ctx, const char *varname)
bool | varname_is_double_array_access (struct ubasic_ctx *ctx, const char *varname)
int64_t | arr_variable_index (struct ubasic_ctx *ctx)
void | ubasic_set_int_array (const char *var, int64_t value, struct ubasic_ctx *ctx)
void | ubasic_set_string_array (const char *var, const char *value, struct ubasic_ctx *ctx)
void | ubasic_set_double_array (const char *var, double value, struct ubasic_ctx *ctx)
void | dim_statement (struct ubasic_ctx *ctx)
void | redim_statement (struct ubasic_ctx *ctx)
void | pop_statement (struct ubasic_ctx *ctx)
void | push_statement (struct ubasic_ctx *ctx)
int64_t | arr_expr_set_index (struct ubasic_ctx *ctx, const char *varname)
bool | ubasic_pop_string_array (const char *var, int64_t pop_pos, struct ubasic_ctx *ctx)
bool | ubasic_pop_int_array (const char *var, int64_t pop_pos, struct ubasic_ctx *ctx)
bool | ubasic_pop_double_array (const char *var, int64_t pop_pos, struct ubasic_ctx *ctx)
bool | ubasic_push_string_array (const char *var, int64_t push_pos, struct ubasic_ctx *ctx)
bool | ubasic_push_int_array (const char *var, int64_t push_pos, struct ubasic_ctx *ctx)
bool | ubasic_push_double_array (const char *var, int64_t push_pos, struct ubasic_ctx *ctx)
int64_t | expr (struct ubasic_ctx *ctx)
int64_t | relation (struct ubasic_ctx *ctx)
void | double_expr (struct ubasic_ctx *ctx, double *res)
void | double_relation (struct ubasic_ctx *ctx, double *res)
const char * | str_expr (struct ubasic_ctx *ctx)
int64_t | str_relation (struct ubasic_ctx *ctx)
char * | printable_syntax (struct ubasic_ctx *ctx)

## Detailed Description

Retro Rocket BASIC interpreter.

Retro Rocket OS Project (C) Craig Edwards 2012.

Note
  loosely based on uBASIC (Copyright (c) 2006, Adam Dunkels, All rights reserved).

uBASIC is far more limited than the dialect implemented here. It only allowed variables of one letter in length, and only integer variables, no PROC, FN, or additional functions, no floating point or string ops, no INPUT, just plain mathematical expressions, no ability to isolate execution into a context, and was (and in parts still is) quite badly optimised. It was what it was, a good starting off point.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS `‘AS IS’' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

## Macro Definition Documentation

## ◆ AUX

#define AUX | ( |  | x | ) | #x

## ◆ EVAL_END_LINE

#define EVAL_END_LINE 999999999

RETURN statement after EVAL code.

## ◆ EVAL_LINE

#define EVAL_LINE 999999998

Specil line number where EVAL code is inserted dynamically.

## ◆ MAX_CALL_STACK_DEPTH

#define MAX_CALL_STACK_DEPTH 255

Maximum stack depth of GOSUB, PROC, FN.

## ◆ MAX_LOOP_STACK_DEPTH

#define MAX_LOOP_STACK_DEPTH 255

Maximum stack depth of FOR...NEXT.

## ◆ MAX_STRINGLEN

#define MAX_STRINGLEN 1024

Maximum length of a string variable.

## ◆ PARAMS_END

#define PARAMS_END | ( |  | NAME | ) |

Value:
{ \
if (*(ctx->ptr - 1) != ')') { \
tokenizer_error_print(ctx, "Invalid number of parameters for " NAME); \
} \
}

Ends fetching of function parameters, throwing an error if parameters still remain.

## ◆ PARAMS_GET_ITEM

#define PARAMS_GET_ITEM | ( |  | type | ) |

Get a function parameter of type.

Parameters

  type | Type of function parameter to get, fills one of the variables strval, doubleval or intval.

## ◆ PARAMS_START

#define PARAMS_START

Value:
[[maybe_unused]] int itemtype = BIP_INT; \
[[maybe_unused]] int64_t intval = 0; \
[[maybe_unused]] double doubleval = 0; \
[[maybe_unused]] char* strval = NULL; \
[[maybe_unused]] char oldval = 0; \
[[maybe_unused]] char oldct = 0; \
[[maybe_unused]] char* oldptr = 0; \
[[maybe_unused]] char const* oldnextptr = NULL; \
[[maybe_unused]] int gotone = 0; \
[[maybe_unused]] int bracket_depth = 0; \
[[maybe_unused]] char const* item_begin = ctx->ptr;
BIP_INT
@ BIP_INT
Definition: ubasic.h:413

Begin parsing function parameters.

## ◆ STRINGIFY

#define STRINGIFY | ( |  | x | ) | AUX(x)

## Typedef Documentation

## ◆ builtin_double_fn

typedef void(* builtin_double_fn) (struct ubasic_ctx *ctx, double *res)

Real (double) function signature.

## ◆ builtin_int_fn

typedef int64_t(* builtin_int_fn) (struct ubasic_ctx *ctx)

Integer function signature.

## ◆ builtin_str_fn

typedef char*(* builtin_str_fn) (struct ubasic_ctx *ctx)

String function signature.

## Enumeration Type Documentation

## ◆ parameter_type_t

enum parameter_type_t

Enumerator
BIP_STRING |
BIP_INT |
BIP_DOUBLE |
BIP_VARIABLE |

## ◆ ub_fn_type

enum ub_fn_type

Function or procedure.

Enumerator
FT_FN |
FT_PROC |

## ◆ ub_return_type

enum ub_return_type

Return type of FN, PROC.

Enumerator
RT_MAIN |
RT_NONE |
RT_STRING |
RT_INT |
RT_FLOAT |

## Function Documentation

## ◆ accept()

void accept | ( | int | token,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ arr_expr_set_index()

int64_t arr_expr_set_index | ( | struct ubasic_ctx * | ctx,
|  | const char * | varname
| ) |  |

## ◆ arr_variable_index()

int64_t arr_variable_index | ( | struct ubasic_ctx * | ctx | ) |

## ◆ chdir_statement()

void chdir_statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ close_statement()

void close_statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ delete_statement()

void delete_statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ dim_statement()

void dim_statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ double_expr()

void double_expr | ( | struct ubasic_ctx * | ctx,
|  | double * | res
| ) |  |

## ◆ double_relation()

void double_relation | ( | struct ubasic_ctx * | ctx,
|  | double * | res
| ) |  |

## ◆ eof_statement()

void eof_statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ expr()

int64_t expr | ( | struct ubasic_ctx * | ctx | ) |

## ◆ jump_linenum()

bool jump_linenum | ( | int64_t | linenum,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ line_statement()

void line_statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ mkdir_statement()

void mkdir_statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ mount_statement()

void mount_statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ openin_statement()

void openin_statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ openout_statement()

void openout_statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ openup_statement()

void openup_statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ pop_statement()

void pop_statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ printable_syntax()

char* printable_syntax | ( | struct ubasic_ctx * | ctx | ) |

## ◆ push_statement()

void push_statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ read_statement()

void read_statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ redim_statement()

void redim_statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ relation()

int64_t relation | ( | struct ubasic_ctx * | ctx | ) |

## ◆ rmdir_statement()

void rmdir_statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ statement()

void statement | ( | struct ubasic_ctx * | ctx | ) |

## ◆ str_expr()

const char* str_expr | ( | struct ubasic_ctx * | ctx | ) |

## ◆ str_relation()

int64_t str_relation | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_abs()

int64_t ubasic_abs | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_altkey()

int64_t ubasic_altkey | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_asc()

int64_t ubasic_asc | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_capslock()

int64_t ubasic_capslock | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_chr()

char* ubasic_chr | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_cos()

void ubasic_cos | ( | struct ubasic_ctx * | ctx,
|  | double * | res
| ) |  |

## ◆ ubasic_csd()

char* ubasic_csd | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_ctrlkey()

int64_t ubasic_ctrlkey | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_destroy()

void ubasic_destroy | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_dim_double_array()

bool ubasic_dim_double_array | ( | const char * | var,
|  | int64_t | size,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_dim_int_array()

bool ubasic_dim_int_array | ( | const char * | var,
|  | int64_t | size,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_dim_string_array()

bool ubasic_dim_string_array | ( | const char * | var,
|  | int64_t | size,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_dns()

char* ubasic_dns | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_eof()

int64_t ubasic_eof | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_filetype()

char* ubasic_filetype | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_finished()

bool ubasic_finished | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_get_double_array_variable()

bool ubasic_get_double_array_variable | ( | const char * | var,
|  | int64_t | index,
|  | struct ubasic_ctx * | ctx,
|  | double * | ret
| ) |  |

## ◆ ubasic_get_double_variable()

bool ubasic_get_double_variable | ( | const char * | var,
|  | struct ubasic_ctx * | ctx,
|  | double * | res
| ) |  |

## ◆ ubasic_get_free_mem()

int64_t ubasic_get_free_mem | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_get_int_array_variable()

int64_t ubasic_get_int_array_variable | ( | const char * | var,
|  | int64_t | index,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_get_int_variable()

int64_t ubasic_get_int_variable | ( | const char * | varname,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_get_numeric_int_variable()

int64_t ubasic_get_numeric_int_variable | ( | const char * | var,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_get_numeric_variable()

ub_return_type ubasic_get_numeric_variable | ( | const char * | var,
|  | struct ubasic_ctx * | ctx,
|  | double * | res
| ) |  |

## ◆ ubasic_get_string_array_variable()

const char* ubasic_get_string_array_variable | ( | const char * | var,
|  | int64_t | index,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_get_string_variable()

const char* ubasic_get_string_variable | ( | const char * | var,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_get_text_cur_x()

int64_t ubasic_get_text_cur_x | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_get_text_cur_y()

int64_t ubasic_get_text_cur_y | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_get_text_max_x()

int64_t ubasic_get_text_max_x | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_get_text_max_y()

int64_t ubasic_get_text_max_y | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_get_total_mem()

int64_t ubasic_get_total_mem | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_get_used_mem()

int64_t ubasic_get_used_mem | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_getname()

char* ubasic_getname | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_getnamecount()

int64_t ubasic_getnamecount | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_getproccount()

int64_t ubasic_getproccount | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_getproccpuid()

int64_t ubasic_getproccpuid | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_getprocid()

int64_t ubasic_getprocid | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_getprocname()

char* ubasic_getprocname | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_getprocparent()

int64_t ubasic_getprocparent | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_getsize()

int64_t ubasic_getsize | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_init()

struct ubasic_ctx* ubasic_init | ( | const char * | program,
|  | console * | cons,
|  | uint32_t | pid,
|  | const char * | file,
|  | char ** | error
| ) |  |

## ◆ ubasic_inkey()

char* ubasic_inkey | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_insocket()

char* ubasic_insocket | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_instr()

int64_t ubasic_instr | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_left()

char* ubasic_left | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_len()

int64_t ubasic_len | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_lower()

char* ubasic_lower | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_mid()

char* ubasic_mid | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_netinfo()

char* ubasic_netinfo | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_openin()

int64_t ubasic_openin | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_openout()

int64_t ubasic_openout | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_openup()

int64_t ubasic_openup | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_parse_fn()

void ubasic_parse_fn | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_pop_double_array()

bool ubasic_pop_double_array | ( | const char * | var,
|  | int64_t | pop_pos,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_pop_int_array()

bool ubasic_pop_int_array | ( | const char * | var,
|  | int64_t | pop_pos,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_pop_string_array()

bool ubasic_pop_string_array | ( | const char * | var,
|  | int64_t | pop_pos,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_pow()

void ubasic_pow | ( | struct ubasic_ctx * | ctx,
|  | double * | res
| ) |  |

## ◆ ubasic_push_double_array()

bool ubasic_push_double_array | ( | const char * | var,
|  | int64_t | push_pos,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_push_int_array()

bool ubasic_push_int_array | ( | const char * | var,
|  | int64_t | push_pos,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_push_string_array()

bool ubasic_push_string_array | ( | const char * | var,
|  | int64_t | push_pos,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_ramdisk_from_device()

char* ubasic_ramdisk_from_device | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_ramdisk_from_size()

char* ubasic_ramdisk_from_size | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_random()

int64_t ubasic_random | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_read()

int64_t ubasic_read | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_readstring()

char* ubasic_readstring | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_redim_double_array()

bool ubasic_redim_double_array | ( | const char * | var,
|  | int64_t | size,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_redim_int_array()

bool ubasic_redim_int_array | ( | const char * | var,
|  | int64_t | size,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_redim_string_array()

bool ubasic_redim_string_array | ( | const char * | var,
|  | int64_t | size,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_rgb()

int64_t ubasic_rgb | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_right()

char* ubasic_right | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_run()

void ubasic_run | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_set_double_array()

void ubasic_set_double_array | ( | const char * | var,
|  | double | value,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_set_double_array_variable()

void ubasic_set_double_array_variable | ( | const char * | var,
|  | int64_t | index,
|  | double | value,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_set_double_variable()

void ubasic_set_double_variable | ( | const char * | var,
|  | const double | value,
|  | struct ubasic_ctx * | ctx,
|  | bool | local,
|  | bool | global
| ) |  |

## ◆ ubasic_set_int_array()

void ubasic_set_int_array | ( | const char * | var,
|  | int64_t | value,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_set_int_array_variable()

void ubasic_set_int_array_variable | ( | const char * | var,
|  | int64_t | index,
|  | int64_t | value,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_set_int_variable()

void ubasic_set_int_variable | ( | const char * | var,
|  | int64_t | value,
|  | struct ubasic_ctx * | ctx,
|  | bool | local,
|  | bool | global
| ) |  |

## ◆ ubasic_set_string_array()

void ubasic_set_string_array | ( | const char * | var,
|  | const char * | value,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_set_string_array_variable()

void ubasic_set_string_array_variable | ( | const char * | var,
|  | int64_t | index,
|  | const char * | value,
|  | struct ubasic_ctx * | ctx
| ) |  |

## ◆ ubasic_set_string_variable()

void ubasic_set_string_variable | ( | const char * | var,
|  | const char * | value,
|  | struct ubasic_ctx * | ctx,
|  | bool | local,
|  | bool | global
| ) |  |

## ◆ ubasic_shiftkey()

int64_t ubasic_shiftkey | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_sin()

void ubasic_sin | ( | struct ubasic_ctx * | ctx,
|  | double * | res
| ) |  |

## ◆ ubasic_sockstatus()

int64_t ubasic_sockstatus | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_tan()

void ubasic_tan | ( | struct ubasic_ctx * | ctx,
|  | double * | res
| ) |  |

## ◆ ubasic_tokenize()

char* ubasic_tokenize | ( | struct ubasic_ctx * | ctx | ) |

## ◆ ubasic_upper()

char* ubasic_upper | ( | struct ubasic_ctx * | ctx | ) |

## ◆ valid_double_var()

bool valid_double_var | ( | const char * | name | ) |

## ◆ valid_int_var()

bool valid_int_var | ( | const char * | name | ) |

## ◆ valid_string_var()

bool valid_string_var | ( | const char * | name | ) |

## ◆ varname_is_double_array_access()

bool varname_is_double_array_access | ( | struct ubasic_ctx * | ctx,
|  | const char * | varname
| ) |  |

## ◆ varname_is_int_array_access()

bool varname_is_int_array_access | ( | struct ubasic_ctx * | ctx,
|  | const char * | varname
| ) |  |

## ◆ varname_is_string_array_access()

bool varname_is_string_array_access | ( | struct ubasic_ctx * | ctx,
|  | const char * | varname
| ) |  |

## ◆ write_statement()

void write_statement | ( | struct ubasic_ctx * | ctx | ) |