summaryrefslogtreecommitdiff
path: root/Objective-C/libobjcl.m
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2007-08-06 17:02:02 +0200
committerMatthias Benkard <code@mail.matthias.benkard.de>2007-08-06 17:02:02 +0200
commit6ac284ebf50cc18f42115db05feecbccd659f8eb (patch)
tree9562daa531f5f7da330983742cc888fbbd7feea3 /Objective-C/libobjcl.m
parent676e99eaf8991168cf33c24921b8d63b381fea20 (diff)
Add the FIND-SELECTOR function.
darcs-hash:7d6f843c808b3d130201c85c6e806d68f5a9079c
Diffstat (limited to 'Objective-C/libobjcl.m')
-rw-r--r--Objective-C/libobjcl.m22
1 files changed, 19 insertions, 3 deletions
diff --git a/Objective-C/libobjcl.m b/Objective-C/libobjcl.m
index 41d165c..7208498 100644
--- a/Objective-C/libobjcl.m
+++ b/Objective-C/libobjcl.m
@@ -164,7 +164,7 @@ _objcl_invoke_method (id self_,
}
-void *
+OBJCL_OBJ_DATA
objcl_invoke_instance_method (OBJCL_OBJ_DATA receiver,
const char *method_name,
int argc,
@@ -211,7 +211,7 @@ objcl_invoke_instance_method (OBJCL_OBJ_DATA receiver,
}
-void *
+OBJCL_OBJ_DATA
objcl_invoke_class_method (OBJCL_OBJ_DATA class,
const char *method_name,
int argc,
@@ -258,7 +258,7 @@ objcl_invoke_class_method (OBJCL_OBJ_DATA class,
}
-void *
+OBJCL_OBJ_DATA
objcl_find_class (const char *class_name)
{
Class class =
@@ -274,6 +274,22 @@ objcl_find_class (const char *class_name)
}
+OBJCL_OBJ_DATA
+objcl_find_selector (const char *class_name)
+{
+ SEL selector =
+ NSSelectorFromString ([NSString stringWithUTF8String: class_name]);
+ OBJCL_OBJ_DATA result = malloc (sizeof (struct objcl_object));
+ const char *const typespec = ":";
+
+ result->type = malloc (strlen (typespec) + 1);
+ strcpy (result->type, typespec);
+ result->data.sel_val = selector;
+
+ return result;
+}
+
+
const char *
objcl_class_name (OBJCL_OBJ_DATA class)
{