From c68fe7634341e97c3246b627a20fa9487586ffcb Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 21 Aug 2019 06:08:00 +0200 Subject: hash map contains --- include/program.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/program.h') 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); -- cgit v1.2.3