YREA-SLS/SLS_C/include/sls/string.h

29 lines
510 B
C

// Kyler Olsen
// YREA SLS
// Strings Header
// November 2025
#ifndef SLS_STRING_H
#define SLS_STRING_H
#include <stddef.h>
#include <stdarg.h>
#include "bool.h"
typedef struct {
const size_t len;
const char *str;
const 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 format(const SlsStr s, ...);
#endif // SLS_STRING_H