/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* pointer stack routines
*/
#include <ast.h>
#include <stack.h>
/*
* create a new stack
*/
{
register struct stackblock *b;
{
return(0);
}
{
free(b);
return(0);
}
b->next = 0;
b->prev = 0;
return(stack);
}
/*
* remove a stack
*/
void
{
register struct stackblock* b;
register struct stackblock* p;
while (p = b)
{
b = p->next;
free(p);
}
}
/*
* clear stack
*/
void
{
}
/*
* get value on top of stack
*/
void*
{
}
/*
* push value on to stack
*/
int
{
register struct stackblock *b;
{
else
{
return(-1);
b = b->next;
return(-1);
b->next = 0;
}
}
return(0);
}
/*
* pop value off stack
*/
int
{
/*
* return:
*
* -1 if stack empty before pop
* 0 if stack empty after pop
* 1 if stack not empty before & after pop
*/
{
return(1);
}
else return(1);
}
/*
* set|get stack position
*/
void
{
}