Retro Rocket Kernel
BASIC-Powered Operating System
basic.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  cpuid_result_t
 CPUID instruction result. More...
 
struct  g_cpuid_vendor_t
 
struct  basic_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 basic_destroy() on them! More...
 
struct  basic_int_fn
 Builtin integer function. More...
 
struct  basic_double_fn
 Builtin real (double) function. More...
 
struct  basic_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
 Special 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, returnval)
 Ends fetching of function parameters, throwing an error if parameters still remain. More...
 
#define PARAMS_END_VOID(NAME)
 
#define accept_or_return(token, ctx)
 

Typedefs

typedef int64_t(* builtin_int_fn) (struct basic_ctx *ctx)
 Integer function signature. More...
 
typedef char *(* builtin_str_fn) (struct basic_ctx *ctx)
 String function signature. More...
 
typedef void(* builtin_double_fn) (struct basic_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 basic_abs (struct basic_ctx *ctx)
 
int64_t basic_len (struct basic_ctx *ctx)
 
int64_t basic_openin (struct basic_ctx *ctx)
 
int64_t basic_openout (struct basic_ctx *ctx)
 
int64_t basic_openup (struct basic_ctx *ctx)
 
int64_t basic_eof (struct basic_ctx *ctx)
 
int64_t basic_read (struct basic_ctx *ctx)
 
int64_t basic_instr (struct basic_ctx *ctx)
 
int64_t basic_asc (struct basic_ctx *ctx)
 
int64_t basic_getnamecount (struct basic_ctx *ctx)
 
int64_t basic_getsize (struct basic_ctx *ctx)
 
int64_t basic_get_text_max_x (struct basic_ctx *ctx)
 
int64_t basic_get_text_max_y (struct basic_ctx *ctx)
 
int64_t basic_get_text_cur_x (struct basic_ctx *ctx)
 
int64_t basic_get_text_cur_y (struct basic_ctx *ctx)
 
int64_t basic_getproccount (struct basic_ctx *ctx)
 
int64_t basic_getprocid (struct basic_ctx *ctx)
 
int64_t basic_getprocparent (struct basic_ctx *ctx)
 
int64_t basic_getproccpuid (struct basic_ctx *ctx)
 
int64_t basic_rgb (struct basic_ctx *ctx)
 
int64_t basic_get_free_mem (struct basic_ctx *ctx)
 
int64_t basic_get_used_mem (struct basic_ctx *ctx)
 
int64_t basic_get_total_mem (struct basic_ctx *ctx)
 
int64_t basic_sockstatus (struct basic_ctx *ctx)
 
int64_t basic_ctrlkey (struct basic_ctx *ctx)
 
int64_t basic_shiftkey (struct basic_ctx *ctx)
 
int64_t basic_altkey (struct basic_ctx *ctx)
 
int64_t basic_capslock (struct basic_ctx *ctx)
 
int64_t basic_random (struct basic_ctx *ctx)
 
int64_t basic_legacy_getlastcpuid (struct basic_ctx *ctx)
 
int64_t basic_legacy_cpuid (struct basic_ctx *ctx)
 
int64_t basic_cpuid (struct basic_ctx *ctx)
 
char * basic_netinfo (struct basic_ctx *ctx)
 
char * basic_left (struct basic_ctx *ctx)
 
char * basic_right (struct basic_ctx *ctx)
 
char * basic_mid (struct basic_ctx *ctx)
 
char * basic_chr (struct basic_ctx *ctx)
 
char * basic_readstring (struct basic_ctx *ctx)
 
char * basic_getname (struct basic_ctx *ctx)
 
char * basic_getprocname (struct basic_ctx *ctx)
 
char * basic_dns (struct basic_ctx *ctx)
 
char * basic_ramdisk_from_device (struct basic_ctx *ctx)
 
char * basic_ramdisk_from_size (struct basic_ctx *ctx)
 
char * basic_inkey (struct basic_ctx *ctx)
 
char * basic_insocket (struct basic_ctx *ctx)
 
char * basic_upper (struct basic_ctx *ctx)
 
char * basic_lower (struct basic_ctx *ctx)
 
char * basic_tokenize (struct basic_ctx *ctx)
 
char * basic_csd (struct basic_ctx *ctx)
 
char * basic_cpugetbrand (struct basic_ctx *ctx)
 
char * basic_cpugetvendor (struct basic_ctx *ctx)
 
char * basic_intoasc (struct basic_ctx *ctx)
 
void openin_statement (struct basic_ctx *ctx)
 
void openup_statement (struct basic_ctx *ctx)
 
void openout_statement (struct basic_ctx *ctx)
 
void read_statement (struct basic_ctx *ctx)
 
void close_statement (struct basic_ctx *ctx)
 
void eof_statement (struct basic_ctx *ctx)
 
void delete_statement (struct basic_ctx *ctx)
 
void mkdir_statement (struct basic_ctx *ctx)
 
void mount_statement (struct basic_ctx *ctx)
 
void rmdir_statement (struct basic_ctx *ctx)
 
void write_statement (struct basic_ctx *ctx)
 
void chdir_statement (struct basic_ctx *ctx)
 
char * basic_filetype (struct basic_ctx *ctx)
 
void basic_sin (struct basic_ctx *ctx, double *res)
 
void basic_cos (struct basic_ctx *ctx, double *res)
 
void basic_tan (struct basic_ctx *ctx, double *res)
 
void basic_pow (struct basic_ctx *ctx, double *res)
 
void basic_sqrt (struct basic_ctx *ctx, double *res)
 
struct basic_ctxbasic_init (const char *program, console *cons, uint32_t pid, const char *file, char **error)
 
void basic_destroy (struct basic_ctx *ctx)
 
void basic_run (struct basic_ctx *ctx)
 
bool basic_finished (struct basic_ctx *ctx)
 
bool jump_linenum (int64_t linenum, struct basic_ctx *ctx)
 
void line_statement (struct basic_ctx *ctx)
 
void statement (struct basic_ctx *ctx)
 
bool accept (int token, struct basic_ctx *ctx)
 
void basic_parse_fn (struct basic_ctx *ctx)
 
struct basic_ctxbasic_clone (struct basic_ctx *old)
 
int64_t basic_get_int_variable (const char *varname, struct basic_ctx *ctx)
 
bool basic_get_double_variable (const char *var, struct basic_ctx *ctx, double *res)
 
const char * basic_get_string_variable (const char *var, struct basic_ctx *ctx)
 
void basic_set_string_variable (const char *var, const char *value, struct basic_ctx *ctx, bool local, bool global)
 
void basic_set_double_variable (const char *var, const double value, struct basic_ctx *ctx, bool local, bool global)
 
void basic_set_int_variable (const char *var, int64_t value, struct basic_ctx *ctx, bool local, bool global)
 
ub_return_type basic_get_numeric_variable (const char *var, struct basic_ctx *ctx, double *res)
 
int64_t basic_get_numeric_int_variable (const char *var, struct basic_ctx *ctx)
 
void basic_set_int_array_variable (const char *var, int64_t index, int64_t value, struct basic_ctx *ctx)
 
void basic_set_string_array_variable (const char *var, int64_t index, const char *value, struct basic_ctx *ctx)
 
void basic_set_double_array_variable (const char *var, int64_t index, double value, struct basic_ctx *ctx)
 
bool basic_get_double_array_variable (const char *var, int64_t index, struct basic_ctx *ctx, double *ret)
 
int64_t basic_get_int_array_variable (const char *var, int64_t index, struct basic_ctx *ctx)
 
const char * basic_get_string_array_variable (const char *var, int64_t index, struct basic_ctx *ctx)
 
bool basic_dim_string_array (const char *var, int64_t size, struct basic_ctx *ctx)
 
bool basic_dim_int_array (const char *var, int64_t size, struct basic_ctx *ctx)
 
bool basic_dim_double_array (const char *var, int64_t size, struct basic_ctx *ctx)
 
bool basic_redim_string_array (const char *var, int64_t size, struct basic_ctx *ctx)
 
bool basic_redim_int_array (const char *var, int64_t size, struct basic_ctx *ctx)
 
bool basic_redim_double_array (const char *var, int64_t size, struct basic_ctx *ctx)
 
bool varname_is_int_array_access (struct basic_ctx *ctx, const char *varname)
 
bool varname_is_string_array_access (struct basic_ctx *ctx, const char *varname)
 
bool varname_is_double_array_access (struct basic_ctx *ctx, const char *varname)
 
int64_t arr_variable_index (struct basic_ctx *ctx)
 
void basic_set_int_array (const char *var, int64_t value, struct basic_ctx *ctx)
 
void basic_set_string_array (const char *var, const char *value, struct basic_ctx *ctx)
 
void basic_set_double_array (const char *var, double value, struct basic_ctx *ctx)
 
void dim_statement (struct basic_ctx *ctx)
 
void redim_statement (struct basic_ctx *ctx)
 
void pop_statement (struct basic_ctx *ctx)
 
void push_statement (struct basic_ctx *ctx)
 
int64_t arr_expr_set_index (struct basic_ctx *ctx, const char *varname)
 
bool basic_pop_string_array (const char *var, int64_t pop_pos, struct basic_ctx *ctx)
 
bool basic_pop_int_array (const char *var, int64_t pop_pos, struct basic_ctx *ctx)
 
bool basic_pop_double_array (const char *var, int64_t pop_pos, struct basic_ctx *ctx)
 
bool basic_push_string_array (const char *var, int64_t push_pos, struct basic_ctx *ctx)
 
bool basic_push_int_array (const char *var, int64_t push_pos, struct basic_ctx *ctx)
 
bool basic_push_double_array (const char *var, int64_t push_pos, struct basic_ctx *ctx)
 
int64_t expr (struct basic_ctx *ctx)
 
int64_t relation (struct basic_ctx *ctx)
 
void double_expr (struct basic_ctx *ctx, double *res)
 
void double_relation (struct basic_ctx *ctx, double *res)
 
const char * str_expr (struct basic_ctx *ctx)
 
int64_t str_relation (struct basic_ctx *ctx)
 
char * printable_syntax (struct basic_ctx *ctx)
 
void library_statement (struct basic_ctx *ctx)
 
void basic_free_defs (struct basic_ctx *ctx)
 
void begin_comma_list (struct ub_proc_fn_def *def, struct basic_ctx *ctx)
 
uint8_t extract_comma_list (struct ub_proc_fn_def *def, struct basic_ctx *ctx)
 
bool basic_int_variable_exists (const char *var, struct basic_ctx *ctx)
 
bool basic_string_variable_exists (const char *var, struct basic_ctx *ctx)
 
bool basic_double_variable_exists (const char *var, struct basic_ctx *ctx)
 
int64_t basic_val (struct basic_ctx *ctx)
 
int64_t basic_hexval (struct basic_ctx *ctx)
 
int64_t basic_octval (struct basic_ctx *ctx)
 
void basic_realval (struct basic_ctx *ctx, double *res)
 
char * basic_str (struct basic_ctx *ctx)
 
char * basic_bool (struct basic_ctx *ctx)
 
void set_system_variables (struct basic_ctx *ctx, uint32_t pid)
 
void let_statement (struct basic_ctx *ctx, bool global, bool local)
 
char basic_builtin_str_fn (const char *fn_name, struct basic_ctx *ctx, char **res)
 
int64_t basic_eval_int_fn (const char *fn_name, struct basic_ctx *ctx)
 
void basic_eval_double_fn (const char *fn_name, struct basic_ctx *ctx, double *res)
 
const char * basic_eval_str_fn (const char *fn_name, struct basic_ctx *ctx)
 
char basic_builtin_double_fn (const char *fn_name, struct basic_ctx *ctx, double *res)
 
char basic_builtin_int_fn (const char *fn_name, struct basic_ctx *ctx, int64_t *res)
 
struct ub_proc_fn_defbasic_find_fn (const char *name, struct basic_ctx *ctx)
 
void init_local_heap (struct basic_ctx *ctx)
 
void free_local_heap (struct basic_ctx *ctx)
 
bool is_builtin_double_fn (const char *fn_name)
 
void def_statement (struct basic_ctx *ctx)
 
void proc_statement (struct basic_ctx *ctx)
 
void eq_statement (struct basic_ctx *ctx)
 
void retproc_statement (struct basic_ctx *ctx)
 
void sockwrite_statement (struct basic_ctx *ctx)
 
void sockclose_statement (struct basic_ctx *ctx)
 
void connect_statement (struct basic_ctx *ctx)
 
void sockread_statement (struct basic_ctx *ctx)
 
void write_cpuid (struct basic_ctx *ctx, int leaf)
 
void write_cpuidex (struct basic_ctx *ctx, int leaf, int subleaf)
 
int64_t get_cpuid_reg (struct basic_ctx *ctx, int64_t reg)
 
void circle_statement (struct basic_ctx *ctx)
 
void triangle_statement (struct basic_ctx *ctx)
 
void point_statement (struct basic_ctx *ctx)
 
void draw_line_statement (struct basic_ctx *ctx)
 
void gcol_statement (struct basic_ctx *ctx)
 
void rectangle_statement (struct basic_ctx *ctx)
 
void input_statement (struct basic_ctx *ctx)
 
void cls_statement (struct basic_ctx *ctx)
 
void gotoxy_statement (struct basic_ctx *ctx)
 
void print_statement (struct basic_ctx *ctx)
 
void colour_statement (struct basic_ctx *ctx, int tok)
 
void background_statement (struct basic_ctx *ctx)
 
bool conditional (struct basic_ctx *ctx)
 
void else_statement (struct basic_ctx *ctx)
 
void if_statement (struct basic_ctx *ctx)
 
void gosub_statement (struct basic_ctx *ctx)
 
void return_statement (struct basic_ctx *ctx)
 
void next_statement (struct basic_ctx *ctx)
 
void for_statement (struct basic_ctx *ctx)
 
void repeat_statement (struct basic_ctx *ctx)
 
void until_statement (struct basic_ctx *ctx)
 
void endif_statement (struct basic_ctx *ctx)
 
void end_statement (struct basic_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

◆ accept_or_return

#define accept_or_return (   token,
  ctx 
)
Value:
if (!accept(token, ctx)) { \
return; \
}
bool accept(int token, struct basic_ctx *ctx)

◆ AUX

#define AUX (   x)    #x

◆ EVAL_END_LINE

#define EVAL_END_LINE   999999999

RETURN statement after EVAL code.

◆ EVAL_LINE

#define EVAL_LINE   999999998

Special 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,
  returnval 
)
Value:
{ \
if (*(ctx->ptr - 1) != ')') { \
tokenizer_error_print(ctx, "Invalid number of parameters for " NAME); \
return returnval; \
} \
}

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

