2010-04-04 00:44:59 +00:00
|
|
|
#ifndef STACK_H
|
|
|
|
#define STACK_H
|
|
|
|
|
2010-04-05 00:54:22 +00:00
|
|
|
#include "card.h"
|
|
|
|
|
2010-04-04 00:44:59 +00:00
|
|
|
struct stack {
|
|
|
|
struct card *card;
|
|
|
|
struct stack *next;
|
|
|
|
};
|
|
|
|
|
2010-04-05 07:33:10 +00:00
|
|
|
void allocate_stack(struct stack **);
|
|
|
|
void initialize_stack(struct stack *);
|
2011-05-01 06:06:43 +00:00
|
|
|
struct stack *duplicate_stack(struct stack *);
|
2011-02-14 02:10:47 +00:00
|
|
|
void free_stack(struct stack *);
|
2010-04-04 01:12:42 +00:00
|
|
|
bool empty(struct stack *);
|
|
|
|
int length(struct stack *);
|
2010-04-04 06:20:56 +00:00
|
|
|
void push(struct stack **, struct card *);
|
2010-04-04 07:15:43 +00:00
|
|
|
struct stack *pop(struct stack **);
|
2011-05-01 04:13:15 +00:00
|
|
|
struct stack *reverse(struct stack *);
|
2010-04-04 01:12:42 +00:00
|
|
|
|
2010-04-04 00:44:59 +00:00
|
|
|
#endif
|