list.h


/*
** $RCSfile: list.h $
** $Revision: 1.1 $
** $Date: 1996/07/25 10:10:38 $
** $Author: doomer $
*/

#if !defined(_listIncluded_)
#define _listIncluded_

#include <windows.h>
#include <stdlib.h>

struct node {
	struct node *prev;
	struct node *next;
	void *data;
};

/*
** not currently used.  intended to allow use as a queue
*/

struct listHeader {
	struct node *head;
	struct node *tail;
};

typedef BOOL (*compareFn)(void *, void *);
typedef void (*iterateFn)(void *);

struct node *push(struct node **head, struct node *newNode);
void *pop(struct node **head);
void *removeFromList(struct node **head, struct node *nodeToRemove);
struct node *iterateUntil(struct node *head, void *cmpData, compareFn cmp);
struct node *iterateOver(struct node *head, iterateFn iterate);

struct node *createNewNode(void *data);

char *revInfo(void);

#endif

/*
** $Log: list.h $
** Revision 1.1  1996/07/25 10:10:38  doomer
** Initial revision
** Revision 1.7  1996/01/14 12:08:58  doomer
** added prototype for revInfo() function.
** Revision 1.6  1996/01/13 22:46:02  doomer
** added struct definition for listHeader in preparation for implementing
** an append() capability.
** Revision 1.5  1996/01/13 22:20:54  doomer
** changed the name of the function prependToList() to pop().
** added prototype for pop()
** Revision 1.4  1996/01/12 10:07:22  doomer
** changed the typedef of compareFn to accept an additional data pointer.
** changed the name of addToList to prependToList.
** added a data pointer to iterateUntil().
** Revision 1.3  1996/01/11 15:38:04  doomer
** changed the return type for iterateOver() to be of type struct node *.
** did this so that a function may iterate through a list.
** Revision 1.2  1996/01/11 13:49:38  doomer
** changed the prototypes for compareFn & iterateFn to accept pointers to
** data, so that the functions didn't need to deal with dereferencing
** the node structure.
** 
** changed the decalaration of iterateUntil() to return a pointer to 
** a node structure.  Did this so that a function could use the return
** value to iterate through the list.
** Revision 1.1  1996/01/11 11:39:08  doomer
** Initial revision
*/