From 39f28db4644e9c2ea894b912f47cb0181cb4cbd5 Mon Sep 17 00:00:00 2001 From: Wodann Date: Thu, 10 Oct 2019 21:50:14 +0200 Subject: [PATCH] feat: add dispatch table and dependencies --- include/mun_abi.h | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/include/mun_abi.h b/include/mun_abi.h index c7d9116..862b4c5 100644 --- a/include/mun_abi.h +++ b/include/mun_abi.h @@ -6,12 +6,12 @@ /**
*/ typedef struct { - uint8_t b[16]; + const uint8_t b[16]; } MunGuid; typedef struct { - MunGuid guid; + const MunGuid guid; const char *name; } MunTypeInfo; @@ -29,15 +29,37 @@ typedef struct const char *name; const MunTypeInfo *arg_types; const MunTypeInfo *return_type; + const uint16_t num_arg_types; + const MunPrivacy_t privacy; +} MunFunctionSignature; + +/**
*/ +typedef struct +{ + const MunFunctionSignature signature; const void *fn_ptr; - uint16_t num_arg_types; - MunPrivacy_t privacy; } MunFunctionInfo; typedef struct { + const char *path; const MunFunctionInfo *functions; - uint32_t num_functions; + const uint32_t num_functions; } MunModuleInfo; +typedef struct +{ + const MunFunctionSignature *signatures; + const void **fn_ptrs; + const uint32_t num_entries; +} MunDispatchTable; + +typedef struct +{ + const MunModuleInfo symbols; + MunDispatchTable dispatch_table; + const char *const *dependencies; + const uint32_t num_dependencies; +} MunAssemblyInfo; + #endif