stack.h 321 B

123456789101112131415161718192021222324
  1. #ifndef STACK_H
  2. #define STACK_H
  3. #include <stdlib.h>
  4. struct stack {
  5. char *s;
  6. int sp, siz;
  7. };
  8. struct stack *stack_new();
  9. int stack_isempty(struct stack *s);
  10. int stack_isfull(struct stack *s);
  11. int stack_peek(struct stack *s);
  12. void stack_push(struct stack *s, int item);
  13. int stack_pop(struct stack *s);
  14. #endif