source: trunk/stack.h @ 307

Last change on this file since 307 was 307, checked in by moo, 8 years ago

stack interface changes

File size: 429 bytes
Line 
1
2typedef struct {
3    void **data;
4    int cnt;
5    int size;
6} xc_stack_t;
7
8#define S xc_stack_t*
9void xc_stack_init_ex(S stack, int initsize);
10#define xc_stack_init(stack) xc_stack_init_ex(stack, 8)
11void xc_stack_destroy(S stack);
12void xc_stack_push(S stack, void *item);
13void *xc_stack_pop(S stack);
14void *xc_stack_top(S stack);
15void *xc_stack_get(S stack, int n);
16int xc_stack_count(S stack);
17void xc_stack_reverse(S stack);
18#undef S
Note: See TracBrowser for help on using the repository browser.