2017-12-08 20:00:49 +03:00
|
|
|
/*
|
|
|
|
author: Christian Bender
|
|
|
|
|
|
|
|
This header represents the public stack-interface.
|
2020-05-29 23:23:24 +03:00
|
|
|
The stack is generic and self growing.
|
2017-12-08 20:00:49 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __STACK__
|
|
|
|
#define __STACK__
|
|
|
|
|
|
|
|
/*
|
|
|
|
initStack: initializes the stack with a capacity of 10 elements.
|
|
|
|
*/
|
|
|
|
void initStack();
|
|
|
|
|
|
|
|
/*
|
2020-05-29 23:23:24 +03:00
|
|
|
push: pushs the argument onto the stack
|
2017-12-08 20:00:49 +03:00
|
|
|
*/
|
2020-05-29 23:23:24 +03:00
|
|
|
void push(void *object);
|
2017-12-08 20:00:49 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
pop: pops the top element of the stack from the stack.
|
|
|
|
assumes: stack not empty.
|
|
|
|
*/
|
2020-05-29 23:23:24 +03:00
|
|
|
void *pop();
|
2017-12-08 20:00:49 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
size: gets the number of elements of the stack.
|
|
|
|
*/
|
|
|
|
int size();
|
|
|
|
|
|
|
|
/*
|
|
|
|
isEmpty(): returns 1 if stack is empty otherwise 0.
|
|
|
|
*/
|
|
|
|
int isEmpty();
|
|
|
|
|
|
|
|
/*
|
|
|
|
top: returns the top element from the stack without removing it.
|
|
|
|
*/
|
2020-05-29 23:23:24 +03:00
|
|
|
void *top();
|
2017-12-08 20:00:49 +03:00
|
|
|
|
|
|
|
#endif
|