◆ PARAMS_END_VOID

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

◆ PARAMS_GET_ITEM

#define PARAMS_GET_ITEM (   type)

Get a function parameter of type.

Parameters
typeType 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
Definition: basic.h:436

Begin parsing function parameters.

◆ STRINGIFY

#define STRINGIFY (   x)    AUX(x)

Typedef Documentation

◆ builtin_double_fn

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

Real (double) function signature.

◆ builtin_int_fn

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

Integer function signature.

◆ builtin_str_fn

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

String function signature.

Enumeration Type Documentation

◆ 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

Return type of FN, PROC.

Enumerator
RT_MAIN 
RT_NONE 
RT_STRING 
RT_INT 
RT_FLOAT 

Function Documentation

◆ accept()

bool accept ( int  token,
struct basic_ctx ctx 
)

◆ arr_expr_set_index()

int64_t arr_expr_set_index ( struct basic_ctx ctx,
const char *  varname 
)

◆ arr_variable_index()

int64_t arr_variable_index ( struct basic_ctx ctx)

◆ background_statement()

void background_statement ( struct basic_ctx ctx)

◆ basic_abs()

int64_t basic_abs ( struct basic_ctx ctx)

◆ basic_altkey()

int64_t basic_altkey ( struct basic_ctx ctx)

