openurl.library: 64-bit pointer casting cleanups
[AROS.git] / rom / utility / filtertagchanges.c
blobfdc76d14353013f616846541f453e340ef6aca4a
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: FilterTagChanges() - filter unchanged tags from a list.
6 Lang: english
7 */
8 #include "intern.h"
10 /*****************************************************************************
12 NAME */
13 #include <proto/utility.h>
15 AROS_LH3(void, FilterTagChanges,
17 /* SYNOPSIS */
18 AROS_LHA(struct TagItem * , changeList, A0),
19 AROS_LHA(const struct TagItem *, originalList, A1),
20 AROS_LHA(BOOL , apply, D0),
22 /* LOCATION */
23 struct Library *, UtilityBase, 9, Utility)
25 /* FUNCTION
26 This function will scan through changeList, and if an item in
27 changeList exists in originalList, but both items data values
28 are equal, then the item in changeList will be removed from the
29 list.
31 If the value of apply is TRUE, then if the datas are different
32 then the values in originalList will be updated to match those
33 in changeList.
35 INPUTS
36 changeList - List of new tags (may be NULL).
37 originalList - List of existing tags (may be NULL).
38 apply - Boolean flag as to whether the values in
39 originalList should be updated to match
40 those in changeList.
42 RESULT
43 The changeList will be modified to show altered items, and if
44 requested, the originalList will be updated.
46 NOTES
48 EXAMPLE
50 BUGS
52 SEE ALSO
53 ApplyTagChanges()
55 INTERNALS
57 HISTORY
58 29-10-95 digulla automatically created from
59 utility_lib.fd and clib/utility_protos.h
61 *****************************************************************************/
63 AROS_LIBFUNC_INIT
65 if (originalList && changeList)
67 struct TagItem *change, *orig;
69 while ((change = NextTagItem(&changeList)))
71 if ((orig = FindTagItem(change->ti_Tag, originalList)))
73 if (change->ti_Data == orig->ti_Data)
75 change->ti_Tag = TAG_IGNORE;
77 else
79 if (apply)
80 orig->ti_Data = change->ti_Data;
82 } /* if (FindTagItem()) */
83 } /* while (changeList++) */
84 } /* if (lists are both valid) */
86 AROS_LIBFUNC_EXIT
87 } /* FilterTagChanges */