#ifndef pastfetch_H
#define pastfetch_H

#include <stddef.h>

#define MAX_FLAVOR_LEN 32

typedef struct {
    char dos_flavor[MAX_FLAVOR_LEN];
    unsigned char dos_major;
    unsigned char dos_minor;
    unsigned char dos_revision;
    unsigned char dos_flags;
    char shell[64];
    char computer_model[64];
    char cpu[64];
    unsigned int conventional_kb;
    unsigned long extended_kb; // 16-bit int caps at 64 MB
    unsigned long disk_total_bytes;
    unsigned long disk_free_bytes;
    char display_mode[64];
    char display_adapter[64];
    char display_vbe[64];
    char palette_info[256];
    char ver_string[80];
    char logo_hint[32];
    int ansi_available;
} SystemInfo;

// Growable array of owned strings; see src/util.
typedef struct {
    char **items;
    size_t count;
    size_t capacity;
} StringList;

typedef struct {
    int no_logo;
    char logo_override[32];
    int list_only;
    int prompt_fix;
    int force_ascii;
    int hard_exit;
} RunOptions;

// util.c -- string helpers (all tolerate NULL)
void str_copy(char *dest, size_t dest_len, const char *src);
int str_equals_ci(const char *a, const char *b);
int str_equals_ci_n(const char *a, const char *b, size_t len);
int str_starts_ci(const char *text, const char *prefix);
int str_ends_ci(const char *text, const char *suffix);
const char *str_find_ci(const char *text, const char *needle);
int str_has_ci(const char *text, const char *needle);

// util.c -- StringList
void strlist_init(StringList *list);
int strlist_add(StringList *list, const char *value);
int strlist_addn(StringList *list, const char *value, size_t len);
int strlist_adopt(StringList *list, char *owned);
void strlist_remove(StringList *list, size_t index);
void strlist_free(StringList *list);

// detect.c
void detect_system(SystemInfo *info, StringList *drivers);

// render.c
void render_system(const SystemInfo *info, const StringList *drivers, const RunOptions *options);
void list_available_logos(void);
int logo_name_exists(const char *name, char *normalized, size_t normalized_len);

#endif // pastfetch_H
