forked from wenjun1055/c
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack.h
More file actions
27 lines (23 loc) · 934 Bytes
/
Copy pathstack.h
File metadata and controls
27 lines (23 loc) · 934 Bytes
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
27
#include <stdio.h>
#include <stdlib.h>
typedef struct _stack {
int top;
int max;
void **elements;
} stack_base;
#define SUCCESS 0
#define FAILURE -1
#define STACK_BLOCK_SIZE 64
#define ZEND_STACK_APPLY_TOPDOWN 1
#define ZEND_STACK_APPLY_BOTTOMUP 2
int stack_init(stack_base *stack);
int stack_push(stack_base *stack, const void *element, int size);
int stack_top(const stack_base *stack, void **element);
int stack_del_top(stack_base *stack);
int stack_int_top(const stack_base *stack);
int stack_is_empty(const stack_base *stack);
int stack_destroy(stack_base *stack);
void **stack_base(const stack_base *stack);
int stack_count(const stack_base *stack);
void stack_apply(stack_base *stack, int type, int (*apply_function)(void *element));
void stack_apply_with_argument(stack_base *stack, int type, int (*apply_function)(void *element, void *arg), void *arg);