/* Simple extendable string. * I think this doesn't leak? */ #ifndef _EXSTRING_H #define _EXSTRING_H #include typedef struct { size_t currentSize; char cstr[]; } exStringOpt; typedef char* exString; #define EXS(s) (* (char**)(s)) exString* exs_new(const char* from); exString* exs_clone(exString* from); void exs_free(exString* str); void exs_nappend(exString* str, const char* from, size_t length); void exs_append(exString* str, const char* from); void exs_appendf(exString* str, const char* fmt, ...); size_t exs_realsize(exString* str); void exs_reduce(exString* str, size_t by); void exs_appendtimes(exString* str, char c, int times); void exs_recalc(exString* str); void exs_reset(exString * str); #endif /* _EXSTRING_H */