From 73c2b00a10c5786ddeeacc915e233fd4df1c9321 Mon Sep 17 00:00:00 2001 From: Martial Simon Date: Sat, 11 Oct 2025 22:19:00 +0200 Subject: fix: evalexpr & tinyprintf contenaient toute la piscine --- rushs/tinyprintf/dlist/dlist-1.c | 78 ---------------------------------------- 1 file changed, 78 deletions(-) delete mode 100644 rushs/tinyprintf/dlist/dlist-1.c (limited to 'rushs/tinyprintf/dlist/dlist-1.c') diff --git a/rushs/tinyprintf/dlist/dlist-1.c b/rushs/tinyprintf/dlist/dlist-1.c deleted file mode 100644 index 443ebca..0000000 --- a/rushs/tinyprintf/dlist/dlist-1.c +++ /dev/null @@ -1,78 +0,0 @@ -#include -#include - -#include "dlist.h" - -struct dlist *dlist_init(void) -{ - struct dlist *res = malloc(sizeof(struct dlist)); - if (res == NULL) - return NULL; - - res->size = 0; - res->head = NULL; - res->tail = NULL; - return res; -} - -int dlist_push_front(struct dlist *list, int element) -{ - if (element < 0) - return 0; - struct dlist_item *new = malloc(sizeof(struct dlist_item)); - if (new == NULL) - return 0; - - new->data = element; - new->next = list->head; - new->prev = NULL; - - if (list->size == 0) - list->tail = new; - else - list->head->prev = new; - - list->head = new; - list->size++; - - return 1; -} - -void dlist_print(const struct dlist *list) -{ - if (list->size == 0) - return; - - for (struct dlist_item *i = list->head; i != list->tail; i = i->next) - { - printf("%d\n", i->data); - } - printf("%d\n", list->tail->data); -} - -int dlist_push_back(struct dlist *list, int element) -{ - if (element < 0) - return 0; - struct dlist_item *new = malloc(sizeof(struct dlist_item)); - if (new == NULL) - return 0; - - new->data = element; - new->prev = list->tail; - new->next = NULL; - - if (list->size == 0) - list->head = new; - else - list->tail->next = new; - list->tail = new; - list->size++; - - return 1; -} - -size_t dlist_size(const struct dlist *list) -{ - return list->size; -} -- cgit v1.2.3