aboutsummaryrefslogtreecommitdiff
path: root/include/kpl/class.h
blob: f7f96784a7e7c6f0b68dd682756d66b0a57263fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * The kpl class a 64bit value with an table of functions
 */

#pragma once

typedef uint8_t kpl_utf8[4];

typedef union {
    uint8_t u8;
    int8_t i8;
    uint16_t u16;
    int16_t i16;
    uint32_t u32;
    int32_t i32;
    uint64_t u64;
    int64_t i64;
    kpl_utf8 utf8;
    float f32;
    double f64;
    void *ptr;
} kpl_value;

typedef struct {
    kpl_value value;
    int64_t tag;
} kpl_result;

typedef struct {
// TODO KPL INTERFACE
} kpl_interface;

typedef struct {
    kpl_value value;
    kpl_interface *interface;
} kpl_class;