summaryrefslogtreecommitdiff
path: root/docs/application/interface.md
blob: 3f270bd55298b0e35fb2689edf1dac1405edba44 (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
37
38
# Interface

---

General definitions used throughout the code

## Object Definitions

```c
typedef union {
    bool b;
    uint8_t u8;
    uint16_t u16;
    uint32_t u32;
    uint64_t u64;
    int8_t i8;
    int16_t i16;
    int32_t i32;
    int64_t i64;
    float f32;
    double f64;
    void *ptr;
} kpl_any;

typedef size_t kpl_any_hash_fn(const kpl_any a);

typedef bool kpl_any_eq_fn(const kpl_any a, const kpl_any b);

typedef ssize_t kpl_any_cmp_fn(const kpl_any a, const kpl_any b);

typedef int32_t kpl_any_print_fn(const kpl_any a, FILE *file, size_t idnt, uint32_t print_opts);

typedef void kpl_any_free_fn(kpl_any a);

typedef struct {
    any value, info;
} kpl_result;
```