1
1
mirror of https://github.com/theoludwig/libcproject.git synced 2024-11-14 16:03:13 +01:00
libcproject/lib/stack.h

24 lines
351 B
C
Raw Permalink Normal View History

2023-01-05 19:28:05 +01:00
#ifndef __STACK__
#define __STACK__
#include <stdlib.h>
// LIFO = Last In First Out
struct stack {
struct stack_node *first;
size_t length;
};
struct stack_node {
void *data;
struct stack_node *next;
};
struct stack *stack_initialization();
void stack_push(struct stack *stack, void *data);
void *stack_pop(struct stack *stack);
#endif