/* * stack.h * Copyright (C) Achille Braquelaire (achille@labri.fr). * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __STACK_H__ #define __STACK_H__ /* from Braquelaire */ typedef struct stack* stack; /* create the object stack */ stack stackCreate (long length); /* free the memory allocated to the object 'stack' */ void stackFree (stack s); /* stack up a value */ void stackPush (stack s, void* val); /* remove the last element */ void* stackPop (stack s); /* returns 1 if the stack is empty and 0 otherwise */ int stackEmpty (stack s); /* return the last element of the stack without removing it */ void* stackTop (stack s); #endif /* __STACK_H__ */