1 /*- 2 * LstPred.c -- 3 * Return the predecessor of a given list node 4 * 5 * Copyright (c) 1988 by University of California Regents 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 #ifndef lint 16 static char *rcsid = 17 "$Id: lstPred.c,v 1.4 88/11/17 20:53:50 adam Exp $ SPRITE (Berkeley)"; 18 #endif lint 19 20 #include "lstInt.h" 21 22 /*- 23 *----------------------------------------------------------------------- 24 * Lst_Pred -- 25 * Return the predecessor of the given node. 26 * 27 * Results: 28 * The node's predecessor, if any, or NILLNODE if it has none. 29 * 30 * Side Effects: 31 * None. 32 * 33 *----------------------------------------------------------------------- 34 */ 35 LstNode 36 Lst_Pred (ln) 37 LstNode ln; 38 { 39 if (ln == NILLNODE) { 40 return (NILLNODE); 41 } else { 42 return ((LstNode)((ListNode) ln)->prevPtr); 43 } 44 } 45 46