generic_stack.h File Reference

#include "vm_types.h"

Go to the source code of this file.

Defines

#define gpop(__t, __s)   ((__t)_gpop(__s))
 Pop a token from the stack. (typecast swallowing version).
#define gpeek(__t, __s, __i)   ((__t)_gpeek(__s,__i))
 Peek the __i -th token from the stack. (typecast swallowing version).
#define gstack_is_empty(_s)   (_s->sp==((word_t)-1))
 Predicate.
#define gstack_is_not_empty(_s)   (_s->sp!=((word_t)-1))
 Predicate.

Functions

generic_stack_t new_gstack (word_t token_size)
 Create a new stack.
void gstack_init (generic_stack_t, word_t token_size)
 Init a newly allocated buffer.
void gstack_deinit (generic_stack_t, void(*callback)(void *))
 Deinit a stack, calling callback on each token the stack contains.
void gpush (generic_stack_t s, void *w)
 Push the token pointed to by w onto the stack.
void * _gpop (generic_stack_t s)
 Pop a token from the stack.
void * _gpeek (generic_stack_t s, int)
 Peek the i-th token from the stack. (0 is top).
void free_gstack (generic_stack_t s)
 Free a stack.
word_t gstack_size (generic_stack_t s)
 Get the current size of the stack.
void gstack_grow (generic_stack_t s, word_t count)
 Reserve count words on stack.
void gstack_shrink (generic_stack_t s, word_t count)
 Undo a previous reservation.


Generated on Wed Feb 6 14:46:05 2008 for TinyaML by  doxygen 1.5.3