◆ basic_asc()

int64_t basic_asc ( struct basic_ctx ctx)

◆ basic_bool()

char* basic_bool ( struct basic_ctx ctx)

◆ basic_builtin_double_fn()

char basic_builtin_double_fn ( const char *  fn_name,
struct basic_ctx ctx,
double *  res 
)

◆ basic_builtin_int_fn()

char basic_builtin_int_fn ( const char *  fn_name,
struct basic_ctx ctx,
int64_t *  res 
)

◆ basic_builtin_str_fn()

char basic_builtin_str_fn ( const char *  fn_name,
struct basic_ctx ctx,
char **  res 
)

◆ basic_capslock()

int64_t basic_capslock ( struct basic_ctx ctx)

◆ basic_chr()

char* basic_chr ( struct basic_ctx ctx)

◆ basic_clone()

struct basic_ctx* basic_clone ( struct basic_ctx old)

◆ basic_cos()

void basic_cos ( struct basic_ctx ctx,
double *  res 
)

◆ basic_cpugetbrand()

char * basic_cpugetbrand ( struct basic_ctx ctx)

◆ basic_cpugetvendor()

char * basic_cpugetvendor ( struct basic_ctx ctx)

◆ basic_cpuid()

int64_t basic_cpuid ( struct basic_ctx ctx)

