-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack.h
More file actions
38 lines (27 loc) · 687 Bytes
/
Copy pathstack.h
File metadata and controls
38 lines (27 loc) · 687 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
/**
* Projekt IFJ/IAL 2019 - Překladač imperativního jazyka IFJ19
*
* @file stack.h
*
* @author Zdeněk Kroča (xkroca02)
*/
#ifndef IFJ_STACK_H
#define IFJ_STACK_H
#include <stdio.h>
#include "error_code.h"
#define MAX_STACK 100
int STACK_SIZE;
typedef struct {
char arr[MAX_STACK]; // array for storing elements
int top; // index of the element on top
} tStack;
// stack functions
void stackError(int error_code);
ERROR_CODE stackInit(tStack* s);
int stackEmpty(const tStack* s);
int stackFull(const tStack* s);
void stackTop(const tStack* s, char* c);
void stackPop(tStack* s);
ERROR_CODE stackPush(tStack* s, char c);
void stackClear(tStack* s);
#endif