aboutsummaryrefslogtreecommitdiffstats
path: root/stack.h
diff options
context:
space:
mode:
Diffstat (limited to 'stack.h')
-rw-r--r--stack.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/stack.h b/stack.h
new file mode 100644
index 0000000..14e557a
--- /dev/null
+++ b/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