summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/misc.c b/misc.c
index c4ac72f..0de6c2a 100644
--- a/misc.c
+++ b/misc.c
@@ -41,6 +41,13 @@ void *stk_pop(stack s) {
return NULL;
}
+void *stk_top(stack s) {
+ if (s->sp > 0)
+ return s->data[s->sp-1];
+ else
+ return NULL;
+}
+
/*
* Small routines to amalgamate a string from an input source.
*/