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[] = "@(#)lstReplace.c 8.2 (Berkeley) 04/28/95"; 13 #endif /* not lint */ 14 15 /*- 16 * LstReplace.c -- 17 * Replace the datum in a node with a new datum 18 */ 19 20 #include "lstInt.h" 21 22 /*- 23 *----------------------------------------------------------------------- 24 * Lst_Replace -- 25 * Replace the datum in the given node with the new datum 26 * 27 * Results: 28 * SUCCESS or FAILURE. 29 * 30 * Side Effects: 31 * The datum field fo the node is altered. 32 * 33 *----------------------------------------------------------------------- 34 */ 35 ReturnStatus 36 Lst_Replace (ln, d) 37 register LstNode ln; 38 ClientData d; 39 { 40 if (ln == NILLNODE) { 41 return (FAILURE); 42 } else { 43 ((ListNode) ln)->datum = d; 44 return (SUCCESS); 45 } 46 } 47 48