From bd25ddaa524ba25643a9389de2eef1f92d32ef2b Mon Sep 17 00:00:00 2001 From: vx-clutch Date: Fri, 18 Jul 2025 20:23:30 -0400 Subject: [PATCH] update: the way we store libs --- yait/format.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/yait/format.h b/yait/format.h index fe30cdb..c6bc4f3 100644 --- a/yait/format.h +++ b/yait/format.h @@ -11,12 +11,19 @@ typedef enum { UNLICENCE, /* Unlicense */ } licence_t; -/* Library type enumeration */ +/* Library type enumeration - using bit flags for multiple selection */ typedef enum { - RAYLIB, /* Raylib game library */ - WINAPI, /* Windows API */ - cURL, /* cURL library */ -} lib_t; + LIB_NONE = 0, /* No libraries selected */ + LIB_RAYLIB = 1 << 0, /* Raylib game library */ + LIB_WINAPI = 1 << 1, /* Windows API */ + LIB_CURL = 1 << 2, /* cURL library */ + /* Future libraries can be added here: + * LIB_OPENGL = 1 << 3, + * LIB_SDL2 = 1 << 4, + * LIB_GTK = 1 << 5, + * etc. + */ +} lib_flags_t; /* Project configuration structure */ typedef struct { @@ -25,11 +32,19 @@ typedef struct { licence_t licence; /* License type for the project */ char *project; /* Project name */ char *name; /* Author/creator name */ + lib_flags_t libraries; /* Selected libraries (bit field) */ } format_t; /* Default values */ #define DEFAULT_LICENSE BSD3 #define DEFAULT_GIT_INIT true #define DEFAULT_CLANG_FORMAT true +#define DEFAULT_LIBRARIES LIB_NONE + +/* Helper macros for library operations */ +#define HAS_LIBRARY(libs, lib) ((libs) & (lib)) +#define ADD_LIBRARY(libs, lib) ((libs) |= (lib)) +#define REMOVE_LIBRARY(libs, lib) ((libs) &= ~(lib)) +#define CLEAR_LIBRARIES(libs) ((libs) = LIB_NONE) #endif