1*40411Sbostic /*-
2*40411Sbostic  * LstAtFront.c --
3*40411Sbostic  *	Add a node at the front of the list
4*40411Sbostic  *
5*40411Sbostic  * Copyright (c) 1988 by the Regents of the University of California
6*40411Sbostic  *
7*40411Sbostic  * Permission to use, copy, modify, and distribute this
8*40411Sbostic  * software and its documentation for any purpose and without
9*40411Sbostic  * fee is hereby granted, provided that the above copyright
10*40411Sbostic  * notice appears in all copies.  Neither the University of California nor
11*40411Sbostic  * Adam de Boor makes any representations about the suitability of this
12*40411Sbostic  * software for any purpose.  It is provided "as is" without
13*40411Sbostic  * express or implied warranty.
14*40411Sbostic  *
15*40411Sbostic  */
16*40411Sbostic #ifndef lint
17*40411Sbostic static char *rcsid =
18*40411Sbostic "$Id: lstAtFront.c,v 1.3 88/11/17 20:51:51 adam Exp $ SPRITE (Berkeley)";
19*40411Sbostic #endif lint
20*40411Sbostic 
21*40411Sbostic #include	"lstInt.h"
22*40411Sbostic 
23*40411Sbostic /*-
24*40411Sbostic  *-----------------------------------------------------------------------
25*40411Sbostic  * Lst_AtFront --
26*40411Sbostic  *	Place a piece of data at the front of a list
27*40411Sbostic  *
28*40411Sbostic  * Results:
29*40411Sbostic  *	SUCCESS or FAILURE
30*40411Sbostic  *
31*40411Sbostic  * Side Effects:
32*40411Sbostic  *	A new ListNode is created and stuck at the front of the list.
33*40411Sbostic  *	hence, firstPtr (and possible lastPtr) in the list are altered.
34*40411Sbostic  *
35*40411Sbostic  *-----------------------------------------------------------------------
36*40411Sbostic  */
37*40411Sbostic ReturnStatus
38*40411Sbostic Lst_AtFront (l, d)
39*40411Sbostic     Lst		l;
40*40411Sbostic     ClientData	d;
41*40411Sbostic {
42*40411Sbostic     register LstNode	front;
43*40411Sbostic 
44*40411Sbostic     front = Lst_First (l);
45*40411Sbostic     return (Lst_Insert (l, front, d));
46*40411Sbostic }
47