Assign Extras: to NIL: if it's nowhere to be found. This prevents requesters
[cake.git] / compiler / alib / dosupermethod.c
blob43bcf5032ab87369244d78b580a7f11a8e73b2e9
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define INTUITION_NO_INLINE_STDARG
8 #include <intuition/classes.h>
9 #include <stdarg.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 DoSuperMethodA (
21 /* SYNOPSIS */
22 Class * cl,
23 Object * obj,
24 Msg message)
26 /* FUNCTION
27 Invokes a method on a BOOPSI object, as if this was a object, inherited
28 from the superclass of the class passed in. Ie the dispatcher of the
29 superclass is called instead of the objects classes dispatcher.
31 INPUTS
32 cl - Class, which superclasses dispatcher is to be called.
33 obj - The object, on which the method is to be performed on.
34 message - The message. The first field is the same for all methods and
35 specifies which method is to be invokes (see
36 <intuition/classusr.h>).
38 RESULT
39 Class and method depending. See the class documentation. A value of 0
40 can mean a valid return code but can also mean that a method was not
41 supported.
43 NOTES
45 EXAMPLE
47 BUGS
49 SEE ALSO
50 boopsi.library/NewObjectA(), boopsi.library/SetAttrsA(),
51 boopsi.library/GetAttr(), boopsi.library/DisposeObject(), DoMethodA(),
52 CoerceMethodA(), <intuition/classes.h>
54 ******************************************************************************/
56 if ((!obj) || (!cl))
57 return 0L;
58 return CALLHOOKPKT((struct Hook *)cl->cl_Super, obj, message);
59 } /* DoSuperMethodA() */
62 IPTR DoSuperMethod (Class * cl, Object * obj, STACKULONG MethodID, ...)
64 if ((!obj) || (!cl))
65 return 0L;
66 AROS_SLOWSTACKMETHODS_PRE(MethodID)
67 retval = CALLHOOKPKT((struct Hook *)cl->cl_Super, obj, AROS_SLOWSTACKMETHODS_ARG(MethodID));
68 AROS_SLOWSTACKMETHODS_POST
69 } /* DoSuperMethod()*/