4 Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea.
7 Author: Ovidiu Predescu <ovidiu@bx.logicnet.ro>
9 This file is part of libFoundation.
11 Permission to use, copy, modify, and distribute this software and its
12 documentation for any purpose and without fee is hereby granted, provided
13 that the above copyright notice appear in all copies and that both that
14 copyright notice and this permission notice appear in supporting
17 We disclaim all warranties with regard to this software, including all
18 implied warranties of merchantability and fitness, in no event shall
19 we be liable for any special, indirect or consequential damages or any
20 damages whatsoever resulting from loss of use, data or profits, whether in
21 an action of contract, negligence or other tortious action, arising out of
22 or in connection with the use or performance of this software.
25 #ifndef __NSInvocation_h__
26 #define __NSInvocation_h__
30 # define GNU_RUNTIME 1
34 #include <Foundation/NSMethodSignature.h>
36 @interface NSInvocation : NSObject
40 NSMethodSignature *signature;
41 BOOL argumentsRetained;
45 /* Creating Invocations */
47 + (NSInvocation *)invocationWithMethodSignature:(NSMethodSignature *)sig;
49 /* Managing Invocation Arguments */
51 - (BOOL)argumentsRetained;
52 - (void)retainArguments;
53 - (NSMethodSignature *)methodSignature;
55 - (void)setArgument:(void *)argumentLocation atIndex:(int)index;
56 - (void)getArgument:(void *)argumentLocation atIndex:(int)index;
58 - (void)setReturnValue:(void *)retLoc;
59 - (void)getReturnValue:(void *)retLoc;
61 - (void)setSelector:(SEL)selector;
64 - (void)setTarget:(id)target;
67 /* Dispatching an Invocation */
70 - (void)invokeWithTarget:(id)target;
75 @interface NSInvocation (Extensions)
76 - (void)setArgumentFrame:(void*)frame;
77 - (retval_t)returnFrame;
79 @end /* NSInvocation (Extensions) */
81 /* typing stuff (added in MacOSX) */
84 # include <objc/objc-api.h>
86 # define _C_LNG_LNG 'q' /* old versions of gcc do not define this */
87 # define _C_ULNG_LNG 'Q'
91 enum _NSObjCValueType {
94 NSObjCVoidType = _C_VOID,
95 NSObjCCharType = _C_CHR,
96 NSObjCShortType = _C_SHT,
97 NSObjCLongType = _C_LNG,
98 NSObjCLonglongType = _C_LNG_LNG,
99 NSObjCFloatType = _C_FLT,
100 NSObjCDoubleType = _C_DBL,
101 NSObjCSelectorType = _C_SEL,
102 NSObjCObjectType = _C_ID,
103 NSObjCStructType = _C_STRUCT_B,
104 NSObjCPointerType = _C_PTR,
105 NSObjCStringType = _C_CHARPTR,
106 NSObjCArrayType = _C_ARY_B,
107 NSObjCUnionType = _C_UNION_B,
108 NSObjCBitfield = _C_BFLD
111 NSObjCVoidType = 'v',
112 NSObjCCharType = 'c',
113 NSObjCShortType = 's',
114 NSObjCLongType = 'l',
115 NSObjCLonglongType = 'q',
116 NSObjCFloatType = 'f',
117 NSObjCDoubleType = 'd',
118 NSObjCSelectorType = ':',
119 NSObjCObjectType = '@',
120 NSObjCStructType = '{',
121 NSObjCPointerType = '^',
122 NSObjCStringType = '*',
123 NSObjCArrayType = '[',
124 NSObjCUnionType = '(',
127 # error unsupported ObjC runtime !!!
132 enum _NSObjCValueType type;
137 long long longlongValue;
143 void *structLocation;
144 char *cStringLocation;
148 #endif /* __NSInvocation_h__ */