aboutsummaryrefslogtreecommitdiffstats
path: root/src/misc/stack.h
diff options
context:
space:
mode:
authorGalin Simeonov <gts@volconst.com>2021-05-31 22:02:10 +0300
committerGalin Simeonov <gts@volconst.com>2021-07-15 18:00:15 +0300
commit255a49ba5a41b3854dbdfebdec75fb6229450507 (patch)
tree616ea5786cb91d03ef609d32b402941dc30e926b /src/misc/stack.h
parentf768d9bdb84e846d89aac66a4f3433a44241c298 (diff)
downloadMEGATRON-255a49ba5a41b3854dbdfebdec75fb6229450507.tar.gz
added cmake file
Diffstat (limited to 'src/misc/stack.h')
-rw-r--r--src/misc/stack.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/misc/stack.h b/src/misc/stack.h
new file mode 100644
index 0000000..14e557a
--- /dev/null
+++ b/src/misc/stack.h
@@ -0,0 +1,22 @@
+#ifndef GSTACK_H
+#define GSTACK_H GSTACK_H
+#include<stdlib.h>
+typedef struct Stack Stack;
+
+struct Stack_Node
+{
+ struct Stack_Node *next;
+ void *data;
+};
+struct Stack
+{
+ struct Stack_Node *first;
+ size_t size;
+};
+
+void Stack_Init(Stack *stack);
+void Stack_Push(Stack *stack,void* data);
+void* Stack_Pop(Stack *stack);
+
+
+#endif