summaryrefslogtreecommitdiff
path: root/lib/stack.h
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-02-02 18:33:22 -0500
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-02-02 18:33:22 -0500
commit2af9351db3aa97da9b0d3f23d53a593bc96c8a8e (patch)
tree684dfccba8d295c42ef6e2e070c8d6caca45f590 /lib/stack.h
parent181db84a8ffb26e436a43bb268fe5ef060206e66 (diff)
downloadc++-2af9351db3aa97da9b0d3f23d53a593bc96c8a8e.tar.gz
c++-2af9351db3aa97da9b0d3f23d53a593bc96c8a8e.tar.bz2
c++-2af9351db3aa97da9b0d3f23d53a593bc96c8a8e.zip
does potts now, no external libraries
Diffstat (limited to 'lib/stack.h')
-rw-r--r--lib/stack.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/stack.h b/lib/stack.h
new file mode 100644
index 0000000..a354ab5
--- /dev/null
+++ b/lib/stack.h
@@ -0,0 +1,26 @@
+
+#pragma once
+
+#include <inttypes.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "types.h"
+
+typedef struct ll_tag {
+ v_t x;
+ struct ll_tag *next;
+} ll_t;
+
+typedef struct dll_tag {
+ double x;
+ struct dll_tag *next;
+} dll_t;
+
+void stack_push(ll_t **q, v_t x);
+void stack_push_d(dll_t **q, double x);
+
+v_t stack_pop(ll_t **q);
+double stack_pop_d(dll_t **q);
+