aboutsummaryrefslogtreecommitdiff
path: root/include/kpl.h
blob: 833c18bb95a9c45ed0b1eca91b700a472c70f279 (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
39

#pragma once

#define KPL_VERSION "0.0.0"

// All headers in one file for including

#include "kpl/queue.h"
#include "kpl/io.h"
#include "kpl/process.h"
#include "kpl/code.h"

typedef enum : uint32_t {
    KPL_CONFIG_FLAG_EVAL    = 1 << 0,
    KPL_CONFIG_FLAG_REPL    = 1 << 1
} kpl_config_flags;

typedef struct {
    uint32_t flags;
    int32_t argc, main_module_arg_index;
    const char **argv, *module_extension, *version;
    kpl_config_io io;
    kpl_config_thread thread;
    kpl_config_code code;
} kpl_config;

void kpl_config_init(kpl_config *config);

bool kpl_config_valid_module_exension(kpl_config *config, const char *module_name);

int32_t kpl_config_parse_args(kpl_config *config, const int32_t argc, const char *argv[]);

typedef struct _kpl_env {
    kpl_config config;
    _Atomic ssize_t total_priority;
    kpl_io io;
    kpl_process process;
    kpl_code code;
} kpl_env;