blob: f5ad52b220790a7709fd988069200b87fccfec26 (
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);
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
|