Fix change log
[official-gcc.git] / libobjc / objc / message.h
blobf0038e714acec7774a13c8935c8deed857264cf0
1 /* GNU Objective C Runtime messaging declarations
2 Copyright (C) 1993, 1995, 1996, 2004, 2009,
3 2010 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
26 #ifndef __objc_message_INCLUDE_GNU
27 #define __objc_message_INCLUDE_GNU
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
33 #include "objc.h"
34 #include "objc-decls.h"
36 /* This file includes declarations of the messaging functions and
37 types.
40 /* Compatibility note: the messaging function is one area where the
41 GNU runtime and the Apple/NeXT runtime differ significantly. If
42 you can, it is recommended that you use higher-level facilities
43 (provided by a Foundation library such as GNUstep Base) to perform
44 forwarding or other advanced messaging tricks.
47 typedef void* retval_t; /* return value */
48 typedef void(*apply_t)(void); /* function pointer */
49 typedef union arglist {
50 char *arg_ptr;
51 char arg_regs[sizeof (char*)];
52 } *arglist_t; /* argument frame */
54 objc_EXPORT IMP objc_msg_lookup(id receiver, SEL op);
57 * Structure used when a message is send to a class's super class.
58 * The compiler generates one of these structures and passes it to
59 * objc_msg_lookup_super.
61 typedef struct objc_super {
62 id self; /* Id of the object sending the message. */
63 #ifdef __cplusplus
64 /* The new version of the API will always use 'super_class'. */
65 Class super_class;
66 #else
67 Class class; /* Object's super class. */
68 #endif
69 } Super, *Super_t;
71 objc_EXPORT IMP objc_msg_lookup_super(Super_t super, SEL sel);
73 objc_EXPORT retval_t objc_msg_sendv(id, SEL, arglist_t);
76 * Hooks for method forwarding. This makes it easy to substitute a
77 * library, such as ffcall, that implements closures, thereby avoiding
78 * gcc's __builtin_apply problems. __objc_msg_forward2's result will
79 * be preferred over that of __objc_msg_forward if both are set and
80 * return non-NULL.
82 * TODO: The API should define objc_set_msg_forward_handler () or
83 * similar instead of these hooks.
85 objc_EXPORT IMP (*__objc_msg_forward)(SEL);
86 objc_EXPORT IMP (*__objc_msg_forward2)(id, SEL);
88 #ifdef __cplusplus
90 #endif
92 #endif /* not __objc_message_INCLUDE_GNU */