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[] = "@(#)lstEnQueue.c	8.2 (Berkeley) 04/28/95";
13 #endif /* not lint */
14 
15 /*-
16  * LstEnQueue.c--
17  *	Treat the list as a queue and place a datum at its end
18  */
19 
20 #include	"lstInt.h"
21 
22 /*-
23  *-----------------------------------------------------------------------
24  * Lst_EnQueue --
25  *	Add the datum to the tail of the given list.
26  *
27  * Results:
28  *	SUCCESS or FAILURE as returned by Lst_Append.
29  *
30  * Side Effects:
31  *	the lastPtr field is altered all the time and the firstPtr field
32  *	will be altered if the list used to be empty.
33  *
34  *-----------------------------------------------------------------------
35  */
36 ReturnStatus
Lst_EnQueue(l,d)37 Lst_EnQueue (l, d)
38     Lst	    	  l;
39     ClientData	  d;
40 {
41     if (LstValid (l) == FALSE) {
42 	return (FAILURE);
43     }
44 
45     return (Lst_Append (l, Lst_Last(l), d));
46 }
47 
48