◆ basic_csd()

char* basic_csd ( struct basic_ctx ctx)

◆ basic_ctrlkey()

int64_t basic_ctrlkey ( struct basic_ctx ctx)

◆ basic_destroy()

void basic_destroy ( struct basic_ctx ctx)

◆ basic_dim_double_array()

bool basic_dim_double_array ( const char *  var,
int64_t  size,
struct basic_ctx ctx 
)

◆ basic_dim_int_array()

bool basic_dim_int_array ( const char *  var,
int64_t  size,
struct basic_ctx ctx 
)

◆ basic_dim_string_array()

bool basic_dim_string_array ( const char *  var,
int64_t  size,
struct basic_ctx ctx 
)

◆ basic_dns()

char * basic_dns ( struct basic_ctx ctx)

◆ basic_double_variable_exists()

bool basic_double_variable_exists ( const char *  var,
struct basic_ctx ctx 
)

◆ basic_eof()

int64_t basic_eof ( struct basic_ctx ctx)

◆ basic_eval_double_fn()

void basic_eval_double_fn ( const char *  fn_name,
struct basic_ctx ctx,
double *  res 
)

◆ basic_eval_int_fn()

int64_t basic_eval_int_fn ( const char *  fn_name,
struct basic_ctx ctx 
)

◆ basic_eval_str_fn()

