istack.c

tmi2_fluffos_v2/lib/std/adt/istack.c · 592 B

From the archive tmi2_fluffos_v2.zip

Download the archive   « Back to the archive contents

/* 
 stackobj.c: LPC Stack ADT - uses the list ADT

 author: Truilkan - 05/26/91

 Description:

    provides the following methods:

    push(obj), pop(), empty(), top()
*/

#include <adt_defs.h>

object list;

empty()
{
	return list->empty();
}

top()
{
	return list->value(list->first());
}

pop()
{
	return list->delete(list->first());
}

push(obj)
{
	return list->insert(obj);
}

reset(arg)
{
	if (!arg) {
		list = clone_object(LISTOBJFILE);
		return;
	}
}

id(str)
{
	return str == short();
}

short()
{
	return "stack_object";
}

long()
{
	list->long(short());
}

get()
{
	return 1;
}

Site Stats

Snippets: 1791
Codebases: 571