aboutsummaryrefslogtreecommitdiff
path: root/stdlib/optionals.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-15 15:50:28 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-15 15:50:28 -0400
commit33876323aa2e3b1994a60b294cfd3f7fd0b35f68 (patch)
treed673f2f56cb22ff30cdf4d3a8f05eebebc801047 /stdlib/optionals.h
parent4ad7509013bcd383c2060c3659733edb17221fb3 (diff)
Update path reading APIs to use optional values instead of erroring
Diffstat (limited to 'stdlib/optionals.h')
-rw-r--r--stdlib/optionals.h14
1 files changed, 9 insertions, 5 deletions
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);