Merge pull request #10 from gunyarakun/fix-invalid-return
[cocotron.git] / CoreFoundation / CFBundle.m
blobee596d688b0acdc05b21456375ed8af612578c27
1 #import <CoreFoundation/CFBundle.h>
2 #import <Foundation/NSBundle.h>
3 #import <Foundation/NSString.h>
5 const CFStringRef kCFBundleNameKey=(CFStringRef)@"CFBundleName";
6 const CFStringRef kCFBundleVersionKey=(CFStringRef)@"CFBundleVersion";
7 const CFStringRef kCFBundleIdentifierKey=(CFStringRef)@"CFBundleIdentifier";
8 const CFStringRef kCFBundleInfoDictionaryVersionKey=(CFStringRef)@"CFBundleInfoDictionaryVersion";
9 const CFStringRef kCFBundleLocalizationsKey=(CFStringRef)@"CFBundleLocalizations";
10 const CFStringRef kCFBundleExecutableKey=(CFStringRef)@"CFBundleExecutable";
11 const CFStringRef kCFBundleDevelopmentRegionKey=(CFStringRef)@"CFBundleDevelopmentRegion";
13 #define NSBundleToCFBundle(x) ((CFBundleRef)x)
14 #define CFBundleToNSBundle(x) ((NSBundle *)x)
16 CFBundleRef CFBundleGetMainBundle(void) {
17    return NSBundleToCFBundle([NSBundle mainBundle]);
20 CFTypeRef CFBundleGetValueForInfoDictionaryKey(CFBundleRef self,CFStringRef key) {
21    return [CFBundleToNSBundle(self) objectForInfoDictionaryKey:(NSString *)key];