diff options
| author | sumuel <samuel@yakubos.org> | 2026-08-17 20:44:55 +0000 |
|---|---|---|
| committer | sumuel <samuel@yakubos.org> | 2026-08-17 20:44:55 +0000 |
| commit | 76424950e373d3b04ac3dd13019151bfba3e8423 (patch) | |
| tree | 4c3cfdbda039e592b9186be3e28f8d7cfd439e8a /src/modules/break | |
Add the files
Diffstat (limited to 'src/modules/break')
| -rw-r--r-- | src/modules/break/break.c | 36 | ||||
| -rw-r--r-- | src/modules/break/break.h | 11 | ||||
| -rw-r--r-- | src/modules/break/option.h | 8 |
3 files changed, 55 insertions, 0 deletions
diff --git a/src/modules/break/break.c b/src/modules/break/break.c new file mode 100644 index 0000000..e560e18 --- /dev/null +++ b/src/modules/break/break.c @@ -0,0 +1,36 @@ +#include "common/printing.h" +#include "logo/logo.h" +#include "modules/break/break.h" + +bool ffPrintBreak(FF_A_UNUSED FFBreakOptions* options) { + ffLogoPrintLine(); + putchar('\n'); + return true; +} + +void ffParseBreakJsonObject(FF_A_UNUSED FFBreakOptions* options, FF_A_UNUSED yyjson_val* module) { + yyjson_val *key, *val; + size_t idx, max; + yyjson_obj_foreach (module, idx, max, key, val) { + if (unsafe_yyjson_equals_str(key, "type") || unsafe_yyjson_equals_str(key, "condition")) { + continue; + } + + ffPrintError(FF_BREAK_MODULE_NAME, 0, NULL, FF_PRINT_TYPE_NO_CUSTOM_KEY, "Unknown JSON key %s", unsafe_yyjson_get_str(key)); + } +} + +void ffInitBreakOptions(FF_A_UNUSED FFBreakOptions* options) { +} + +void ffDestroyBreakOptions(FF_A_UNUSED FFBreakOptions* options) { +} + +FFModuleBaseInfo ffBreakModuleInfo = { + .name = FF_BREAK_MODULE_NAME, + .description = "Print an empty line", + .initOptions = (void*) ffInitBreakOptions, + .destroyOptions = (void*) ffDestroyBreakOptions, + .parseJsonObject = (void*) ffParseBreakJsonObject, + .printModule = (void*) ffPrintBreak, +}; diff --git a/src/modules/break/break.h b/src/modules/break/break.h new file mode 100644 index 0000000..f611b73 --- /dev/null +++ b/src/modules/break/break.h @@ -0,0 +1,11 @@ +#pragma once + +#include "option.h" + +#define FF_BREAK_MODULE_NAME "Break" + +bool ffPrintBreak(FFBreakOptions* options); +void ffInitBreakOptions(FFBreakOptions* options); +void ffDestroyBreakOptions(FFBreakOptions* options); + +extern FFModuleBaseInfo ffBreakModuleInfo; diff --git a/src/modules/break/option.h b/src/modules/break/option.h new file mode 100644 index 0000000..90a44df --- /dev/null +++ b/src/modules/break/option.h @@ -0,0 +1,8 @@ +#pragma once + +#include "common/option.h" + +typedef struct FFBreakOptions { +} FFBreakOptions; + +static_assert(sizeof(FFBreakOptions) <= FF_OPTION_MAX_SIZE, "FFBreakOptions size exceeds maximum allowed size"); |