Check for SYS/GL during library init. Reason is that
[AROS.git] / rom / utility / refreshtagitemclones.c
blob23f4c46f7fde6b1adedba782e4f0e9283e71c590
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: RefreshTagItemClones()
6 Lang: english
7 */
8 #include "intern.h"
10 /*****************************************************************************
12 NAME */
13 #include <utility/tagitem.h>
14 #include <proto/utility.h>
16 AROS_LH2(void, RefreshTagItemClones,
18 /* SYNOPSIS */
19 AROS_LHA(struct TagItem *, clone, A0),
20 AROS_LHA(struct TagItem *, original, A1),
22 /* LOCATION */
23 struct UtilityBase *, UtilityBase, 14, Utility)
25 /* FUNCTION
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.
31 INPUTS
32 original - The source TagList (unaltered)
33 clone - The destination TagList (MUST be allocated by
34 CloneTagItems())
36 RESULT
37 The second TagList now has the same values as the first.
39 NOTES
40 If either of the inputs is NULL, then the function will not do
41 anything.
43 EXAMPLE
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 );
55 BUGS
56 None, however if either of the two pre-conditions is not fulfilled
57 then this function will probably be unreliable, or trash memory.
59 We warned you...
61 SEE ALSO
62 CloneTagItems()
64 INTERNALS
66 HISTORY
67 29-10-95 digulla automatically created from
68 utility_lib.fd and clib/utility_protos.h
69 11-08-96 iaint Based on the 3.0/2.04 version.
70 05-09-96 iaint Updated autodoc, and removed another variable.
72 *****************************************************************************/
74 AROS_LIBFUNC_INIT
76 struct TagItem *current;
78 if( !clone )
79 return;
81 /* If we don't have an original, but do have a clone, set the
82 clone to have a definite end of TagList.
84 This is because CloneTagItems(NULL) is valid.
86 if(!original)
88 clone->ti_Tag = TAG_DONE;
89 return;
92 /* Remember, the clone list is a straight memory block, however
93 the original list may not be.
95 while ((current = NextTagItem ((struct TagItem **)&original)))
97 *clone = *current; /* Copies both tag and data */
98 clone++;
101 AROS_LIBFUNC_EXIT
102 } /* RefreshTagItemClones */