// Kyler Olsen // YREA SLS // Strings Header // November 2025 #ifndef SLS_STRING_H #define SLS_STRING_H #include #include #include "bool.h" typedef struct { size_t len; const char *str; Boolean allocated; } SlsStr; #define SLS_STR(s) (SlsStr){ sizeof(s) - 1, (s), FALSE } int isascii(unsigned char c); size_t strnlen(const char *s, size_t maxlen); SlsStr malloc_str(const char *s, size_t maxlen); SlsStr new_str(size_t length); SlsStr copy_str(SlsStr s); int32_t compare_str(SlsStr a, SlsStr b); void free_str(SlsStr *s); SlsStr format(const SlsStr s, ...); #endif // SLS_STRING_H