2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
7 /*****************************************************************************
10 #include <utility/tagitem.h>
11 #include <proto/utility.h>
13 AROS_LH1(struct TagItem
*, NextTagItem
,
16 AROS_LHA(const struct TagItem
**, tagListPtr
, A0
),
19 struct Library
*, UtilityBase
, 8, Utility
)
22 Returns the address of the next tag-item in the list. This
23 routine correctly handles TAG_END, TAG_DONE, TAG_MORE,
24 TAG_IGNORE and TAG_SKIP.
26 TAG_END and TAG_DONE both terminate a TagItems-array (in
27 fact, TAG_DONE is the same as TAG_END).
29 With TAG_MORE, you can redirect the processing to a new list
30 of tags. Note that the processing will not return to the previous
31 list when a TAG_END/TAG_DONE is encountered.
33 TAG_IGNORE disables the processing of an entry in the list.
34 This entry is just ignored (We use this technique for filtering).
36 TAG_SKIP skips this tagitem, and the next number of tagitems as
37 indicated in the tag's ti_Data field.
40 tagListPtr - Pointer to an element in a taglist.
43 Next tag item or NULL if you reached the end of the list.
46 - TAG_MORE works like "go on with new list" instead of "read new
47 list and go on with the current one".
57 *****************************************************************************/
61 if(!(*tagListPtr
)) return NULL
;
63 /* Gosh, can't enable these because we get LOTS of hits at startup time
65 * ASSERT_VALID_PTR(tagListPtr);
66 * ASSERT_VALID_PTR(*tagListPtr);
71 switch ((*tagListPtr
)->ti_Tag
)
74 if (!((*tagListPtr
) = (struct TagItem
*)(*tagListPtr
)->ti_Data
))
86 (*tagListPtr
) += (*tagListPtr
)->ti_Data
+ 1;
90 /* Use post-increment (return will return the current value and
91 then tagListPtr will be incremented) */
92 return (struct TagItem
*)(*tagListPtr
)++;