aboutsummaryrefslogtreecommitdiffstats
path: root/stack.h
diff options
context:
space:
mode:
authordan <[email protected]>2023-05-25 11:00:58 -0400
committerdan <[email protected]>2023-05-25 11:00:58 -0400
commit40e23d550506659f7a33057bbbc23cb1cf0632f1 (patch)
treec7c7a53e78f7186b352c9e6a43113d6679257231 /stack.h
parent7463bbc06285690b5b644362d115aa9e82ac6cb4 (diff)
downloadforth-40e23d550506659f7a33057bbbc23cb1cf0632f1.tar.gz
forth-40e23d550506659f7a33057bbbc23cb1cf0632f1.tar.bz2
forth-40e23d550506659f7a33057bbbc23cb1cf0632f1.zip
refactor: split optable and stack into sep files
Diffstat (limited to 'stack.h')
-rw-r--r--stack.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/stack.h b/stack.h
new file mode 100644
index 0000000..16fe07b
--- /dev/null
+++ b/stack.h
@@ -0,0 +1,24 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+#ifndef STACK_H
+#define STACK_H
+
+typedef int stackitem;
+
+typedef struct {
+ int size;
+ int maxsize;
+ stackitem* start;
+} stack;
+
+
+stack* newstack();
+
+stackitem pop(stack* s);
+
+stackitem peek(stack* s);
+
+void push(stack *s, stackitem si);
+
+#endif