#include "resman.h"

void             InitList(struct List *);
BOOL             Empty(struct List *);
struct Node     *FirstNode(struct List *);

// Generic routine to create a list.  Pretty straightforward.
void InitList(struct List *list)

{list->lh_Head     = (struct Node *)&(list->lh_Tail);
 list->lh_TailPred = (struct Node *)&(list->lh_Head);
 list->lh_Tail     =  NULL;
 list->lh_Type     =  NT_UNKNOWN;
}


// Returns true if list is empty (first and last node are the same)
BOOL Empty(struct List *list)
{return((BOOL)(list->lh_TailPred == (struct Node *)list));
}


struct Node *FirstNode(struct List *list)

{struct Node *nd;

 nd = list->lh_Head;

 if (nd->ln_Succ)
     return(nd);
   else
     return(NULL);
}
