blob: 16725f82d1e3dced7f5f470687bf4e11c3ea4292 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// MIT License, Copyright (c) 2020 Marvin Borner
#ifndef STACK_H
#define STACK_H
#include <def.h>
struct stack_node {
void *data;
int nonce;
struct stack_node *next;
struct stack_node *prev;
};
struct stack {
struct stack_node *tail;
};
struct stack *stack_new();
void stack_destroy(struct stack *stack);
u32 stack_empty(struct stack *stack);
u32 stack_push_bot(struct stack *stack, void *data);
u32 stack_push(struct stack *stack, void *data);
void *stack_pop(struct stack *stack);
void *stack_peek(struct stack *stack);
void stack_clear(struct stack *stack);
#endif
|