#ifndef DSTR_H #define DSTR_H #include "aliases.h" #include "mem_allocator.h" #ifdef __cplusplus extern "C" { #endif // __cplusplus typedef struct dstr String; String *wapp_dstr_with_capacity(u64 capacity, const Allocator *allocator); String *wapp_dstr_from_string(const char *str, const Allocator *allocator); void wapp_dstr_update(String **dst, const char *src); void wapp_dstr_free(String **str); void wapp_dstr_concat(String **dst, const char *src); void wapp_dstr_append(String **dst, char c); void wapp_dstr_resize(String **str); void wapp_dstr_clear(String *str); void wapp_dstr_print(const String *str); i64 wapp_dstr_find(const String *str, const char *substr); u64 wapp_dstr_length(const String *str); u64 wapp_dstr_capacity(const String *str); const char *wapp_dstr_to_cstr(const String *str); #ifdef __cplusplus } #endif // __cplusplus #endif // !DSTR_H