const char* basic_eval_str_fn ( const char *  fn_name,
struct basic_ctx ctx 
)

◆ basic_filetype()

char* basic_filetype ( struct basic_ctx ctx)

◆ basic_find_fn()

struct ub_proc_fn_def* basic_find_fn ( const char *  name,
struct basic_ctx ctx 
)

◆ basic_finished()

bool basic_finished ( struct basic_ctx ctx)

◆ basic_free_defs()

void basic_free_defs ( struct basic_ctx ctx)

◆ basic_get_double_array_variable()

bool basic_get_double_array_variable ( const char *  var,
int64_t  index,
struct basic_ctx ctx,
double *  ret 
)

◆ basic_get_double_variable()

bool basic_get_double_variable ( const char *  var,
struct basic_ctx ctx,
double *  res 
)

◆ basic_get_free_mem()

int64_t basic_get_free_mem ( struct basic_ctx ctx)

◆ basic_get_int_array_variable()

int64_t basic_get_int_array_variable ( const char *  var,
int64_t  index,
struct basic_ctx ctx 
)

◆ basic_get_int_variable()

int64_t basic_get_int_variable ( const char *  varname,
struct basic_ctx ctx 
)

◆ basic_get_numeric_int_variable()

int64_t basic_get_numeric_int_variable ( const char *  var,
struct basic_ctx ctx 
)

◆ basic_get_numeric_variable()

ub_return_type basic_get_numeric_variable ( const char *  var,
struct basic_ctx ctx,
double *  res 
)

◆ basic_get_string_array_variable()

const char* basic_get_string_array_variable ( const char *  var,
int64_t  index,
struct basic_ctx ctx 
)

◆ basic_get_string_variable()

const char* basic_get_string_variable ( const char *  var,
struct basic_ctx ctx 
)

◆ basic_get_text_cur_x()

int64_t basic_get_text_cur_x ( struct basic_ctx ctx)

◆ basic_get_text_cur_y()

int64_t basic_get_text_cur_y ( struct basic_ctx ctx)

◆ basic_get_text_max_x()

int64_t basic_get_text_max_x ( struct basic_ctx ctx)

◆ basic_get_text_max_y()

int64_t basic_get_text_max_y ( struct basic_ctx ctx)

◆ basic_get_total_mem()

int64_t basic_get_total_mem ( struct basic_ctx ctx)

◆ basic_get_used_mem()

int64_t basic_get_used_mem ( struct basic_ctx ctx)

◆ basic_getname()

char* basic_getname ( struct basic_ctx ctx)

◆ basic_getnamecount()

int64_t basic_getnamecount ( struct basic_ctx ctx)

