aboutsummaryrefslogtreecommitdiff
path: root/include/program.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/program.h')
-rw-r--r--include/program.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/program.h b/include/program.h
index 543b38d..075bfca 100644
--- a/include/program.h
+++ b/include/program.h
@@ -30,6 +30,7 @@
#define AMAL_PROGRAM_INVALID_EXTERNAL_FUNCTIONS_SIZE -18
#define AMAL_PROGRAM_INSTRUCTION_INVALID_EXTERN_FUNC_INDEX -19
#define AMAL_PROGRAM_NO_SUCH_EXTERNAL_FUNCTION -20
+#define AMAL_PROGRAM_EXTERN_FUNC_ALREADY_EXISTS -21
#define AMAL_PROGRAM_MAGIC_NUMBER (u32)0xdec05eba
#define AMAL_PROGRAM_MAJOR_VERSION 1
@@ -66,6 +67,10 @@ typedef struct {
CHECK_RESULT int amal_program_init(amal_program *self);
void amal_program_deinit(amal_program *self);
+/*
+ returns @AMAL_PROGRAM_EXTERN_FUNC_ALREADY_EXISTS if a function with the name @name already exists
+ in the program
+*/
CHECK_RESULT int amal_program_add_extern_func(amal_program *self, BufferView name, void *func_ptr, int args_byte_size);
CHECK_RESULT int amal_program_append_bytecode(amal_program *self, Bytecode *bytecode);