2 Copyright © 1995-2004, The AROS Development Team. All rights reserved.
9 /*****************************************************************************
12 #include <utility/tagitem.h>
13 #include <proto/utility.h>
15 AROS_LH3(IPTR
, GetTagData
,
18 AROS_LHA(Tag
, tagValue
, D0
),
19 AROS_LHA(IPTR
, defaultVal
, D1
),
20 AROS_LHA(const struct TagItem
*, tagList
, A0
),
23 struct UtilityBase
*, UtilityBase
, 6, Utility
)
26 Searches the TagList for the Tag specified, if it exists, then
27 returns the ti_Data field of that Tag, otherwise returns the
28 supplied default value.
31 tagValue - Tag to search for.
32 defaultVal - Default value for the Tag.
33 tagList - Pointer to first TagItem in the list.
36 The data value if the Tag exists, or the default value if it
40 If the input TagList doesn't exist (eg for some reason equals
41 NULL), then the return value will be NULL. This way you can
42 check for broken code, whereas returing the default would allow
43 code that is possibly buggy to still seem to work. (Until you
44 tried to do anything special at least).
48 struct Window *window; \* The Window we are creating *\
49 struct TagItem *wintags; \* Tags for this window *\
51 \* Find out the value for the WA_Left tag *\
52 window->Left = GetTagData( WA_Left, 320, wintags )
61 *****************************************************************************/
64 struct TagItem
*ti
= NULL
;
67 If we can find the Tag in the supplied list, then return the
70 If the tag is not in the list, just return the default value.
72 if (tagList
&& (ti
= FindTagItem(tagValue
, tagList
)))