summaryrefslogtreecommitdiff
path: root/Objective-C/libobjcl.m
diff options
context:
space:
mode:
Diffstat (limited to 'Objective-C/libobjcl.m')
-rw-r--r--Objective-C/libobjcl.m42
1 files changed, 42 insertions, 0 deletions
diff --git a/Objective-C/libobjcl.m b/Objective-C/libobjcl.m
index 833a4fb..aff3c4c 100644
--- a/Objective-C/libobjcl.m
+++ b/Objective-C/libobjcl.m
@@ -199,6 +199,8 @@ _objcl_invoke_method (id self_,
[invocation getReturnValue: result_ptr];
if (result->type[0] == '#')
NSLog (@"Returning: %@", result->data.id_val);
+ else
+ NSLog (@"Returning.");
}
@@ -255,6 +257,46 @@ objcl_invoke_method (OBJCL_OBJ_DATA receiver,
}
+void
+objcl_invoke_with_types (void *receiver,
+ SEL method_selector,
+ char *(types[]),
+ size_t arg_sizes[],
+ id *exception,
+ void *return_value,
+ int argc,
+ ...)
+{
+ va_list arglist;
+ IMP method;
+ int i;
+
+ *exception = NULL;
+
+#ifdef __NEXT_RUNTIME__
+ method = class_getInstanceMethod ([obj class], method_selector)->method_imp;
+#else
+ method = objc_msg_lookup (receiver, method_selector);
+#endif
+
+ NS_DURING
+ {
+ va_start (arglist, argc);
+ for (i = 0; i < argc; i++)
+ {
+ va_arg (arglist, OBJCL_OBJ_DATA);
+ }
+ va_end (arglist);
+ }
+ NS_HANDLER
+ {
+ *exception = localException;
+ NS_VOIDRETURN;
+ }
+ NS_ENDHANDLER
+}
+
+
OBJCL_OBJ_DATA
objcl_find_class (const char *class_name)
{