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[] = "@(#)lstAtFront.c	8.2 (Berkeley) 04/28/95";
13 #endif /* not lint */
14 
15 /*-
16  * LstAtFront.c --
17  *	Add a node at the front of the list
18  */
19 
20 #include	"lstInt.h"
21 
22 /*-
23  *-----------------------------------------------------------------------
24  * Lst_AtFront --
25  *	Place a piece of data at the front of a list
26  *
27  * Results:
28  *	SUCCESS or FAILURE
29  *
30  * Side Effects:
31  *	A new ListNode is created and stuck at the front of the list.
32  *	hence, firstPtr (and possible lastPtr) in the list are altered.
33  *
34  *-----------------------------------------------------------------------
35  */
36 ReturnStatus
Lst_AtFront(l,d)37 Lst_AtFront (l, d)
38     Lst		l;
39     ClientData	d;
40 {
41     register LstNode	front;
42 
43     front = Lst_First (l);
44     return (Lst_Insert (l, front, d));
45 }
46