◆ basic_getproccount()

int64_t basic_getproccount ( struct basic_ctx ctx)

◆ basic_getproccpuid()

int64_t basic_getproccpuid ( struct basic_ctx ctx)

◆ basic_getprocid()

int64_t basic_getprocid ( struct basic_ctx ctx)

◆ basic_getprocname()

char * basic_getprocname ( struct basic_ctx ctx)

◆ basic_getprocparent()

int64_t basic_getprocparent ( struct basic_ctx ctx)

◆ basic_getsize()

int64_t basic_getsize ( struct basic_ctx ctx)

◆ basic_hexval()

int64_t basic_hexval ( struct basic_ctx ctx)

◆ basic_init()

struct basic_ctx* basic_init ( const char *  program,
console cons,
uint32_t  pid,
const char *  file,
char **  error 
)

◆ basic_inkey()

char * basic_inkey ( struct basic_ctx ctx)

◆ basic_insocket()

char * basic_insocket ( struct basic_ctx ctx)

◆ basic_instr()

int64_t basic_instr ( struct basic_ctx ctx)

◆ basic_int_variable_exists()

bool basic_int_variable_exists ( const char *  var,
struct basic_ctx ctx 
)

◆ basic_intoasc()

char * basic_intoasc ( struct basic_ctx ctx)

◆ basic_left()

char* basic_left ( struct basic_ctx ctx)

◆ basic_legacy_cpuid()

int64_t basic_legacy_cpuid ( struct basic_ctx ctx)

◆ basic_legacy_getlastcpuid()

int64_t basic_legacy_getlastcpuid ( struct basic_ctx ctx)

◆ basic_len()

int64_t basic_len ( struct basic_ctx ctx)

◆ basic_lower()

char* basic_lower ( struct basic_ctx ctx)

◆ basic_mid()

char* basic_mid ( struct basic_ctx ctx)

◆ basic_netinfo()

char * basic_netinfo ( struct basic_ctx ctx)

◆ basic_octval()

int64_t basic_octval ( struct basic_ctx ctx)

◆ basic_openin()

int64_t basic_openin ( struct basic_ctx ctx)

◆ basic_openout()

int64_t basic_openout ( struct basic_ctx ctx)

◆ basic_openup()

int64_t basic_openup ( struct basic_ctx ctx)

◆ basic_parse_fn()

void basic_parse_fn ( struct basic_ctx ctx)

◆ basic_pop_double_array()

bool basic_pop_double_array ( const char *  var,
int64_t  pop_pos,
struct basic_ctx ctx 
)

◆ basic_pop_int_array()

bool basic_pop_int_array ( const char *  var,
int64_t  pop_pos,
struct basic_ctx ctx 
)

◆ basic_pop_string_array()

bool basic_pop_string_array ( const char *  var,
int64_t  pop_pos,
struct basic_ctx ctx 
)

◆ basic_pow()

void basic_pow ( struct basic_ctx ctx,
double *  res 
)

◆ basic_push_double_array()

bool basic_push_double_array ( const char *  var,
int64_t  push_pos,
struct basic_ctx ctx 
)

◆ basic_push_int_array()

bool basic_push_int_array ( const char *  var,
int64_t  push_pos,
struct basic_ctx ctx 
)

◆ basic_push_string_array()

bool basic_push_string_array ( const char *  var,
int64_t  push_pos,
struct basic_ctx ctx 
)

◆ basic_ramdisk_from_device()

char* basic_ramdisk_from_device ( struct basic_ctx ctx)

◆ basic_ramdisk_from_size()

char* basic_ramdisk_from_size ( struct basic_ctx ctx)

◆ basic_random()

int64_t basic_random ( struct basic_ctx ctx)

◆ basic_read()

int64_t basic_read ( struct basic_ctx ctx)

◆ basic_readstring()

char* basic_readstring ( struct basic_ctx ctx)

◆ basic_realval()

void basic_realval ( struct basic_ctx ctx,
double *  res 
)

◆ basic_redim_double_array()

bool basic_redim_double_array ( const char *  var,
int64_t  size,
struct basic_ctx ctx 
)

◆ basic_redim_int_array()

bool basic_redim_int_array ( const char *  var,
int64_t  size,
struct basic_ctx ctx 
)

◆ basic_redim_string_array()

