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[] = "@(#)lstSucc.c 8.2 (Berkeley) 04/28/95"; 13 #endif /* not lint */ 14 15 /*- 16 * LstSucc.c -- 17 * return the successor to a given node 18 */ 19 20 #include "lstInt.h" 21 22 /*- 23 *----------------------------------------------------------------------- 24 * Lst_Succ -- 25 * Return the sucessor to the given node on its list. 26 * 27 * Results: 28 * The successor of the node, if it exists (note that on a circular 29 * list, if the node is the only one in the list, it is its own 30 * successor). 31 * 32 * Side Effects: 33 * None. 34 * 35 *----------------------------------------------------------------------- 36 */ 37 LstNode 38 Lst_Succ (ln) 39 LstNode ln; 40 { 41 if (ln == NILLNODE) { 42 return (NILLNODE); 43 } else { 44 return ((LstNode) ((ListNode) ln)->nextPtr); 45 } 46 } 47 48