Minor fixes to comments.
[AROS.git] / rom / utility / gettagdata.c
blob47f389a8b5bd13e3836e0401e435456ee31e1d0a
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 GetTagData()
6 */
8 #include <proto/arossupport.h>
10 #include "intern.h"
12 /*****************************************************************************
14 NAME */
15 #include <utility/tagitem.h>
16 #include <proto/utility.h>
18 AROS_LH3(IPTR, GetTagData,
20 /* SYNOPSIS */
21 AROS_LHA(Tag , tagValue, D0),
22 AROS_LHA(IPTR , defaultVal, D1),
23 AROS_LHA(const struct TagItem *, tagList, A0),
25 /* LOCATION */
26 struct UtilityBase *, UtilityBase, 6, Utility)
28 /* FUNCTION
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.
33 INPUTS
34 tagValue - Tag to search for.
35 defaultVal - Default value for the Tag.
36 tagList - Pointer to first TagItem in the list.
38 RESULT
39 The data value if the Tag exists, or the default value if it
40 doesn't.
42 NOTES
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).
49 EXAMPLE
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 )
57 BUGS
59 SEE ALSO
60 utility/tagitem.h
62 INTERNALS
64 *****************************************************************************/
66 AROS_LIBFUNC_INIT
68 /* Use code from libarossupport */
69 return LibGetTagData(tagValue, defaultVal, tagList);
71 AROS_LIBFUNC_EXIT
72 } /* GetTagData */