diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-10-11 22:20:05 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-10-11 22:20:05 +0200 |
| commit | 3b27def26196cc96fe14fc8333d9e66189d6230f (patch) | |
| tree | 3b1c1d0e0d4a924cbd605ed99a339dbb3218c5c4 /graphs/piscine/evalexpr/src/stack.c | |
| parent | 73c2b00a10c5786ddeeacc915e233fd4df1c9321 (diff) | |
Diffstat (limited to 'graphs/piscine/evalexpr/src/stack.c')
| -rw-r--r-- | graphs/piscine/evalexpr/src/stack.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/graphs/piscine/evalexpr/src/stack.c b/graphs/piscine/evalexpr/src/stack.c deleted file mode 100644 index 14f659e..0000000 --- a/graphs/piscine/evalexpr/src/stack.c +++ /dev/null @@ -1,57 +0,0 @@ -#include "stack.h" - -#include <stdlib.h> - -struct stack *stack_push(struct stack *s, int e) -{ - struct stack *new = malloc(sizeof(struct stack)); - new->data = e; - new->next = NULL; - - new->next = s; - return new; -} - -struct stack *stack_pop(struct stack *s) -{ - if (s == NULL) - { - return NULL; - } - - struct stack *res = s->next; - free(s); - return res; -} - -int stack_peek(struct stack *s) -{ - return s->data; -} - -struct tstack *tstack_push(struct tstack *s, struct token *e) -{ - struct tstack *new = malloc(sizeof(struct tstack)); - new->token = e; - new->next = NULL; - - new->next = s; - return new; -} - -struct tstack *tstack_pop(struct tstack *s) -{ - if (s == NULL) - { - return NULL; - } - - struct tstack *res = s->next; - free(s); - return res; -} - -struct token *tstack_peek(struct tstack *s) -{ - return s->token; -} |
