diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-07-20 14:49:18 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-07-30 00:41:56 +0200 |
commit | 41114a02a38a65956010bab95c4bff19af7ac1ed (patch) | |
tree | d993746857c6a57ff61dfefc315537825c1ee63f /include | |
parent | 70ae3040fb384e7a77ef43ca6b426269f9acdcab (diff) |
source: add tracking of exported symbols
Extend abstract source objects to maintain a list of exported symbols and
add functions to append and lookup exported names.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'include')
-rw-r--r-- | include/ucode/source.h | 3 | ||||
-rw-r--r-- | include/ucode/types.h | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/ucode/source.h b/include/ucode/source.h index 6f9a8d7..b3eaa34 100644 --- a/include/ucode/source.h +++ b/include/ucode/source.h @@ -54,4 +54,7 @@ void uc_source_line_update(uc_source_t *source, size_t off); void uc_source_runpath_set(uc_source_t *source, const char *runpath); +bool uc_source_export_add(uc_source_t *source, uc_value_t *name); +ssize_t uc_source_export_lookup(uc_source_t *source, uc_value_t *name); + #endif /* UCODE_SOURCE_H */ diff --git a/include/ucode/types.h b/include/ucode/types.h index 314dbc8..cde84f6 100644 --- a/include/ucode/types.h +++ b/include/ucode/types.h @@ -65,6 +65,7 @@ typedef struct { /* Source buffer defintions */ uc_declare_vector(uc_lineinfo_t, uint8_t); +uc_declare_vector(uc_exports_t, uc_value_t *); typedef struct { uc_value_t header; @@ -72,6 +73,7 @@ typedef struct { FILE *fp; size_t off; uc_lineinfo_t lineinfo; + uc_exports_t exports; } uc_source_t; |