Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / libs / datatypes / getdtattrsa.c
blobffd7a7c775d8167f4a056c989073365383d08b1f
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 <base attribs>
41 DTA_DataType (#1)
42 DTA_ObjName
43 DTA_ObjAuthor
44 DTA_ObjAnnotation
45 DTA_ObjCopyright
46 DTA_ObjVersion
47 DTA_ObjectID
49 RESULT
51 The number of attributes obtained.
53 NOTES
55 (#1) - On AROS, the "DataType" an object returns may be a clone of
56 the real entry, so that the subclass can override
57 subformat information.
59 EXAMPLE
61 BUGS
63 SEE ALSO
65 SetDTAttrsA(), intuition.library/GetAttr()
67 INTERNALS
69 HISTORY
71 *****************************************************************************/
73 AROS_LIBFUNC_INIT
75 ULONG result = 0;
76 struct TagItem *tstate = attrs;
77 struct TagItem *tag;
78 struct opGet opGet;
80 if(o == NULL || attrs == NULL)
81 return 0;
83 opGet.MethodID = OM_GET;
85 while ((tag = NextTagItem(&tstate)) != NULL)
87 opGet.opg_AttrID = tag->ti_Tag;
88 opGet.opg_Storage = (IPTR *)tag->ti_Data;
90 if(DoMethodA(o, (Msg)&opGet))
91 result++;
92 else
93 *(opGet.opg_Storage) = 0;
96 return(result);
98 AROS_LIBFUNC_EXIT
99 } /* GetDTAttrsA */