1 /*- 2 * LstAtFront.c -- 3 * Add a node at the front 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: lstAtFront.c,v 1.3 88/11/17 20:51:51 adam Exp $ SPRITE (Berkeley)"; 19 #endif lint 20 21 #include "lstInt.h" 22 23 /*- 24 *----------------------------------------------------------------------- 25 * Lst_AtFront -- 26 * Place a piece of data at the front of a list 27 * 28 * Results: 29 * SUCCESS or FAILURE 30 * 31 * Side Effects: 32 * A new ListNode is created and stuck at the front of the list. 33 * hence, firstPtr (and possible lastPtr) in the list are altered. 34 * 35 *----------------------------------------------------------------------- 36 */ 37 ReturnStatus 38 Lst_AtFront (l, d) 39 Lst l; 40 ClientData d; 41 { 42 register LstNode front; 43 44 front = Lst_First (l); 45 return (Lst_Insert (l, front, d)); 46 } 47