diff options
Diffstat (limited to 'src/position_stack.h')
-rw-r--r-- | src/position_stack.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/position_stack.h b/src/position_stack.h index 82c1975..83fb98c 100644 --- a/src/position_stack.h +++ b/src/position_stack.h @@ -4,25 +4,27 @@ #define STACK_ERR_OVERFLOW 0xFFF01 #define STACK_ERR_UNDERFLOW 0xFFF02 -struct Position +typedef struct Position { int x; int y; -}; +} Position; -struct PositionStack +typedef struct PositionStack { int capacity; int top; - struct Position *items; -}; + Position *items; +} PositionStack; -struct PositionStack *create_pos_stack(int capacity); +PositionStack *pos_stack_create(int capacity); -void pos_stack_push(struct PositionStack *stack_pt, struct Position pos); +void pos_stack_destroy(PositionStack *pos_stack); -struct Position pos_stack_peek(struct PositionStack *stack_pt); +void pos_stack_push(PositionStack *pos_stack, Position pos); -struct Position pos_stack_pop(struct PositionStack *stack_pt); +Position pos_stack_peek(PositionStack *pos_stack); + +Position pos_stack_pop(PositionStack *pos_stack); #endif |