bool basic_redim_string_array ( const char *  var,
int64_t  size,
struct basic_ctx ctx 
)

◆ basic_rgb()

int64_t basic_rgb ( struct basic_ctx ctx)

◆ basic_right()

char* basic_right ( struct basic_ctx ctx)

◆ basic_run()

void basic_run ( struct basic_ctx ctx)

◆ basic_set_double_array()

void basic_set_double_array ( const char *  var,
double  value,
struct basic_ctx ctx 
)

◆ basic_set_double_array_variable()

void basic_set_double_array_variable ( const char *  var,
int64_t  index,
double  value,
struct basic_ctx ctx 
)

◆ basic_set_double_variable()

void basic_set_double_variable ( const char *  var,
const double  value,
struct basic_ctx ctx,
bool  local,
bool  global 
)

◆ basic_set_int_array()

void basic_set_int_array ( const char *  var,
int64_t  value,
struct basic_ctx ctx 
)

◆ basic_set_int_array_variable()

void basic_set_int_array_variable ( const char *  var,
int64_t  index,
int64_t  value,
struct basic_ctx ctx 
)

◆ basic_set_int_variable()

void basic_set_int_variable ( const char *  var,
int64_t  value,
struct basic_ctx ctx,
bool  local,
bool  global 
)

◆ basic_set_string_array()

void basic_set_string_array ( const char *  var,
const char *  value,
struct basic_ctx ctx 
)

◆ basic_set_string_array_variable()

void basic_set_string_array_variable ( const char *  var,
int64_t  index,
const char *  value,
struct basic_ctx ctx 
)

◆ basic_set_string_variable()

void basic_set_string_variable ( const char *  var,
const char *  value,
struct basic_ctx ctx,
bool  local,
bool  global 
)

◆ basic_shiftkey()

int64_t basic_shiftkey ( struct basic_ctx ctx)

◆ basic_sin()

void basic_sin ( struct basic_ctx ctx,
double *  res 
)

◆ basic_sockstatus()

int64_t basic_sockstatus ( struct basic_ctx ctx)

◆ basic_sqrt()

void basic_sqrt ( struct basic_ctx ctx,
double *  res 
)

◆ basic_str()

char* basic_str ( struct basic_ctx ctx)

◆ basic_string_variable_exists()

bool basic_string_variable_exists ( const char *  var,
struct basic_ctx ctx 
)

◆ basic_tan()

void basic_tan ( struct basic_ctx ctx,
double *  res 
)

◆ basic_tokenize()

char* basic_tokenize ( struct basic_ctx ctx)

◆ basic_upper()

char* basic_upper ( struct basic_ctx ctx)

◆ basic_val()

int64_t basic_val ( struct basic_ctx ctx)

◆ begin_comma_list()

void begin_comma_list ( struct ub_proc_fn_def def,
struct basic_ctx ctx 
)

◆ chdir_statement()

void chdir_statement ( struct basic_ctx ctx)

◆ circle_statement()

void circle_statement ( struct basic_ctx ctx)

◆ close_statement()

void close_statement ( struct basic_ctx ctx)

◆ cls_statement()

void cls_statement ( struct basic_ctx ctx)

◆ colour_statement()

void colour_statement ( struct basic_ctx ctx,
int  tok 
)

◆ conditional()

bool conditional ( struct basic_ctx ctx)

◆ connect_statement()

void connect_statement ( struct basic_ctx ctx)

◆ def_statement()

void def_statement ( struct basic_ctx ctx)

◆ delete_statement()

void delete_statement ( struct basic_ctx ctx)

◆ dim_statement()

void dim_statement ( struct basic_ctx ctx)

◆ double_expr()

void double_expr ( struct basic_ctx ctx,
double *  res 
)

◆ double_relation()

void double_relation ( struct basic_ctx ctx,
double *  res 
)

◆ draw_line_statement()

void draw_line_statement ( struct basic_ctx ctx)

◆ else_statement()

void else_statement ( struct basic_ctx ctx)

◆ end_statement()

void end_statement ( struct basic_ctx ctx)

◆ endif_statement()

void endif_statement ( struct basic_ctx ctx)

◆ eof_statement()

void eof_statement ( struct basic_ctx ctx)

◆ eq_statement()

void eq_statement ( struct basic_ctx ctx)

◆ expr()

int64_t expr ( struct basic_ctx ctx)

