//! Better string handling #ifndef _STR_H #define _STR_H #include #include #define STRF_OWNED AS(1ul << 5, int) #define STRF_DERIVED AS(1ul << 6, int) enum str_ownership { STR_NULL = 0, STR_OWNED = STRF_OWNED, STR_OWNED_STATIC, STR_OWNED_MALLOC, STR_OWNED_STACK, STR_DERIVED = STRF_DERIVED, STR_DERIVED_STATIC, STR_DERIVED_MALLOC, STR_DERIVED_STACK, }; typedef struct string str_t; str_t* str_alloc(usize cap) _callconv(alloc); char* str_new(const char* pIN cstr) _callconv(alloc); void str_free(str_t* restrict str); #endif /* _STR_H */