yangsu@google.com | 2eff7e2 | 2011-06-24 15:57:30 +0000 | [diff] [blame] | 1 | #import <UIKit/UIKit.h> |
yangsu@google.com | 688823f | 2011-08-30 19:14:13 +0000 | [diff] [blame] | 2 | #include "SkApplication.h" |
caryclark@google.com | 5987f58 | 2012-10-02 18:33:14 +0000 | [diff] [blame] | 3 | |
caryclark | 936b734 | 2014-07-11 12:14:51 -0700 | [diff] [blame^] | 4 | extern bool set_cmd_line_args(int argc, char *argv[], const char* dir); |
caryclark@google.com | 5987f58 | 2012-10-02 18:33:14 +0000 | [diff] [blame] | 5 | |
yangsu@google.com | 2eff7e2 | 2011-06-24 15:57:30 +0000 | [diff] [blame] | 6 | int main(int argc, char *argv[]) { |
yangsu@google.com | 2e20c24 | 2011-07-07 19:26:42 +0000 | [diff] [blame] | 7 | signal(SIGPIPE, SIG_IGN); |
yangsu@google.com | 2eff7e2 | 2011-06-24 15:57:30 +0000 | [diff] [blame] | 8 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; |
yangsu@google.com | 688823f | 2011-08-30 19:14:13 +0000 | [diff] [blame] | 9 | application_init(); |
caryclark | 936b734 | 2014-07-11 12:14:51 -0700 | [diff] [blame^] | 10 | // Identify the documents directory |
| 11 | NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); |
| 12 | NSString *docsDir = [dirPaths objectAtIndex:0]; |
| 13 | const char *d = [docsDir UTF8String]; |
| 14 | |
| 15 | bool ranCommand = set_cmd_line_args(argc, argv, d); |
| 16 | int retVal = ranCommand ? 0 : UIApplicationMain(argc, argv, nil, nil); |
yangsu@google.com | 688823f | 2011-08-30 19:14:13 +0000 | [diff] [blame] | 17 | application_term(); |
yangsu@google.com | 2eff7e2 | 2011-06-24 15:57:30 +0000 | [diff] [blame] | 18 | [pool release]; |
| 19 | return retVal; |
| 20 | } |