131a9abe6Sbostic /*
2cd79ddd6Sbostic  * Copyright (c) 1988, 1989, 1990, 1993
3cd79ddd6Sbostic  *	The Regents of the University of California.  All rights reserved.
431a9abe6Sbostic  *
531a9abe6Sbostic  * This code is derived from software contributed to Berkeley by
631a9abe6Sbostic  * Adam de Boor.
731a9abe6Sbostic  *
82b713f00Sbostic  * %sccs.include.redist.c%
931a9abe6Sbostic  */
1031a9abe6Sbostic 
1131a9abe6Sbostic #ifndef lint
12*2bb4d294Schristos static char sccsid[] = "@(#)lstReplace.c	8.2 (Berkeley) 04/28/95";
1331a9abe6Sbostic #endif /* not lint */
1431a9abe6Sbostic 
1586d9cf80Sbostic /*-
1686d9cf80Sbostic  * LstReplace.c --
1786d9cf80Sbostic  *	Replace the datum in a node with a new datum
1886d9cf80Sbostic  */
1986d9cf80Sbostic 
2086d9cf80Sbostic #include	"lstInt.h"
2186d9cf80Sbostic 
2286d9cf80Sbostic /*-
2386d9cf80Sbostic  *-----------------------------------------------------------------------
2486d9cf80Sbostic  * Lst_Replace --
2586d9cf80Sbostic  *	Replace the datum in the given node with the new datum
2686d9cf80Sbostic  *
2786d9cf80Sbostic  * Results:
2886d9cf80Sbostic  *	SUCCESS or FAILURE.
2986d9cf80Sbostic  *
3086d9cf80Sbostic  * Side Effects:
3186d9cf80Sbostic  *	The datum field fo the node is altered.
3286d9cf80Sbostic  *
3386d9cf80Sbostic  *-----------------------------------------------------------------------
3486d9cf80Sbostic  */
3586d9cf80Sbostic ReturnStatus
Lst_Replace(ln,d)3686d9cf80Sbostic Lst_Replace (ln, d)
3786d9cf80Sbostic     register LstNode	ln;
3886d9cf80Sbostic     ClientData	  	d;
3986d9cf80Sbostic {
4086d9cf80Sbostic     if (ln == NILLNODE) {
4186d9cf80Sbostic 	return (FAILURE);
4286d9cf80Sbostic     } else {
4386d9cf80Sbostic 	((ListNode) ln)->datum = d;
4486d9cf80Sbostic 	return (SUCCESS);
4586d9cf80Sbostic     }
4686d9cf80Sbostic }
4786d9cf80Sbostic 
48