2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
8 #include <proto/arossupport.h>
12 /*****************************************************************************
15 #include <utility/tagitem.h>
16 #include <proto/utility.h>
18 AROS_LH3(IPTR
, GetTagData
,
21 AROS_LHA(Tag
, tagValue
, D0
),
22 AROS_LHA(IPTR
, defaultVal
, D1
),
23 AROS_LHA(struct TagItem
*, tagList
, A0
),
26 struct UtilityBase
*, UtilityBase
, 6, Utility
)
29 Searches the TagList for the Tag specified, if it exists, then
30 returns the ti_Data field of that Tag, otherwise returns the
31 supplied default value.
34 tagValue - Tag to search for.
35 defaultVal - Default value for the Tag.
36 tagList - Pointer to first TagItem in the list.
39 The data value if the Tag exists, or the default value if it
43 If the input TagList doesn't exist (eg for some reason equals
44 NULL), then the return value will be NULL. This way you can
45 check for broken code, whereas returing the default would allow
46 code that is possibly buggy to still seem to work. (Until you
47 tried to do anything special at least).
51 struct Window *window; \* The Window we are creating *\
52 struct TagItem *wintags; \* Tags for this window *\
54 \* Find out the value for the WA_Left tag *\
55 window->Left = GetTagData( WA_Left, 320, wintags )
64 *****************************************************************************/
68 /* Use code from libarossupport */
69 return LibGetTagData(tagValue
, defaultVal
, tagList
);