1 #import <GraphicsServices/GraphicsServices.h>
2 #import <UIKit/UIKit.h>
6 static CFArrayRef (*$GSSystemCopyCapability)(CFStringRef);
7 static CFArrayRef (*$GSSystemGetCapability)(CFStringRef);
9 int main(int argc, char *argv[]) {
10 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
15 name = [NSString stringWithUTF8String:argv[0]];
17 fprintf(stderr, "usage: %s [capability]\n", argv[0]);
21 $GSSystemCopyCapability = reinterpret_cast<CFArrayRef (*)(CFStringRef)>(dlsym(RTLD_DEFAULT, "GSSystemCopyCapability"));
22 $GSSystemGetCapability = reinterpret_cast<CFArrayRef (*)(CFStringRef)>(dlsym(RTLD_DEFAULT, "GSSystemGetCapability"));
24 const NSArray *capability;
26 if ($GSSystemCopyCapability != NULL) {
27 capability = reinterpret_cast<const NSArray *>((*$GSSystemCopyCapability)(reinterpret_cast<CFStringRef>(name)));
28 capability = [capability autorelease];
29 } else if ($GSSystemGetCapability != NULL) {
30 capability = reinterpret_cast<const NSArray *>((*$GSSystemGetCapability)(reinterpret_cast<CFStringRef>(name)));
34 NSLog(@"%@", capability);
36 /*for (NSString *value in capability)
37 printf("%s\n", [value UTF8String]);*/