new copyright notice
[unix-history] / usr / src / usr.bin / make / lst.lib / lstFirst.c
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Adam de Boor.
*
* %sccs.include.redist.c%
*/
#ifndef lint
static char sccsid[] = "@(#)lstFirst.c 5.3 (Berkeley) %G%";
#endif /* not lint */
/*-
* LstFirst.c --
* Return the first node of a list
*/
#include "lstInt.h"
/*-
*-----------------------------------------------------------------------
* Lst_First --
* Return the first node on the given list.
*
* Results:
* The first node or NILLNODE if the list is empty.
*
* Side Effects:
* None.
*
*-----------------------------------------------------------------------
*/
LstNode
Lst_First (l)
Lst l;
{
if (!LstValid (l) || LstIsEmpty (l)) {
return (NILLNODE);
} else {
return ((LstNode)((List)l)->firstPtr);
}
}