From f34fb5042d40c186583f9e3009d8a1dd71d07d43 Mon Sep 17 00:00:00 2001 From: Doan Luu Duc Tai Date: Tue, 8 Sep 2026 14:46:47 -0500 Subject: Initial commit --- src/config.h | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/config.h (limited to 'src/config.h') diff --git a/src/config.h b/src/config.h new file mode 100644 index 0000000..f8824ab --- /dev/null +++ b/src/config.h @@ -0,0 +1,69 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +/* + * vfetch - neofetch but the ascii part is a video + * + * Copyright (C) 2026 Doan Luu Duc Tai + * + */ + +#ifndef SRC__CONFIG_H +#define SRC__CONFIG_H + +#include +#include +#include +#include +#include "error.h" + +typedef enum { + ARG_HANDLER_BOOLEAN, + ARG_HANDLER_CHAFA_MAP, + ARG_HANDLER_CHAFA_FLAG, + ARG_HANDLER_BOUNDED_FLOAT, + ARG_HANDLER_CUSTOM +} ArgHandlerType; + +typedef struct VfetchArgs { + GHashTable *chafa_options; + gchar *filename; + gchar *colors_arg; + gchar *fetch_tool_arg; + gchar *fg_color_arg; + gchar *bg_color_arg; + gchar *format_arg; + double cell_aspect_ratio; + double fps; + uint32_t width; + uint32_t height; + uint32_t pad_x; + uint32_t pad_y; + uint32_t num_frames; + uint16_t refresh_rate; + bool audio; + bool loop; + bool debug; + bool verbose; +} VfetchArgs; + +typedef struct BoundedFloatData { + size_t offset; + float min; + float max; +} BoundedFloatData; + +typedef VfetchError (*CustomArgParserFunc)(int *idx, + int argc, + const char *argv[], + VfetchArgs *args); +typedef struct ArgumentHandler { + union { + BoundedFloatData bounded_float; + CustomArgParserFunc custom_parser; + const char *chafa_key; + size_t boolean_offset; + } data; + const char *name; + ArgHandlerType type; +} ArgumentHandler; + +#endif /* SRC__CONFIG_H */ -- cgit v1.2.3