From a5d1549b446cd58cefd54565728f57cb82841f04 Mon Sep 17 00:00:00 2001 From: Luis Michaelis Date: Sat, 14 Sep 2024 18:26:55 +0200 Subject: [PATCH] feat: add more DaedalusScript APIs --- include/zenkit-capi/DaedalusScript.h | 8 +++++++ src/DaedalusScript.cc | 35 ++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/include/zenkit-capi/DaedalusScript.h b/include/zenkit-capi/DaedalusScript.h index 06b5f04..c0e3c85 100644 --- a/include/zenkit-capi/DaedalusScript.h +++ b/include/zenkit-capi/DaedalusScript.h @@ -158,3 +158,11 @@ ZKC_API ZkDaedalusDataType ZkDaedalusSymbol_getReturnType(ZkDaedalusSymbol const ZKC_API ZkDaedalusInstanceType ZkDaedalusInstance_getType(ZkDaedalusInstance const* slf); ZKC_API uint32_t ZkDaedalusInstance_getIndex(ZkDaedalusInstance const* slf); + +ZKC_API uint32_t ZkDaedalusSymbol_getFileIndex(ZkDaedalusSymbol const* slf); +ZKC_API uint32_t ZkDaedalusSymbol_getOffsetAsMember(ZkDaedalusSymbol const* slf); +ZKC_API uint32_t ZkDaedalusSymbol_getLineStart(ZkDaedalusSymbol const* slf); +ZKC_API uint32_t ZkDaedalusSymbol_getLineCount(ZkDaedalusSymbol const* slf); +ZKC_API uint32_t ZkDaedalusSymbol_getCharStart(ZkDaedalusSymbol const* slf); +ZKC_API uint32_t ZkDaedalusSymbol_getCharCount(ZkDaedalusSymbol const* slf); +ZKC_API uint32_t ZkDaedalusSymbol_getClassSize(ZkDaedalusSymbol const* slf); diff --git a/src/DaedalusScript.cc b/src/DaedalusScript.cc index aa3c577..7e4719c 100644 --- a/src/DaedalusScript.cc +++ b/src/DaedalusScript.cc @@ -213,3 +213,38 @@ uint32_t ZkDaedalusInstance_getIndex(ZkDaedalusInstance const* slf) { ZKC_CHECK_NULL(slf); return slf->symbol_index(); } + +uint32_t ZkDaedalusSymbol_getFileIndex(ZkDaedalusSymbol const* slf) { + ZKC_CHECK_NULL(slf); + return slf->file_index(); +} + +uint32_t ZkDaedalusSymbol_getOffsetAsMember(ZkDaedalusSymbol const* slf) { + ZKC_CHECK_NULL(slf); + return slf->offset_as_member(); +} + +uint32_t ZkDaedalusSymbol_getLineStart(ZkDaedalusSymbol const* slf) { + ZKC_CHECK_NULL(slf); + return slf->line_start(); +} + +uint32_t ZkDaedalusSymbol_getLineCount(ZkDaedalusSymbol const* slf) { + ZKC_CHECK_NULL(slf); + return slf->line_count(); +} + +uint32_t ZkDaedalusSymbol_getCharStart(ZkDaedalusSymbol const* slf) { + ZKC_CHECK_NULL(slf); + return slf->char_start(); +} + +uint32_t ZkDaedalusSymbol_getCharCount(ZkDaedalusSymbol const* slf) { + ZKC_CHECK_NULL(slf); + return slf->char_count(); +} + +uint32_t ZkDaedalusSymbol_getClassSize(ZkDaedalusSymbol const* slf) { + ZKC_CHECK_NULL(slf); + return slf->class_size(); +}