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