blob: 54d19186b3c6e35ad6d3c174f6f1a0ba1ff1640a (
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) NONNULL;
u32 stack_empty(struct stack *stack) NONNULL;
u32 stack_push_bot(struct stack *stack, void *data) NONNULL;
u32 stack_push(struct stack *stack, void *data) NONNULL;
void *stack_pop(struct stack *stack) NONNULL;
void *stack_peek(struct stack *stack) NONNULL;
void stack_clear(struct stack *stack) NONNULL;
#endif
|