mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
move to runtime
This commit is contained in:
parent
6c39c65076
commit
26a42d4c81
21 changed files with 477 additions and 1879 deletions
26
byterun/include/utils.h
Normal file
26
byterun/include/utils.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
/* The unpacked representation of bytecode file */
|
||||
typedef struct {
|
||||
char *string_ptr; /* A pointer to the beginning of the string table */
|
||||
int *public_ptr; /* A pointer to the beginning of publics table */
|
||||
char *code_ptr; /* A pointer to the bytecode itself */
|
||||
int *global_ptr; /* A pointer to the global area */
|
||||
int stringtab_size; /* The size (in bytes) of the string table */
|
||||
int global_area_size; /* The size (in words) of global area */
|
||||
int public_symbols_number; /* The number of public symbols */
|
||||
char buffer[0];
|
||||
} bytefile;
|
||||
|
||||
/* Gets a string from a string table by an index */
|
||||
char *get_string(bytefile *f, int pos);
|
||||
|
||||
/* Gets a name for a public symbol */
|
||||
char *get_public_name(bytefile *f, int i);
|
||||
|
||||
/* Gets an offset for a public symbol */
|
||||
int get_public_offset(bytefile *f, int i);
|
||||
|
||||
// ---
|
||||
Loading…
Add table
Add a link
Reference in a new issue