-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstack.h
More file actions
45 lines (30 loc) · 683 Bytes
/
stack.h
File metadata and controls
45 lines (30 loc) · 683 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
38
39
40
41
42
43
44
45
//
// stack.h
// RegexCompiler
//
// Created by 臻华的Macbook pro on 2018/11/18.
// Copyright © 2018 臻华的Macbook pro. All rights reserved.
//
#ifndef stack_h
#define stack_h
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#define STACK_INIT_SIZE 20
#define STACK_INCREMENT 20
typedef struct Stack Stack;
struct Stack {
const void **top;
const void **base;
int size;
};
Stack *InitStack(void);
void Push(Stack *s, const void *ele);
void *Pop(Stack *s);
void *GetTop(const Stack *s);
void StackError(void);
void StackEmpty(void);
void FreeStack(Stack *s);
size_t Stack_Size(Stack *s);
bool EmptyStack(Stack *s);
#endif /* stack_h */