xref: /csrg-svn/usr.bin/make/lst.lib/lstSucc.c (revision 62089)
140412Sbostic /*
2*62089Sbostic  * Copyright (c) 1988, 1989, 1990, 1993
3*62089Sbostic  *	The Regents of the University of California.  All rights reserved.
440411Sbostic  *
540412Sbostic  * This code is derived from software contributed to Berkeley by
640412Sbostic  * Adam de Boor.
740411Sbostic  *
842741Sbostic  * %sccs.include.redist.c%
940411Sbostic  */
1040412Sbostic 
1140411Sbostic #ifndef lint
12*62089Sbostic static char sccsid[] = "@(#)lstSucc.c	8.1 (Berkeley) 06/06/93";
1340412Sbostic #endif /* not lint */
1440411Sbostic 
1540412Sbostic /*-
1640412Sbostic  * LstSucc.c --
1740412Sbostic  *	return the successor to a given node
1840412Sbostic  */
1940412Sbostic 
2040411Sbostic #include	"lstInt.h"
2140411Sbostic 
2240411Sbostic /*-
2340411Sbostic  *-----------------------------------------------------------------------
2440411Sbostic  * Lst_Succ --
2540411Sbostic  *	Return the sucessor to the given node on its list.
2640411Sbostic  *
2740411Sbostic  * Results:
2840411Sbostic  *	The successor of the node, if it exists (note that on a circular
2940411Sbostic  *	list, if the node is the only one in the list, it is its own
3040411Sbostic  *	successor).
3140411Sbostic  *
3240411Sbostic  * Side Effects:
3340411Sbostic  *	None.
3440411Sbostic  *
3540411Sbostic  *-----------------------------------------------------------------------
3640411Sbostic  */
3740411Sbostic LstNode
3840411Sbostic Lst_Succ (ln)
3940411Sbostic     LstNode	ln;
4040411Sbostic {
4140411Sbostic     if (ln == NILLNODE) {
4240411Sbostic 	return (NILLNODE);
4340411Sbostic     } else {
4440411Sbostic 	return ((LstNode) ((ListNode) ln)->nextPtr);
4540411Sbostic     }
4640411Sbostic }
4740411Sbostic 
48