/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* string_reserve.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: maiboyer +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/07/08 22:02:49 by maiboyer #+# #+# */ /* Updated: 2024/07/10 18:01:40 by maiboyer ### ########.fr */ /* */ /* ************************************************************************** */ #include "me/mem/mem.h" #include "me/string/string.h" #include "me/types.h" t_error string_reserve(t_string *self, t_usize capacity) { if (self == NULL) return (ERROR); if (self->capacity >= capacity) return (NO_ERROR); self->buf = mem_realloc(self->buf, capacity); return (NO_ERROR); }