aboutsummaryrefslogtreecommitdiff
path: root/src/position_stack.h
blob: 674da23d2c5674fee46f8c2bdb5366fc1a75dba4 (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
#ifndef POSITION_STACK_H
#define POSITION_STACK_H

#include "position.h"

#define STACK_ERR_OVERFLOW 0xFFF01
#define STACK_ERR_UNDERFLOW 0xFFF02

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

PositionStack *pos_stack_create(unsigned int capacity);

void pos_stack_destroy(PositionStack *pos_stack);

void pos_stack_push(PositionStack *pos_stack, Position pos);

Position pos_stack_peek(PositionStack *pos_stack);

Position pos_stack_pop(PositionStack *pos_stack);

#endif