◆ extract_comma_list()

uint8_t extract_comma_list ( struct ub_proc_fn_def def,
struct basic_ctx ctx 
)

◆ for_statement()

void for_statement ( struct basic_ctx ctx)

◆ free_local_heap()

void free_local_heap ( struct basic_ctx ctx)

◆ gcol_statement()

void gcol_statement ( struct basic_ctx ctx)

◆ get_cpuid_reg()

int64_t get_cpuid_reg ( struct basic_ctx ctx,
int64_t  reg 
)

◆ gosub_statement()

void gosub_statement ( struct basic_ctx ctx)

◆ gotoxy_statement()

void gotoxy_statement ( struct basic_ctx ctx)

◆ if_statement()

void if_statement ( struct basic_ctx ctx)

◆ init_local_heap()

void init_local_heap ( struct basic_ctx ctx)

◆ input_statement()

void input_statement ( struct basic_ctx ctx)

◆ is_builtin_double_fn()

bool is_builtin_double_fn ( const char *  fn_name)

◆ jump_linenum()

bool jump_linenum ( int64_t  linenum,
struct basic_ctx ctx 
)

◆ let_statement()

void let_statement ( struct basic_ctx ctx,
bool  global,
bool  local 
)

◆ library_statement()

void library_statement ( struct basic_ctx ctx)

◆ line_statement()

void line_statement ( struct basic_ctx ctx)

◆ mkdir_statement()

void mkdir_statement ( struct basic_ctx ctx)

◆ mount_statement()

void mount_statement ( struct basic_ctx ctx)

◆ next_statement()

void next_statement ( struct basic_ctx ctx)

◆ openin_statement()

void openin_statement ( struct basic_ctx ctx)

◆ openout_statement()

void openout_statement ( struct basic_ctx ctx)

◆ openup_statement()

void openup_statement ( struct basic_ctx ctx)

◆ point_statement()

void point_statement ( struct basic_ctx ctx)

◆ pop_statement()

void pop_statement ( struct basic_ctx ctx)

◆ print_statement()

void print_statement ( struct basic_ctx ctx)

◆ printable_syntax()

char* printable_syntax ( struct basic_ctx ctx)

◆ proc_statement()

void proc_statement ( struct basic_ctx ctx)

◆ push_statement()

void push_statement ( struct basic_ctx ctx)

◆ read_statement()

void read_statement ( struct basic_ctx ctx)

◆ rectangle_statement()

void rectangle_statement ( struct basic_ctx ctx)

◆ redim_statement()

void redim_statement ( struct basic_ctx ctx)

◆ relation()

int64_t relation ( struct basic_ctx ctx)

◆ repeat_statement()

void repeat_statement ( struct basic_ctx ctx)

◆ retproc_statement()

void retproc_statement ( struct basic_ctx ctx)

◆ return_statement()

void return_statement ( struct basic_ctx ctx)

◆ rmdir_statement()

void rmdir_statement ( struct basic_ctx ctx)

◆ set_system_variables()

void set_system_variables ( struct basic_ctx ctx,
uint32_t  pid 
)

◆ sockclose_statement()

void sockclose_statement ( struct basic_ctx ctx)

◆ sockread_statement()

void sockread_statement ( struct basic_ctx ctx)

◆ sockwrite_statement()

void sockwrite_statement ( struct basic_ctx ctx)

◆ statement()

void statement ( struct basic_ctx ctx)

◆ str_expr()

const char* str_expr ( struct basic_ctx ctx)

◆ str_relation()

int64_t str_relation ( struct basic_ctx ctx)

◆ triangle_statement()

void triangle_statement ( struct basic_ctx ctx)

◆ until_statement()

void until_statement ( struct basic_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 basic_ctx ctx,
const char *  varname 
)

◆ varname_is_int_array_access()

bool varname_is_int_array_access ( struct basic_ctx ctx,
const char *  varname 
)

◆ varname_is_string_array_access()

bool varname_is_string_array_access ( struct basic_ctx ctx,
const char *  varname 
)

◆ write_cpuid()

void write_cpuid ( struct basic_ctx ctx,
int  leaf 
)

◆ write_cpuidex()

void write_cpuidex ( struct basic_ctx ctx,
int  leaf,
int  subleaf 
)

◆ write_statement()

void write_statement ( struct basic_ctx ctx)