mirror of
https://github.com/theoludwig/libcproject.git
synced 2024-11-09 22:08:40 +01:00
25 lines
370 B
C
25 lines
370 B
C
#ifndef __STACK__
|
|
#define __STACK__
|
|
|
|
#include <stdio.h>
|
|
#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
|