#ifndef STR_H
#define STR_H

#include "aliases.h"
#include "mem_arena.h"

enum {
  STR_OP_SUCEEDED,
  STR_OP_FAILED,
};

typedef struct str8 Str8;
struct str8 {
  char *str;
  u64 length;
  u64 capacity;
};

#define str8_lit(STR) (str8(NULL, STR))

Str8 str8(Arena *arena, char *str);
Str8 str8_copy(Arena *arena, const Str8 *str);
i32 str8_concat(Arena *arena, Str8 *dst, char *src);
Str8 str8_substr(Arena *arena, const Str8 *str, u64 start, u64 count);

#endif // !STR_H
