Updated PCI IDs to latest snapshot.
[tangerine.git] / compiler / alib / domethod.c
blob41004d5c771c80c6fb2e59064a245c45c44be818
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define INTUITION_NO_INLINE_STDARG
8 #include <aros/debug.h>
9 #include <intuition/classes.h>
10 #include <proto/alib.h>
11 #include "alib_intern.h"
13 /******************************************************************************
15 NAME */
16 #include <intuition/classusr.h>
17 #include <proto/intuition.h>
19 IPTR DoMethodA (
21 /* SYNOPSIS */
22 Object * obj,
23 Msg message)
25 /* FUNCTION
26 Invokes a method on a BOOPSI object. The dispatcher of the class the
27 object is inherited from is called. For more information about methods
28 a class supports, see the class documentation.
30 INPUTS
31 obj - The object on which the method is to be performed.
32 message - The message. The first field is the same for all methods and
33 specifies which method is to be invoked (see
34 <intuition/classusr.h>).
36 RESULT
37 Class and method dependent. See the class documentation. A value of 0
38 can be a valid return code but can also mean that a method is not
39 supported.
41 NOTES
43 EXAMPLE
45 BUGS
47 SEE ALSO
48 boopsi.library/NewObjectA(), boopsi.library/SetAttrsA(), boopsi.library/GetAttr(),
49 boopsi.library/DisposeObject(), CoerceMethodA(),
50 DoSuperMethodA(), <intuition/classusr.h>
52 ******************************************************************************/
54 ASSERT_VALID_PTR(obj);
56 if (!obj)
57 return 0L;
59 ASSERT_VALID_PTR(OCLASS(obj));
60 ASSERT_VALID_PTR(message);
62 return CALLHOOKPKT((struct Hook *) OCLASS(obj), obj, message);
63 } /* DoMethodA */
65 IPTR DoMethod (Object * obj, IPTR MethodID, ...)
67 ASSERT_VALID_PTR(obj);
68 if (!obj)
69 return 0L;
71 ASSERT_VALID_PTR(OCLASS(obj));
73 AROS_SLOWSTACKMETHODS_PRE(MethodID)
74 retval = CALLHOOKPKT((struct Hook *) OCLASS(obj), obj, AROS_SLOWSTACKMETHODS_ARG(MethodID));
75 AROS_SLOWSTACKMETHODS_POST
76 } /* DoMethod() */