From 689719e0a1f139e28e57a4df334d5fde354b3379 Mon Sep 17 00:00:00 2001 From: nodist Date: Tue, 20 Oct 2026 14:11:31 -0400 Subject: config parse cli arguments --- include/kpl/value.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 include/kpl/value.h (limited to 'include/kpl/value.h') diff --git a/include/kpl/value.h b/include/kpl/value.h new file mode 100644 index 0000000..1e05c00 --- /dev/null +++ b/include/kpl/value.h @@ -0,0 +1,51 @@ +/* + * KPL values based on size + */ + +#pragma once + +#define _KPL_VALUE8 \ + uint8_t u8; \ + int8_t i8 + +typedef union { + _KPL_VALUE8; +} kpl_value8; + +#define _KPL_VALUE16 \ + uint16_t u16; \ + int16_t i16 + +typedef union { + _KPL_VALUE8; + _KPL_VALUE16; +} kpl_value16; + +typedef uint8_t kpl_utf8[4]; + +#define _KPL_VALUE32 \ + kpl_utf8 utf8; \ + uint32_t u32; \ + int32_t i32; \ + float f32 + +typedef union { + _KPL_VALUE8; + _KPL_VALUE16; + _KPL_VALUE32; +} kpl_value32; + +typedef union { + _KPL_VALUE8; + _KPL_VALUE16; + _KPL_VALUE32; + uint64_t u64; + int64_t i64; + double f64; + void *ptr; +} kpl_value64; + +typedef struct { + kpl_value64 value; + int64_t tag; +} kpl_result; -- cgit v1.2.3