This commit is contained in:
Alvin-Zilverstand committed 2026-10-09 03:19:53 +02:00
1 parent 6dc841f956
commit 3d06f94e48
46 files changed
+5830 -543

No files matched your search

+17
View File
@@ -6,17 +6,28 @@
#define BOB64_SHELL_LINE_CAPACITY 128
#define BOB64_SHELL_ARGUMENT_LIMIT 16
#define BOB64_SHELL_HISTORY_LIMIT 8
#define BOB64_SHELL_INPUT_UP 0x10000
#define BOB64_SHELL_INPUT_DOWN 0x10001
typedef void (*BOB64_SHELL_WRITE)(void *context,const char *text);
typedef void (*BOB64_SHELL_CLEAR)(void *context);
typedef s64 (*BOB64_SHELL_RUN)(void *context,const char *name,usize argument_count,
const char *const *arguments,int *started);
typedef int (*BOB64_SHELL_COMPILE)(void *context,const char *source_name,
const char *output_name,usize *error_offset);
typedef int (*BOB64_SHELL_SNAPSHOT_SAVE)(void *context,const void *snapshot,
usize snapshot_size);
typedef int (*BOB64_SHELL_SNAPSHOT_RESTORE)(void *context,
BOB64_FILESYSTEM *filesystem);
typedef struct {
char Line[BOB64_SHELL_LINE_CAPACITY];
usize Length;
char History[BOB64_SHELL_HISTORY_LIMIT][BOB64_SHELL_LINE_CAPACITY];
char HistoryDraft[BOB64_SHELL_LINE_CAPACITY];
usize HistoryCount,HistoryIndex,HistoryDraftLength;
u8 IgnoreLineFeed;
u8 HistoryBrowsing;
BOB64_PAGE_ALLOCATOR *PageAllocator;
BOB64_HEAP *Heap;
BOB64_FILESYSTEM *Filesystem;
@@ -27,6 +38,9 @@ typedef struct {
BOB64_SHELL_RUN Run;
BOB64_SHELL_COMPILE Compile;
void *Context;
BOB64_SHELL_SNAPSHOT_SAVE SnapshotSave;
BOB64_SHELL_SNAPSHOT_RESTORE SnapshotRestore;
void *SnapshotContext;
} BOB64_SHELL;
int bob64_shell_init(BOB64_SHELL *shell,BOB64_PAGE_ALLOCATOR *allocator,
@@ -36,5 +50,8 @@ int bob64_shell_init(BOB64_SHELL *shell,BOB64_PAGE_ALLOCATOR *allocator,
void bob64_shell_input(BOB64_SHELL *shell,int character);
void bob64_shell_set_runner(BOB64_SHELL *shell,BOB64_SHELL_RUN run);
void bob64_shell_set_compiler(BOB64_SHELL *shell,BOB64_SHELL_COMPILE compile);
void bob64_shell_set_snapshot_storage(BOB64_SHELL *shell,
BOB64_SHELL_SNAPSHOT_SAVE save,BOB64_SHELL_SNAPSHOT_RESTORE restore,
void *context);
#endif