131a9abe6Sbostic /*
2d19a14ecSbostic  * Copyright (c) 1988, 1989, 1990, 1993
3d19a14ecSbostic  *	The Regents of the University of California.  All rights reserved.
431a9abe6Sbostic  *
531a9abe6Sbostic  * This code is derived from software contributed to Berkeley by
631a9abe6Sbostic  * Adam de Boor.
731a9abe6Sbostic  *
82b713f00Sbostic  * %sccs.include.redist.c%
931a9abe6Sbostic  */
1031a9abe6Sbostic 
1131a9abe6Sbostic #ifndef lint
12*2bb4d294Schristos static char sccsid[] = "@(#)lstAtFront.c	8.2 (Berkeley) 04/28/95";
1331a9abe6Sbostic #endif /* not lint */
1431a9abe6Sbostic 
1586d9cf80Sbostic /*-
1686d9cf80Sbostic  * LstAtFront.c --
1786d9cf80Sbostic  *	Add a node at the front of the list
1886d9cf80Sbostic  */
1986d9cf80Sbostic 
2086d9cf80Sbostic #include	"lstInt.h"
2186d9cf80Sbostic 
2286d9cf80Sbostic /*-
2386d9cf80Sbostic  *-----------------------------------------------------------------------
2486d9cf80Sbostic  * Lst_AtFront --
2586d9cf80Sbostic  *	Place a piece of data at the front of a list
2686d9cf80Sbostic  *
2786d9cf80Sbostic  * Results:
2886d9cf80Sbostic  *	SUCCESS or FAILURE
2986d9cf80Sbostic  *
3086d9cf80Sbostic  * Side Effects:
3186d9cf80Sbostic  *	A new ListNode is created and stuck at the front of the list.
3286d9cf80Sbostic  *	hence, firstPtr (and possible lastPtr) in the list are altered.
3386d9cf80Sbostic  *
3486d9cf80Sbostic  *-----------------------------------------------------------------------
3586d9cf80Sbostic  */
3686d9cf80Sbostic ReturnStatus
Lst_AtFront(l,d)3786d9cf80Sbostic Lst_AtFront (l, d)
3886d9cf80Sbostic     Lst		l;
3986d9cf80Sbostic     ClientData	d;
4086d9cf80Sbostic {
4186d9cf80Sbostic     register LstNode	front;
4286d9cf80Sbostic 
4386d9cf80Sbostic     front = Lst_First (l);
4486d9cf80Sbostic     return (Lst_Insert (l, front, d));
4586d9cf80Sbostic }
46