OLD | NEW |
1 #import <UIKit/UIKit.h> | 1 #import <UIKit/UIKit.h> |
2 #include "SkApplication.h" | 2 #include "SkApplication.h" |
3 | 3 |
4 extern bool set_cmd_line_args(int argc, char *argv[], const char* dir); | |
5 | |
6 int main(int argc, char *argv[]) { | 4 int main(int argc, char *argv[]) { |
7 signal(SIGPIPE, SIG_IGN); | 5 signal(SIGPIPE, SIG_IGN); |
8 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; | 6 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; |
9 application_init(); | 7 application_init(); |
10 // Identify the documents directory | 8 // Identify the documents directory |
11 NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES); | 9 NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES); |
12 NSString *docsDir = [dirPaths objectAtIndex:0]; | 10 NSString *docsDir = [dirPaths objectAtIndex:0]; |
13 const char *d = [docsDir UTF8String]; | 11 const char *d = [docsDir UTF8String]; |
14 | 12 IOS_launch_type launchType = set_cmd_line_args(argc, argv, d); |
15 bool ranCommand = set_cmd_line_args(argc, argv, d); | 13 int retVal = launchType == kApplication__iOSLaunchType |
16 int retVal = ranCommand ? 0 : UIApplicationMain(argc, argv, nil, nil); | 14 ? UIApplicationMain(argc, argv, nil, nil) : (int) launchType; |
17 application_term(); | 15 application_term(); |
18 [pool release]; | 16 [pool release]; |
19 return retVal; | 17 return retVal; |
20 } | 18 } |
OLD | NEW |