#include #include #include "mbtstr/str.h" bool mbt_str_ctor(struct mbt_str *str, size_t capacity) { str->size = 0; str->capacity = capacity; if (str->capacity == 0) { str->data = NULL; return true; } str->data = calloc(capacity + 1, 1); if (str->data == NULL) return false; return true; }