try to make sure compiler/include/mmakefile is always refreshed correctly.
[AROS.git] / rom / intuition / getattr.c
blob4151bb398497137dfe793fb8e6944e5acd5fafd4
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
4 $Id$
5 */
7 #include <proto/alib.h>
8 #include "intuition_intern.h"
10 /*****************************************************************************
12 NAME */
13 #include <intuition/classusr.h>
14 #include <proto/intuition.h>
16 AROS_LH3(ULONG, GetAttr,
18 /* SYNOPSIS */
19 AROS_LHA(ULONG , attrID, D0),
20 AROS_LHA(Object *, object, A0),
21 AROS_LHA(IPTR * , storagePtr, A1),
23 /* LOCATION */
24 struct IntuitionBase *, IntuitionBase, 109, Intuition)
26 /* FUNCTION
27 Asks the specified object for the value of an attribute. This is not
28 possible for all attributes of an object. Read the documentation for
29 the class to find out which can be read and which can't.
31 INPUTS
32 attrID - ID of the attribute you want
33 object - Ask the attribute from this object
34 storagePtr - This is a pointer to memory which is large enough
35 to hold a copy of the attribute. Most classes will simply
36 put a copy of the value stored in the object here but this
37 behaviour is class specific. Therefore read the instructions
38 in the class description carefully.
40 RESULT
41 Mostly TRUE if the method is supported for the specified attribute
42 and FALSE if it isn't or the attribute can't be read at this time.
43 See the classes documentation for details.
45 NOTES
46 This function sends OM_GET to the object.
48 EXAMPLE
50 BUGS
52 SEE ALSO
53 NewObjectA(), DisposeObject(), SetAttrsA(), MakeClass(),
54 "Basic Object-Oriented Programming System for Intuition" and
55 "Boopsi Class Reference" Document.
57 INTERNALS
59 *****************************************************************************/
61 AROS_LIBFUNC_INIT
63 struct opGet get;
64 ULONG result = 0;
66 DEBUG_GETATTR(dprintf("GetAttr[%x]: AttrID 0x%lx Object 0x%lx Storage 0x%lx\n",
67 &get, attrID, object, storagePtr));
70 SANITY_CHECKR(object,0)
71 SANITY_CHECKR(storagePtr,0)
73 get.MethodID = OM_GET;
74 get.opg_AttrID = attrID;
75 get.opg_Storage = storagePtr;
77 result = DoMethodA (object, (Msg)&get);
79 DEBUG_GETATTR(dprintf("GetAttr[%x]: Return %d\n", &get, result));
81 return result;
83 AROS_LIBFUNC_EXIT
84 } /* GetAttr() */