diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-09-20 17:10:21 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-09-20 17:10:21 -0400 |
| commit | 260e50d627aea535abcd9d9902c1b4ae56da4c54 (patch) | |
| tree | 91a5ec00e02e67c78437040a798f2fa3140e57a0 /include | |
| parent | 4e19e6ab1bd24466d9dcb0d8eea54a7e3d84d576 (diff) | |
add config for io and thread
Diffstat (limited to 'include')
| -rw-r--r-- | include/kpl.h | 12 | ||||
| -rw-r--r-- | include/kpl/io.h | 6 | ||||
| -rw-r--r-- | include/kpl/macro.h | 6 | ||||
| -rw-r--r-- | include/kpl/memory.h | 8 | ||||
| -rw-r--r-- | include/kpl/thread.h | 2 |
5 files changed, 22 insertions, 12 deletions
diff --git a/include/kpl.h b/include/kpl.h index 15933ee..c4450ca 100644 --- a/include/kpl.h +++ b/include/kpl.h @@ -6,14 +6,18 @@ #include "kpl/macro.h" #include "kpl/io.h" #include "kpl/thread.h" -#include "kpl/memory.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; kpl_config_io io; kpl_config_thread thread; - kpl_config_memory memory; } kpl_config; void kpl_config_init(kpl_config *config); @@ -21,3 +25,7 @@ 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_config config; +} kpl_env; diff --git a/include/kpl/io.h b/include/kpl/io.h index e6ea690..2b33755 100644 --- a/include/kpl/io.h +++ b/include/kpl/io.h @@ -5,6 +5,12 @@ #include "kpl/macro.h" +typedef enum : int32_t { + KPL_IO_QUEUE_POW_MIN = 4, + KPL_IO_QUEUE_POW_DEFAULT = 10, + KPL_IO_QUEUE_POW_MAX = 16 +} kpl_io_queue_pow_options; + typedef struct { int32_t queue_pow; } kpl_config_io; diff --git a/include/kpl/macro.h b/include/kpl/macro.h index 63699d0..cdcaa1f 100644 --- a/include/kpl/macro.h +++ b/include/kpl/macro.h @@ -6,4 +6,8 @@ #include "color.h" #include "type.h" -#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) +#define _KPL_PRINT_(MESSAGE_COLOR, MESSAGE) printf(KPL_COLOR2(BOLD, MESSAGE_COLOR) "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(MESSAGE_COLOR) "%s\n" KPL_COLOR(RESET), __FILE__, __FUNCTION__, __LINE__, MESSAGE) + +#define KPL_PRINT_TODO(MESSAGE) _KPL_PRINT_(LIGHT_YELLOW, MESSAGE) + +#define KPL_PRINT_ERROR(MESSAGE) _KPL_PRINT_(LIGHT_RED, MESSAGE) diff --git a/include/kpl/memory.h b/include/kpl/memory.h deleted file mode 100644 index 9b9a843..0000000 --- a/include/kpl/memory.h +++ /dev/null @@ -1,8 +0,0 @@ - -#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 index 99db80f..7304340 100644 --- a/include/kpl/thread.h +++ b/include/kpl/thread.h @@ -6,5 +6,5 @@ #include "kpl/macro.h" typedef struct { - int32_t thread_count; + int32_t count; } kpl_config_thread; |
