summaryrefslogtreecommitdiffstats
path: root/stack.c
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2026-03-12 23:06:40 +0800
committerSadeep Madurange <sadeep@asciimx.com>2026-03-12 23:06:40 +0800
commitb200dd2a15365007b5ea64dff4df3e29273b2212 (patch)
tree1e5430f44c7de2378298945a42847f7a3ebfa8ec /stack.c
parentc76dfbea014f756d08bf8d1abed3daaed5f87809 (diff)
downloadcvn-b200dd2a15365007b5ea64dff4df3e29273b2212.tar.gz
Use diff for status.
Diffstat (limited to 'stack.c')
-rw-r--r--stack.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/stack.c b/stack.c
deleted file mode 100644
index 69ccb13..0000000
--- a/stack.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <err.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "mem.h"
-#include "stack.h"
-
-void stack_alloc(struct stack *st)
-{
- st->len = 0;
- st->cap = 512;
- st->items = MALLOC(sizeof(st->items[0]) * st->cap);
-}
-
-void *pop(struct stack *st)
-{
- return st->items[--(st->len)];
-}
-
-void push(struct stack *st, void *item)
-{
- if (st->len >= st->cap) {
- st->cap <<= 1;
- st->items = REALLOC(st->items, sizeof(st->items[0]) * st->cap);
- }
- st->items[st->len++] = item;
-}
-
-void stack_free(struct stack *st)
-{
- free(st->items);
-}