140412Sbostic /*
2*62085Sbostic  * Copyright (c) 1988, 1989, 1990, 1993
3*62085Sbostic  *	The Regents of the University of California.  All rights reserved.
440411Sbostic  *
540412Sbostic  * This code is derived from software contributed to Berkeley by
640412Sbostic  * Adam de Boor.
740411Sbostic  *
842741Sbostic  * %sccs.include.redist.c%
940411Sbostic  */
1040412Sbostic 
1140411Sbostic #ifndef lint
12*62085Sbostic static char sccsid[] = "@(#)lstAtFront.c	8.1 (Berkeley) 06/06/93";
1340412Sbostic #endif /* not lint */
1440411Sbostic 
1540412Sbostic /*-
1640412Sbostic  * LstAtFront.c --
1740412Sbostic  *	Add a node at the front of the list
1840412Sbostic  */
1940412Sbostic 
2040411Sbostic #include	"lstInt.h"
2140411Sbostic 
2240411Sbostic /*-
2340411Sbostic  *-----------------------------------------------------------------------
2440411Sbostic  * Lst_AtFront --
2540411Sbostic  *	Place a piece of data at the front of a list
2640411Sbostic  *
2740411Sbostic  * Results:
2840411Sbostic  *	SUCCESS or FAILURE
2940411Sbostic  *
3040411Sbostic  * Side Effects:
3140411Sbostic  *	A new ListNode is created and stuck at the front of the list.
3240411Sbostic  *	hence, firstPtr (and possible lastPtr) in the list are altered.
3340411Sbostic  *
3440411Sbostic  *-----------------------------------------------------------------------
3540411Sbostic  */
3640411Sbostic ReturnStatus
3740411Sbostic Lst_AtFront (l, d)
3840411Sbostic     Lst		l;
3940411Sbostic     ClientData	d;
4040411Sbostic {
4140411Sbostic     register LstNode	front;
4240411Sbostic 
4340411Sbostic     front = Lst_First (l);
4440411Sbostic     return (Lst_Insert (l, front, d));
4540411Sbostic }
46