2011-11-26 06:06:50 +00:00
|
|
|
#ifndef STACK_H__
|
|
|
|
#define STACK_H__
|
2011-09-01 04:26:30 +00:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2012-04-04 19:15:29 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2013-09-20 06:09:52 +00:00
|
|
|
struct hoedown_stack {
|
2011-09-01 04:26:30 +00:00
|
|
|
void **item;
|
|
|
|
size_t size;
|
|
|
|
size_t asize;
|
|
|
|
};
|
|
|
|
|
2013-09-20 06:09:52 +00:00
|
|
|
void hoedown_stack_free(struct hoedown_stack *);
|
|
|
|
int hoedown_stack_grow(struct hoedown_stack *, size_t);
|
|
|
|
int hoedown_stack_init(struct hoedown_stack *, size_t);
|
2011-09-01 04:26:30 +00:00
|
|
|
|
2013-09-20 06:09:52 +00:00
|
|
|
int hoedown_stack_push(struct hoedown_stack *, void *);
|
2011-09-01 04:26:30 +00:00
|
|
|
|
2013-09-20 06:09:52 +00:00
|
|
|
void *hoedown_stack_pop(struct hoedown_stack *);
|
|
|
|
void *hoedown_stack_top(struct hoedown_stack *);
|
2011-09-01 04:26:30 +00:00
|
|
|
|
2012-04-04 19:15:29 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-09-01 04:26:30 +00:00
|
|
|
#endif
|