pinosaur
/
smdp.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed duplicate function + added some comments to header files
[smdp.git]
/
cstack.c
diff --git
a/cstack.c
b/cstack.c
index
6474436
..
5331328
100644
(file)
--- a/
cstack.c
+++ b/
cstack.c
@@
-29,8
+29,10
@@
char cstack_pop(cstack_t *self) {
return self->content[self->head--];
}
return self->content[self->head--];
}
-char cstack_top(cstack_t *self) {
- return self->content[self->head];
+int cstack_top(cstack_t *self, char c) {
+ if(self->head >= 0 && self->content[self->head] == c)
+ return 1;
+ return 0;
}
int cstack_empty(cstack_t *self) {
}
int cstack_empty(cstack_t *self) {