Changeset 24 in kBuild for branches/FREEBSD/src/kmk/lst.lib/lstDupl.c
- Timestamp:
- Nov 26, 2002 9:24:54 PM (22 years ago)
- File:
-
- 1 edited
-
branches/FREEBSD/src/kmk/lst.lib/lstDupl.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/FREEBSD/src/kmk/lst.lib/lstDupl.c
r9 r24 34 34 * SUCH DAMAGE. 35 35 * 36 * @(#)lstDupl.c 8.1 (Berkeley) 6/6/9336 * $FreeBSD: src/usr.bin/make/lst.lib/lstDupl.c,v 1.7 1999/08/28 01:03:49 peter Exp $ 37 37 */ 38 38 39 39 #ifndef lint 40 #include <sys/cdefs.h> 41 __FBSDID("$FreeBSD: src/usr.bin/make/lst.lib/lstDupl.c,v 1.12 2002/10/09 02:00:22 jmallett Exp $"); 40 static char sccsid[] = "@(#)lstDupl.c 8.1 (Berkeley) 6/6/93"; 42 41 #endif /* not lint */ 43 42 … … 53 52 *----------------------------------------------------------------------- 54 53 * Lst_Duplicate -- 55 * Duplicate an entire list. If a function to copy a void *is54 * Duplicate an entire list. If a function to copy a ClientData is 56 55 * given, the individual client elements will be duplicated as well. 57 56 * 58 57 * Results: 59 * The new Lst structure or N ULLif failure.58 * The new Lst structure or NILLST if failure. 60 59 * 61 60 * Side Effects: … … 66 65 Lst_Duplicate (l, copyProc) 67 66 Lst l; /* the list to duplicate */ 68 /* A function to duplicate each void **/69 void * (*copyProc)(void *);67 /* A function to duplicate each ClientData */ 68 ClientData (*copyProc) __P((ClientData)); 70 69 { 71 70 register Lst nl; … … 74 73 75 74 if (!LstValid (l)) { 76 return (N ULL);75 return (NILLST); 77 76 } 78 77 79 78 nl = Lst_Init (list->isCirc); 80 if (nl == N ULL) {81 return (N ULL);79 if (nl == NILLST) { 80 return (NILLST); 82 81 } 83 82 84 83 ln = list->firstPtr; 85 while (ln != N ULL) {84 while (ln != NilListNode) { 86 85 if (copyProc != NOCOPY) { 87 86 if (Lst_AtEnd (nl, (*copyProc) (ln->datum)) == FAILURE) { 88 return (N ULL);87 return (NILLST); 89 88 } 90 89 } else if (Lst_AtEnd (nl, ln->datum) == FAILURE) { 91 return (N ULL);90 return (NILLST); 92 91 } 93 92 94 93 if (list->isCirc && ln == list->lastPtr) { 95 ln = N ULL;94 ln = NilListNode; 96 95 } else { 97 96 ln = ln->nextPtr;
Note:
See TracChangeset
for help on using the changeset viewer.

