style: noming ast_function2.c
This commit is contained in:
parent
b8cc83a5c0
commit
70519085be
1 changed files with 18 additions and 21 deletions
|
|
@ -1,12 +1,12 @@
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
/* ::: :::::::: */
|
/* ::: :::::::: */
|
||||||
/* vec_ast.c :+: :+: :+: */
|
/* ast_functions2.c :+: :+: :+: */
|
||||||
/* +:+ +:+ +:+ */
|
/* +:+ +:+ +:+ */
|
||||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/12/30 17:59:28 by maiboyer #+# #+# */
|
/* Created: 2023/12/30 17:59:28 by maiboyer #+# #+# */
|
||||||
/* Updated: 2023/12/30 17:59:28 by maiboyer ### ########.fr */
|
/* Updated: 2024/09/19 15:32:36 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -17,10 +17,10 @@
|
||||||
#include "me/vec/vec_ast.h"
|
#include "me/vec/vec_ast.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
t_error vec_ast_find(t_vec_ast *vec,
|
t_error vec_ast_find(t_vec_ast *vec, bool (*fn)(\
|
||||||
bool (*fn)(const t_ast_node *), t_usize *index)
|
const t_ast_node *), t_usize *index)
|
||||||
{
|
{
|
||||||
t_usize idx;
|
t_usize idx;
|
||||||
|
|
||||||
if (vec == NULL || fn == NULL || index == NULL)
|
if (vec == NULL || fn == NULL || index == NULL)
|
||||||
return (ERROR);
|
return (ERROR);
|
||||||
|
|
@ -37,11 +37,10 @@ t_error vec_ast_find(t_vec_ast *vec,
|
||||||
return (ERROR);
|
return (ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
t_error vec_ast_find_starting(t_vec_ast *vec,
|
t_error vec_ast_find_starting(t_vec_ast *vec, bool (*fn)(\
|
||||||
bool (*fn)(const t_ast_node *),
|
const t_ast_node *), t_usize starting_index, t_usize *index)
|
||||||
t_usize starting_index, t_usize *index)
|
|
||||||
{
|
{
|
||||||
t_usize idx;
|
t_usize idx;
|
||||||
|
|
||||||
if (vec == NULL || fn == NULL || index == NULL)
|
if (vec == NULL || fn == NULL || index == NULL)
|
||||||
return (ERROR);
|
return (ERROR);
|
||||||
|
|
@ -58,10 +57,10 @@ t_error vec_ast_find_starting(t_vec_ast *vec,
|
||||||
return (ERROR);
|
return (ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
t_error vec_ast_all(t_vec_ast *vec,
|
t_error vec_ast_all(t_vec_ast *vec, bool (*fn)(\
|
||||||
bool (*fn)(const t_ast_node *), bool *result)
|
const t_ast_node *), bool *result)
|
||||||
{
|
{
|
||||||
t_usize idx;
|
t_usize idx;
|
||||||
|
|
||||||
if (vec == NULL || fn == NULL || result == NULL)
|
if (vec == NULL || fn == NULL || result == NULL)
|
||||||
return (ERROR);
|
return (ERROR);
|
||||||
|
|
@ -76,10 +75,10 @@ t_error vec_ast_all(t_vec_ast *vec,
|
||||||
return (ERROR);
|
return (ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
t_error vec_ast_any(t_vec_ast *vec,
|
t_error vec_ast_any(t_vec_ast *vec, bool (*fn)(\
|
||||||
bool (*fn)(const t_ast_node *), bool *result)
|
const t_ast_node *), bool *result)
|
||||||
{
|
{
|
||||||
t_usize idx;
|
t_usize idx;
|
||||||
|
|
||||||
if (vec == NULL || fn == NULL || result == NULL)
|
if (vec == NULL || fn == NULL || result == NULL)
|
||||||
return (ERROR);
|
return (ERROR);
|
||||||
|
|
@ -94,15 +93,13 @@ t_error vec_ast_any(t_vec_ast *vec,
|
||||||
return (ERROR);
|
return (ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void vec_ast_iter(t_vec_ast *vec,
|
void vec_ast_iter(t_vec_ast *vec, void (*fn)(\
|
||||||
void (*fn)(t_usize index, t_ast_node *value,
|
t_usize index, t_ast_node *value, void *state), void *state)
|
||||||
void *state),
|
|
||||||
void *state)
|
|
||||||
{
|
{
|
||||||
t_usize idx;
|
t_usize idx;
|
||||||
|
|
||||||
if (vec == NULL || fn == NULL)
|
if (vec == NULL || fn == NULL)
|
||||||
return;
|
return ;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
while (idx < vec->len)
|
while (idx < vec->len)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue