diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/kpl.h | 17 | ||||
| -rw-r--r-- | include/kpl/io.h | 10 | ||||
| -rw-r--r-- | include/kpl/macro.h | 2 | ||||
| -rw-r--r-- | include/kpl/memory.h | 8 | ||||
| -rw-r--r-- | include/kpl/thread.h | 10 |
5 files changed, 46 insertions, 1 deletions
diff --git a/include/kpl.h b/include/kpl.h index adf366f..15933ee 100644 --- a/include/kpl.h +++ b/include/kpl.h @@ -4,3 +4,20 @@ // All headers in one file for including #include "kpl/macro.h" +#include "kpl/io.h" +#include "kpl/thread.h" +#include "kpl/memory.h" + +typedef struct { + int32_t argc, main_module_arg_index; + const char **argv, *module_extension; + kpl_config_io io; + kpl_config_thread thread; + kpl_config_memory memory; +} 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[]); diff --git a/include/kpl/io.h b/include/kpl/io.h new file mode 100644 index 0000000..e6ea690 --- /dev/null +++ b/include/kpl/io.h @@ -0,0 +1,10 @@ + +#pragma once + +// Io through io_uring + +#include "kpl/macro.h" + +typedef struct { + int32_t queue_pow; +} kpl_config_io; diff --git a/include/kpl/macro.h b/include/kpl/macro.h index f682a30..63699d0 100644 --- a/include/kpl/macro.h +++ b/include/kpl/macro.h @@ -6,4 +6,4 @@ #include "color.h" #include "type.h" -#define KPL_TODO(MESSAGE) printf(KPL_COLOR2(BOLD, LIGHT_YELLOW) "TODO " KPL_COLOR(RESET) KPL_COLOR(BOLD) "%s" KPL_COLOR(RESET) ":" KPL_COLOR(LIGHT_BLUE) "%s" KPL_COLOR(RESET) ":" KPL_COLOR(LIGHT_MAGENTA) "%d" KPL_COLOR(RESET) "::" KPL_COLOR(LIGHT_YELLOW) "%s\n" KPL_COLOR(RESET), __FILE__, __FUNCTION__, __LINE__, MESSAGE) +#define KPL_PRINT_TODO(MESSAGE) printf(KPL_COLOR2(BOLD, LIGHT_YELLOW) "TODO " KPL_COLOR(RESET) KPL_COLOR(BOLD) "%s" KPL_COLOR(RESET) ":" KPL_COLOR(LIGHT_BLUE) "%s" KPL_COLOR(RESET) ":" KPL_COLOR(LIGHT_MAGENTA) "%d" KPL_COLOR(RESET) "::" KPL_COLOR(LIGHT_YELLOW) "%s\n" KPL_COLOR(RESET), __FILE__, __FUNCTION__, __LINE__, MESSAGE) diff --git a/include/kpl/memory.h b/include/kpl/memory.h new file mode 100644 index 0000000..9b9a843 --- /dev/null +++ b/include/kpl/memory.h @@ -0,0 +1,8 @@ + +#pragma once + +// Kpl memory pools and garbage collection + +typedef struct { + +} kpl_config_memory; diff --git a/include/kpl/thread.h b/include/kpl/thread.h new file mode 100644 index 0000000..99db80f --- /dev/null +++ b/include/kpl/thread.h @@ -0,0 +1,10 @@ + +#pragma once + +// Kpl threads, allocators ad atomic queues + +#include "kpl/macro.h" + +typedef struct { + int32_t thread_count; +} kpl_config_thread; |
