Home | History | Annotate | Download | only in bintrees
      1 /*
      2  * stack.h
      3  *
      4  *  Author: mozman
      5  *  Copyright (c) 2010-2013 by Manfred Moitzi
      6  *  License: MIT-License
      7  */
      8 
      9 #ifndef STACK_H_
     10 #define STACK_H_
     11 
     12 #include "ctrees.h"
     13 
     14 typedef struct node_stack node_stack_t;
     15 struct node_stack {
     16   int stackptr;
     17   int size;
     18   node_t **stack;
     19 };
     20 
     21 node_stack_t *stack_init(int size);
     22 void stack_delete(node_stack_t *stack);
     23 void stack_push(node_stack_t *stack, node_t *node);
     24 node_t *stack_pop(node_stack_t *stack);
     25 int stack_is_empty(node_stack_t *stack);
     26 void stack_reset(node_stack_t *stack);
     27 
     28 #endif /* STACK_H_ */
     29