view include/stack.h @ 96:a480d02a10c8

merge
author Jonathan Pevarnek <pevarnj@gmail.com>
date Sat, 14 May 2011 12:54:47 -0400
parents c1ad124f2aaf
children
line wrap: on
line source

#ifndef __STACK_H
#define __STACK_H

typedef double eltType;

struct STACKELT {
	eltType elt;
	struct STACKELT *next;
};
typedef struct STACKELT StackElt;

struct STACK {
	StackElt* top;
	unsigned int size;
};
typedef struct STACK Stack;

short pop(Stack *stack, eltType *value);
//pop returns 0 on success and -1 on failure.  If the function call is
//successful, *value will be the value removed from the stack
void push(Stack *stack, eltType val);
Stack* stack_init();
void stack_destroy(Stack *stack);

#endif //__STACK_H