summaryrefslogtreecommitdiff
path: root/src/02/05/stack.h
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-08-09 15:47:03 -0600
committermo khan <mo.khan@gmail.com>2020-08-09 15:47:03 -0600
commit7c4da6d24d54a971a4e918c3a327e052f4685ccb (patch)
treebf2e8cca2a93c0605a54c5218caea446e9c0833c /src/02/05/stack.h
parentce1f797f4af5aee2574a021fd24c0c7405870f45 (diff)
Allow storing void* on Stack
Diffstat (limited to 'src/02/05/stack.h')
-rw-r--r--src/02/05/stack.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/02/05/stack.h b/src/02/05/stack.h
index a3f424e..0ac9ee8 100644
--- a/src/02/05/stack.h
+++ b/src/02/05/stack.h
@@ -1,6 +1,6 @@
typedef struct node {
struct node *next;
- int data;
+ void *data;
} Node;
typedef struct {
@@ -8,7 +8,7 @@ typedef struct {
} Stack;
Stack *stack_init();
-int stack_peek(Stack *self);
+void *stack_peek(Stack *self);
int stack_size(Stack *self);
-void stack_push(Stack *self, int data);
-int stack_pop(Stack *self);
+void stack_push(Stack *self, void *data);
+void *stack_pop(Stack *self);