From 33876323aa2e3b1994a60b294cfd3f7fd0b35f68 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 15 Sep 2024 15:50:28 -0400 Subject: Update path reading APIs to use optional values instead of erroring --- stdlib/optionals.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'stdlib/optionals.h') diff --git a/stdlib/optionals.h b/stdlib/optionals.h index e37d5345..b67badc4 100644 --- a/stdlib/optionals.h +++ b/stdlib/optionals.h @@ -9,13 +9,17 @@ #include "util.h" #define OptionalBool_t uint8_t +#define OptionalArray_t Array_t +#define OptionalTable_t Table_t +#define OptionalText_t Text_t +#define OptionalClosure_t Closure_t extern const OptionalBool_t NULL_BOOL; -extern const Table_t NULL_TABLE; -extern const Array_t NULL_ARRAY; -extern const Int_t NULL_INT; -extern const Closure_t NULL_CLOSURE; -extern const Text_t NULL_TEXT; +extern const OptionalTable_t NULL_TABLE; +extern const OptionalArray_t NULL_ARRAY; +extern const OptionalInt_t NULL_INT; +extern const OptionalClosure_t NULL_CLOSURE; +extern const OptionalText_t NULL_TEXT; PUREFUNC bool is_null(const void *obj, const TypeInfo *non_optional_type); Text_t Optional$as_text(const void *obj, bool colorize, const TypeInfo *type); -- cgit v1.2.3