21 #include "../../SDL_internal.h"
23 #ifdef SDL_FILESYSTEM_COCOA
28 #include <Foundation/Foundation.h>
30 #include <sys/types.h>
41 NSBundle *bundle = [NSBundle mainBundle];
42 const char* baseType = [[[bundle infoDictionary] objectForKey:@"SDL_FILESYSTEM_BASE_DIR_TYPE"] UTF8String];
43 const char *base =
NULL;
46 if (baseType ==
NULL) {
47 baseType =
"resource";
50 base = [[bundle bundlePath] fileSystemRepresentation];
52 base = [[[bundle bundlePath] stringByDeletingLastPathComponent] fileSystemRepresentation];
55 base = [[bundle resourcePath] fileSystemRepresentation];
85 NSArray *
array = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
103 NSArray *
array = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
107 NSString *str = [array objectAtIndex:0];
108 const char *base = [str fileSystemRepresentation];
121 for (ptr =
retval+1; *ptr; ptr++) {