aboutsummaryrefslogtreecommitdiff
path: root/stack.h
diff options
context:
space:
mode:
Diffstat (limited to 'stack.h')
-rw-r--r--stack.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/stack.h b/stack.h
index 2105c7c..4fd7747 100644
--- a/stack.h
+++ b/stack.h
@@ -10,12 +10,13 @@
struct PositionStack_s {
Position *arr; /* The array with all the values */
size_t capacity;
- size_t top; /* Shows where the top of the stack is */
+ size_t top; /* Shows where the top of the stack is.
+ * Points to the empty spot after the last element */
};
typedef struct PositionStack_s PositionStack;
PositionStack ps_new(void); /* Returns an empty position stack */
-int ps_push(PositionStack *ps, Position pos); /* Returns -1 if failed to realloc() */
+void ps_push(PositionStack *ps, Position pos); /* Returns -1 if failed to realloc() */
Position ps_pop(PositionStack *ps);
Position ps_peek(PositionStack ps);
void ps_free(PositionStack ps);