forked from mirrors/ubasic
fix
This commit is contained in:
parent
cc07193c23
commit
155ce36531
5 changed files with 114 additions and 18 deletions
13
ubasic.h
13
ubasic.h
|
|
@ -35,10 +35,23 @@
|
|||
typedef VARIABLE_TYPE (*peek_func)(VARIABLE_TYPE);
|
||||
typedef void (*poke_func)(VARIABLE_TYPE, VARIABLE_TYPE);
|
||||
|
||||
enum {
|
||||
UBASIC_OK = 0,
|
||||
UBASIC_ERR_SYNTAX,
|
||||
UBASIC_ERR_DIV_ZERO,
|
||||
UBASIC_ERR_STACK, /* GOSUB/FOR overflow or RETURN without GOSUB */
|
||||
UBASIC_ERR_NO_LINE, /* GOTO/GOSUB to a nonexistent line */
|
||||
UBASIC_ERR_NO_CALLBACK /* PEEK/POKE without a registered callback */
|
||||
};
|
||||
|
||||
void ubasic_init(const char *program);
|
||||
void ubasic_init_peek_poke(const char *program, peek_func peek, poke_func poke);
|
||||
void ubasic_run(void);
|
||||
int ubasic_finished(void);
|
||||
|
||||
int ubasic_error(void);
|
||||
const char *ubasic_error_message(void);
|
||||
|
||||
VARIABLE_TYPE ubasic_get_variable(int varnum);
|
||||
void ubasic_set_variable(int varum, VARIABLE_TYPE value);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue