 
#ifndef list_DEFINED
#define list_DEFINED 1
 
#ifndef class_DEFINED
#include <class.h>
#endif /* class_DEFINED */
/* 
 * This file was generated by the Andrew class system preprocessor.
 * Don't make changes to this file as it is created from list.ch and will be
 * overwritten.  Make changes to list.ch instead.
 */ 
 
#ifndef class_StaticInfoOnly
/* 
 * The following information was copied, as-is, from list.ch.
 */ 
 
/* ********************************************************************** *\
 *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
 *        For full copyright information see:'andrew/config/COPYRITE'     *
\* ********************************************************************** */

/*
	$Disclaimer: 
*Permission to use, copy, modify, and distribute this software and its 
*documentation for any purpose is hereby granted without fee, 
*provided that the above copyright notice appear in all copies and that 
*both that copyright notice, this permission notice, and the following 
*disclaimer appear in supporting documentation, and that the names of 
*IBM, Carnegie Mellon University, and other copyright holders, not be 
*used in advertising or publicity pertaining to distribution of the software 
*without specific, written prior permission.
*
*IBM, CARNEGIE MELLON UNIVERSITY, AND THE OTHER COPYRIGHT HOLDERS 
*DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 
*ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT 
*SHALL IBM, CARNEGIE MELLON UNIVERSITY, OR ANY OTHER COPYRIGHT HOLDER 
*BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 
*DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
*WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 
*ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
*OF THIS SOFTWARE.
* $
*/

/* $ACIS$ */

 

/*
 * Generic Linked List / Stack / Queue datatype
 *
 * Although char *'s are used here, pointers to any type of object
 * or structure may be used with minimal casting.
 */

struct list_Entry {
    struct list_Entry *next;
    char *data;
};






/* 
 * End of information copied from list.ch.
 */ 
 
#endif /* class_StaticInfoOnly *//* 
 * Include the superclass information
 */ 
/* list has no super class */ 
 
 
#ifndef class_StaticInfoOnly
/* 
 * Data structure for list 
 */ 
struct list { 
    struct {
	struct basicobject_methods *list_methods;
    } header;
    struct list_Entry *head;
    struct list_Entry *tail;
    long size;

    struct list_Entry *trav;

};

 
/* 
 * End of data structure for list.
 */ 
 

#endif /* class_StaticInfoOnly */

#ifndef class_StaticInfoOnly

#ifndef list_PROGRAMMERVERSION
#define list_PROGRAMMERVERSION 1
#endif /* list_PROGRAMMERVERSION */

#ifdef list_VERSION
#undef list_VERSION
#endif /* list_VERSION */
#define list_VERSION ((((list_PROGRAMMERVERSION << 16) ^ (10 << 8) ^ sizeof(struct list)) & 0x7ffff) + 0x80000 + (1 << 20))


#endif /* class_StaticInfoOnly */
#define list_StaticLoadOnlyThisClass()  \
{ extern struct classinfo *list__GetClassInfo(); \
 extern struct classheader *list_classheader_StaticExport; \
  (void) class_EnterInfo(NULL, list_classheader_StaticExport->name, list__GetClassInfo, NULL, list_classheader_StaticExport->namekey); } 
 
#define list_StaticLoad()  \
    { \
    list_StaticLoadOnlyThisClass();  \
    } 
 
#define list_StaticEntry  {list_StaticLoad()} 
 
#ifndef class_StaticInfoOnly
static struct classheader list_classheader = {
    list_VERSION,
    "list",
    "list",
    (struct basicobject_methods *) &class_RoutineStruct,
};

#define list_CLASSPROCEDURES (list_classheader.classprocedures)
int list_classref_;
#endif /* class_StaticInfoOnly */

#endif /* list_DEFINED */

#if !defined(list_ROUTINESDEFINED) && !defined(dontDefineRoutinesFor_list) && !defined(class_StaticEntriesOnly)
#define list_ROUTINESDEFINED

#define list_InsertFront(self,data) \
    ((* ((void (*)())((self)->header.list_methods->routines[0]))) (self,data))
#define list_InsertEnd(self,data) \
    ((* ((void (*)())((self)->header.list_methods->routines[1]))) (self,data))
#define list_InsertUnique(self,data) \
    ((* ((boolean (*)())((self)->header.list_methods->routines[2]))) (self,data))
#define list_InsertSorted(self,data,compare) \
    ((* ((void (*)())((self)->header.list_methods->routines[3]))) (self,data,compare))
#define list_RemoveFront(self) \
    ((* ((char * (*)())((self)->header.list_methods->routines[4]))) (self))
#define list_Delete(self,data) \
    ((* ((boolean (*)())((self)->header.list_methods->routines[5]))) (self,data))
#define list_Member(self,data) \
    ((* ((boolean (*)())((self)->header.list_methods->routines[6]))) (self,data))
#define list_Sort(self,greater) \
    ((* ((boolean (*)())((self)->header.list_methods->routines[7]))) (self,greater))
#define list_Enumerate(self,proc,rock) \
    ((* ((char * (*)())((self)->header.list_methods->routines[8]))) (self,proc,rock))
#define list_Clear(self) \
    ((* ((void (*)())((self)->header.list_methods->routines[9]))) (self))
#define list_Enqueue(self,data) \
 (list_InsertEnd((self), data))
#define list_Dequeue(self) \
 (list_RemoveFront((self)))
#define list_Push(self,data) \
 (list_InsertFront((self), data))
#define list_Pop(self) \
 (list_RemoveFront((self)))
#define list_Size(self) \
 (((self))->size)
#define list_First(self) \
 (((self))->size == 0 ? NULL : ((self))->head->data)
#define list_Last(self) \
 (((self))->size == 0 ? NULL : ((self))->tail->data)
#define list_Start(self) \
 (((self))->trav = ((self))->head)
#define list_Advance(self) \
 (((self))->trav == NULL ? NULL :               (((self))->trav = ((self))->trav->next))
#define list_Data(self) \
 (((self))->trav == NULL ? NULL :               ((self))->trav->data)

#define list_NewFromObject(self) \
    ((* ((struct list * (*)())((self)->header.list_methods->info->procs->routines[0]))) (&list_classheader, (self)->header.list_methods->info->versionnumber))
#define list_New() \
    (*((struct list * (*)()) (list_CLASSPROCEDURES->routines[0])))(&list_classheader,list_VERSION)
#define list_Initialize(self) \
    (*((void (*)()) (list_CLASSPROCEDURES->routines[2])))(&list_classheader,self, list_VERSION)

#define list_Destroy(self) \
    ((* ((void (*)()) ((self)->header.list_methods->info->procs->routines[1]))) (&list_classheader, self))
#define list_Finalize(self) \
    (*((void (*)()) (list_CLASSPROCEDURES->routines[3])))(&list_classheader,self)

#define list_InitializeObject(self) \
    (*((boolean (*)()) (list_CLASSPROCEDURES->routines[5])))(&list_classheader,self)
#define list_FinalizeObject(self) \
    (*((void (*)()) (list_CLASSPROCEDURES->routines[6])))(&list_classheader,self)
#define list_Merge(dst,src) \
    (*((void (*)()) (list_CLASSPROCEDURES->routines[7])))(&list_classheader,dst,src)
#define list_Append(dst,src) \
    (*((void (*)()) (list_CLASSPROCEDURES->routines[8])))(&list_classheader,dst,src)


#endif /* !defined(list_ROUTINESDEFINED) && !defined(dontDefineRoutinesFor_list ) && !defined(class_StaticEntriesOnly)*/

