Added more string utils and line stuff

This commit is contained in:
Maix0 2024-07-08 22:27:26 +02:00
parent 13ba83d6af
commit 6b5bc68de9
9 changed files with 229 additions and 151 deletions

View file

@ -0,0 +1,25 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* string_reserve.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/08 22:02:49 by maiboyer #+# #+# */
/* Updated: 2024/07/08 22:04:49 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);
}