1 /*
2 * Copyright (c) 1988, 1989, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Adam de Boor.
7 *
8 * %sccs.include.redist.c%
9 */
10
11 #ifndef lint
12 static char sccsid[] = "@(#)lstIsEmpty.c 8.2 (Berkeley) 04/28/95";
13 #endif /* not lint */
14
15 /*-
16 * LstIsEmpty.c --
17 * A single function to decide if a list is empty
18 */
19
20 #include "lstInt.h"
21
22 /*-
23 *-----------------------------------------------------------------------
24 * Lst_IsEmpty --
25 * Return TRUE if the given list is empty.
26 *
27 * Results:
28 * TRUE if the list is empty, FALSE otherwise.
29 *
30 * Side Effects:
31 * None.
32 *
33 * A list is considered empty if its firstPtr == NilListNode (or if
34 * the list itself is NILLIST).
35 *-----------------------------------------------------------------------
36 */
37 Boolean
Lst_IsEmpty(l)38 Lst_IsEmpty (l)
39 Lst l;
40 {
41 return ( ! LstValid (l) || LstIsEmpty(l));
42 }
43
44