diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-10-20 14:11:31 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-10-20 14:11:31 -0400 |
| commit | 689719e0a1f139e28e57a4df334d5fde354b3379 (patch) | |
| tree | 2b5e0d0c4aced4886ff3c67729adceba45cac3b0 /include/kpl/value.h | |
| parent | baa6f9cdea938c06435635f906b128f7940a59ec (diff) | |
config parse cli arguments
Diffstat (limited to 'include/kpl/value.h')
| -rw-r--r-- | include/kpl/value.h | 51 |
1 files changed, 51 insertions, 0 deletions
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; |
