diff options
Diffstat (limited to 'src/lexer/tok_lst.c')
| -rw-r--r-- | src/lexer/tok_lst.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/lexer/tok_lst.c b/src/lexer/tok_lst.c index 9ae0ce1..89ab120 100644 --- a/src/lexer/tok_lst.c +++ b/src/lexer/tok_lst.c @@ -6,7 +6,7 @@ /* By: charles <me@cacharle.xyz> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/08/27 09:32:58 by charles #+# #+# */ -/* Updated: 2020/10/08 17:38:59 by cacharle ### ########.fr */ +/* Updated: 2020/10/09 15:14:38 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,7 +14,8 @@ t_tok_lst *tok_lst_new(enum e_tok tag, char *content) { - return (tok_lst_new_until(tag, content, content == NULL ? 0 : ft_strlen(content))); + return (tok_lst_new_until( + tag, content, content == NULL ? 0 : ft_strlen(content))); } /* @@ -25,14 +26,15 @@ t_tok_lst *tok_lst_new(enum e_tok tag, char *content) ** \return An allocated tok_lst or NULL on error */ -t_tok_lst *tok_lst_new_until(enum e_tok tag, char *content, size_t n) +t_tok_lst *tok_lst_new_until( + enum e_tok tag, char *content, size_t n) { t_tok_lst *ret; if ((ret = malloc(sizeof(t_tok_lst))) == NULL) return (NULL); if (content == NULL) - ret->content = NULL; + ret->content = NULL; else if ((ret->content = ft_strndup(content, n)) == NULL) { free(ret); @@ -48,7 +50,8 @@ void tok_lst_push_back(t_tok_lst **tokens, t_tok_lst *pushed) ft_lstpush_back((t_ftlst**)tokens, (t_ftlst*)pushed); } -t_tok_lst *tok_lst_push_front(t_tok_lst **tokens, t_tok_lst *pushed) +t_tok_lst *tok_lst_push_front( + t_tok_lst **tokens, t_tok_lst *pushed) { if (pushed == NULL) return (NULL); @@ -56,7 +59,8 @@ t_tok_lst *tok_lst_push_front(t_tok_lst **tokens, t_tok_lst *pushed) return (*tokens); } -void tok_lst_pop_front(t_tok_lst **tokens, void (*del)(void*)) +void tok_lst_pop_front( + t_tok_lst **tokens, void (*del)(void*)) { ft_lstpop_front((t_ftlst**)tokens, del); } |
