1 /*- 2 * LstReplace.c -- 3 * Replace the datum in a node with a new datum 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: lstReplace.c,v 1.4 88/11/17 20:54:01 adam Exp $ SPRITE (Berkeley)"; 18 #endif lint 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