a tiny string library written in C because apparently managing memory manually sounded like a good idea and that C didn't give me enough suffering already (turns out to be FALSE MID-WAY... i'm DYING)
basically, this is my first C library, and i am making it to learn how C actually handles strings and memory instead of hiding everything behind some nice convenient code like other languages do (abstraction)
the library currently has an owned string (mutable) type and a non-owning string_view type (immutable; read-only), with some basic operations for both
string-- a mutable, owned, dynamically allocated string typestring_view-- an immutable, non-owning view into existing string data
- GCC - as this C compiler is used for the project
git clone <insert-repository-url-here>
cd jstringtypes#include "include/string.h"
#include "include/string_view.h"
int main(void)
{
string str = string_from("Hello");
string_push_char(&str, '!');
string_print(str);
putchar('\n');
string_view view = string_view_from(str.data);
string_view sub = string_view_substr(view, 0, 5);
string_view_print(sub);
putchar('\n');
string_free(str);
return 0;
}See LICENSE.