aboutsummaryrefslogtreecommitdiff
path: root/src/position_stack.h
blob: 82c1975d6962d23a6f00f6367f395b691166f70a (plain)
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
#ifndef POSITION_STACK_H
#define POSITION_STACK_H

#define STACK_ERR_OVERFLOW 0xFFF01
#define STACK_ERR_UNDERFLOW 0xFFF02

struct Position
{
	int x;
	int y;
};

struct PositionStack
{
	int capacity;
	int top;
	struct Position *items;
};

struct PositionStack *create_pos_stack(int capacity);

void pos_stack_push(struct PositionStack *stack_pt, struct Position pos);

struct Position pos_stack_peek(struct PositionStack *stack_pt);

struct Position pos_stack_pop(struct PositionStack *stack_pt);

#endif