fix function to take the hook param
[AROS.git] / workbench / libs / datatypes / getdtattrsa.c
blob40f7e647d7097715367bf5fc59b39a644642e9c7
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #define USE_BOOPSI_STUBS
9 #include <proto/utility.h>
10 #include <proto/intuition.h>
11 #include <clib/boopsistubs.h>
12 #include "datatypes_intern.h"
14 /*****************************************************************************
16 NAME */
17 #include <proto/datatypes.h>
19 AROS_LH2(ULONG, GetDTAttrsA,
21 /* SYNOPSIS */
22 AROS_LHA(Object *, o , A0),
23 AROS_LHA(struct TagItem *, attrs, A2),
25 /* LOCATION */
26 struct Library *, DataTypesBase, 11, DataTypes)
28 /* FUNCTION
30 Get the attributes of a specific data type object.
32 INPUTS
34 o -- pointer to a data type object; may be NULL
35 attrs -- the attributes to get terminated with TAG_DONE; each Tag's
36 data element should contain the address of the respective
37 storage element; may be NULL
39 RESULT
41 The number of attributes obtained.
43 NOTES
45 EXAMPLE
47 BUGS
49 SEE ALSO
51 SetDTAttrsA(), intuition.library/GetAttr()
53 INTERNALS
55 HISTORY
57 *****************************************************************************/
59 AROS_LIBFUNC_INIT
61 ULONG result = 0;
62 struct TagItem *tstate = attrs;
63 struct TagItem *tag;
64 struct opGet opGet;
66 if(o == NULL || attrs == NULL)
67 return 0;
69 opGet.MethodID = OM_GET;
71 while ((tag = NextTagItem(&tstate)) != NULL)
73 opGet.opg_AttrID = tag->ti_Tag;
74 opGet.opg_Storage = (IPTR *)tag->ti_Data;
76 if(DoMethodA(o, (Msg)&opGet))
77 result++;
78 else
79 *(opGet.opg_Storage) = 0;
82 return(result);
84 AROS_LIBFUNC_EXIT
85 } /* GetDTAttrsA */