-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdynamic_stack.h
More file actions
38 lines (28 loc) · 762 Bytes
/
Copy pathdynamic_stack.h
File metadata and controls
38 lines (28 loc) · 762 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
28
29
30
31
32
33
34
35
36
37
#ifndef _DYNAMIC_STACK_H
#define _DYNAMIC_STACK_H
#include <sys/types.h>
#include <stdbool.h>
#include "ial.h"
typedef struct
{
int type;
data_t* symbol;
} expr_t;
typedef expr_t obj_t;
extern const size_t INIT_SIZE;
typedef struct {
obj_t *elem;
long int top;
size_t size;
} dstack_t;
dstack_t dstack_ctor(void);
dstack_t dstack_clear(dstack_t *const);
bool dstack_empty(const dstack_t *const );
obj_t *dstack_top(const dstack_t *const);
void dstack_pop(dstack_t *const);
void dstack_push(dstack_t *const, obj_t);
dstack_t dstack_dtor(dstack_t *const);
bool dstack_replace(dstack_t *const, long, obj_t *, long);
long dstack_elem_count(const dstack_t *const stack);
bool dstack_add_handle_symbol(dstack_t *, unsigned );
#endif