addition: init and destroy ByteString

This commit is contained in:
2026-05-31 20:48:45 -06:00
parent af8bf3a747
commit f5c5e4cdd7
3 changed files with 69 additions and 16 deletions

View File

@@ -1,6 +1,19 @@
#ifndef LAE_STRINGS_H
#define LAE_STRINGS_H
#include "lae_allocator.h"
typedef struct ByteStr ByteStr;
typedef enum {
STR_OK,
STR_BAD_ALLOC,
STR_OUT_OF_BOUNDS,
STR_NULL_ARG,
STR_NULL_STRING,
STR_INVALID_CAPACITY,
} StringErr;
StringErr bstr_init(ByteStr **bstr, Allocator alloc, size_t capacity);
StringErr bstr_destroy(ByteStr **bstr);
#endif