Added more string utils and line stuff
This commit is contained in:
parent
13ba83d6af
commit
6b5bc68de9
9 changed files with 229 additions and 151 deletions
25
stdme/src/string/string_reserve.c
Normal file
25
stdme/src/string/string_reserve.c
Normal 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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue