revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / gadtools / gt_getgadgetattrsa.c
blobd78d83b48c23866d8b9d704a1802b0e86cdcf68a
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <proto/exec.h>
7 #include <exec/ports.h>
8 #include "gadtools_intern.h"
10 /*********************************************************************
12 NAME */
13 #include <exec/types.h>
14 #include <proto/gadtools.h>
15 #include <intuition/intuition.h>
16 #include <utility/tagitem.h>
18 AROS_LH4(LONG, GT_GetGadgetAttrsA,
20 /* SYNOPSIS */
21 AROS_LHA(struct Gadget *, gad, A0),
22 AROS_LHA(struct Window *, win, A1),
23 AROS_LHA(struct Requester *, req, A2),
24 AROS_LHA(struct TagItem *, taglist, A3),
26 /* LOCATION */
27 struct Library *, GadToolsBase, 29, GadTools)
29 /* FUNCTION
30 Get a list of attributes from a specific gadget.
32 INPUTS
33 gad - the gadget from which to get attributes.
34 may be null. if so, this function returns 0.
35 win - the window, in which the gadget is
36 req - the requester, in which the gadget is, or NULL
37 taglist - the list of attributes to get. ti_Tag specifies the attribute
38 and ti_Data is a pointer to an IPTR, where the data is to be
39 stored
41 RESULT
42 The number of attributes, which were filled correctly.
44 NOTES
46 EXAMPLE
48 BUGS
50 SEE ALSO
51 GT_SetGadgetAttrsA(), intuition.library/GetAttr()
53 INTERNALS
55 ***************************************************************************/
57 AROS_LIBFUNC_INIT
59 LONG count = 0;
60 struct TagItem *tag;
61 struct TagItem *mytags = taglist;
63 if (gad == NULL || taglist == NULL)
64 return 0L;
66 while ((tag = NextTagItem(&mytags)))
67 if (GetAttr(tag->ti_Tag, (Object *)gad, (IPTR *)tag->ti_Data))
68 count++;
70 return count;
72 AROS_LIBFUNC_EXIT
74 } /* GT_GetGadgetAttrsA */