aboutsummaryrefslogtreecommitdiff
path: root/include/program.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-08-21 06:08:00 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commitc68fe7634341e97c3246b627a20fa9487586ffcb (patch)
tree78d499cc090439fa8fe087105e52f771d7728d23 /include/program.h
parentf24139d455af3a179fe1d19c951e4cd85744c592 (diff)
hash map contains
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);