summaryrefslogtreecommitdiff
path: root/Objective-C
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2007-09-26 00:40:55 +0200
committerMatthias Benkard <code@mail.matthias.benkard.de>2007-09-26 00:40:55 +0200
commit6bda4966b9885c19dff28fe218a2923bc2ecd4db (patch)
treea4cef7a806236b1ac87d6df7e6155e060c1d4af5 /Objective-C
parent3c913501dd064a8e8411a88f7c6992587e9033cb (diff)
Add FIND-OBJC-META-CLASS, fix some minor bugs.
darcs-hash:1ae0dd35e64b278b944bc797847ccfedb97ea471
Diffstat (limited to 'Objective-C')
-rw-r--r--Objective-C/libobjcl.h3
-rw-r--r--Objective-C/libobjcl.m20
2 files changed, 23 insertions, 0 deletions
diff --git a/Objective-C/libobjcl.h b/Objective-C/libobjcl.h
index 35fd0c8..56ba2d7 100644
--- a/Objective-C/libobjcl.h
+++ b/Objective-C/libobjcl.h
@@ -43,6 +43,9 @@ objcl_invoke_with_types (int argc,
Class
objcl_find_class (const char *class_name);
+Class
+objcl_find_meta_class (const char *class_name);
+
SEL
objcl_find_selector (const char *selector_name);
diff --git a/Objective-C/libobjcl.m b/Objective-C/libobjcl.m
index c13f252..6f09cfe 100644
--- a/Objective-C/libobjcl.m
+++ b/Objective-C/libobjcl.m
@@ -128,7 +128,27 @@ objcl_invoke_with_types (int argc,
Class
objcl_find_class (const char *class_name)
{
+#ifdef __NEXT_RUNTIME__
+ return objc_lookUpClass (class_name);
+#else
return NSClassFromString ([NSString stringWithUTF8String: class_name]);
+#endif
+}
+
+
+Class
+objcl_find_meta_class (const char *class_name)
+{
+#ifdef __NEXT_RUNTIME__
+ return objc_getMetaClass (class_name);
+#else
+ /* FIXME: Is this correct? */
+ Class class = objcl_find_class (class_name);
+ if (class == NULL || class == nil)
+ return NULL;
+ else
+ return class_get_meta_class (class);
+#endif
}