* Duplicate a list. This includes duplicating the individual
* Copyright (c) 1988 by the Regents of the University of California
"$Id: lstDupl.c,v 1.4 88/11/17 20:52:21 adam Exp $ SPRITE (Berkeley)";
*-----------------------------------------------------------------------
* Duplicate an entire list. If a function to copy a ClientData is
* given, the individual client elements will be duplicated as well.
* The new Lst structure or NILLST if failure.
*-----------------------------------------------------------------------
Lst_Duplicate (l
, copyProc
)
Lst l
; /* the list to duplicate */
ClientData (*copyProc
)(); /* A function to duplicate each ClientData */
register List list
= (List
)l
;
nl
= Lst_Init (list
->isCirc
);
while (ln
!= NilListNode
) {
if (copyProc
!= NOCOPY
) {
if (Lst_AtEnd (nl
, (*copyProc
) (ln
->datum
)) == FAILURE
) {
} else if (Lst_AtEnd (nl
, ln
->datum
) == FAILURE
) {
if (list
->isCirc
&& ln
== list
->lastPtr
) {