feat: engine finished (i think)

This commit is contained in:
mcolonna 2024-03-15 20:01:38 +01:00
parent 8076487071
commit 3abc6cbfd6
15 changed files with 207 additions and 41 deletions

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/30 15:36:49 by mcolonna #+# #+# */
/* Updated: 2024/02/23 14:17:46 by mcolonna ### ########.fr */
/* Updated: 2024/03/25 14:21:52 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -23,9 +23,10 @@
typedef struct s_buf
{
int size;
char str[BUFFER_SIZE];
} t_buf;
t_memclass mc;
int size;
char str[BUFFER_SIZE];
} t_buf;
typedef struct s_string2
{

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/30 15:39:50 by mcolonna #+# #+# */
/* Updated: 2024/02/23 14:16:55 by mcolonna ### ########.fr */
/* Updated: 2024/03/25 14:29:49 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -65,7 +65,7 @@ static void *free_and_return(
{
if (buf)
{
mem_free(*buf);
mem_freeall((*buf)->mc);
*buf = NULL;
}
if (string)

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/06 14:28:19 by mcolonna #+# #+# */
/* Updated: 2024/02/23 14:18:00 by mcolonna ### ########.fr */
/* Updated: 2024/03/25 14:53:04 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -15,12 +15,14 @@
int create_empty_buf(t_buf **result)
{
const t_errmc errmc = setget_errmc(NULL, NULL);
const t_errmc errmc = setget_errmc(NULL, NULL);
const t_memclass mc = mem_newclass(errmc.err);
*result = mem_alloc(errmc.err, errmc.mc, sizeof(t_buf));
*result = mem_alloc(errmc.err, mc, sizeof(t_buf));
if (!*result)
return (0);
(*result)->size = 0;
(*result)->mc = mc;
return (1);
}