summaryrefslogtreecommitdiff
path: root/kernel/lib/stack.h
blob: 09fff66de1046bbf077317261cc0bd11a4f4c581 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef STACK_H
#define STACK_H
#include <stdint.h>

struct entry {
  void *ptr;
  // TODO: Maybe don't use a linkedlist
  struct entry *next;
};

struct stack {
  struct entry *head;
};

void stack_init(struct stack *s);
int stack_isempty(const struct stack *s);
int stack_push(struct stack *s, void *data);
void *stack_pop(struct stack *s);
#endif