2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
5 Desc: RefreshTagItemClones()
10 /*****************************************************************************
13 #include <utility/tagitem.h>
14 #include <proto/utility.h>
16 AROS_LH2(void, RefreshTagItemClones
,
19 AROS_LHA(struct TagItem
*, clone
, A0
),
20 AROS_LHA(const struct TagItem
*, original
, A1
),
23 struct UtilityBase
*, UtilityBase
, 14, Utility
)
26 If (and only if) the Tag list 'clone' was created by calling
27 CloneTagItems on the Tag list 'original', and the list original
28 has NOT been changed in any way, then this function will change
29 the list 'clone' back to its original state.
32 original - The source TagList (unaltered)
33 clone - The destination TagList (MUST be allocated by
37 The second TagList now has the same values as the first.
40 If either of the inputs is NULL, then the function will not do
44 struct TagItem *orig, clone;
46 \* TagList orig has some values already *\
47 clone = CloneTagList( orig );
49 \* In between here we do something to the TagItems in clone,
50 but we need to have them restored.
53 RefreshTagItemClones( clone, orig );
56 None, however if either of the two pre-conditions is not fulfilled
57 then this function will probably be unreliable, or trash memory.
66 *****************************************************************************/
70 struct TagItem
*current
;
75 /* If we don't have an original, but do have a clone, set the
76 clone to have a definite end of TagList.
78 This is because CloneTagItems(NULL) is valid.
82 clone
->ti_Tag
= TAG_DONE
;
86 /* Remember, the clone list is a straight memory block, however
87 the original list may not be.
89 while ((current
= NextTagItem ((struct TagItem
**)&original
)))
91 *clone
= *current
; /* Copies both tag and data */
96 } /* RefreshTagItemClones */