Differences From Artifact [25c84d10d2]:
- File src/OFApplication.m — part of check-in [db16146ca3] at 2010-10-05 19:37:23 on branch trunk — Messaging nil allows this to be shortened. (user: js, size: 3510) [annotate] [blame] [check-ins using]
To Artifact [52b96796ce]:
- File
src/OFApplication.m
— part of check-in
[f282aaa672]
at
2010-10-10 12:01:52
on branch trunk
— Better storing of argc and argv.
This makes it possible to pass argc and argv to third party libs
requiring those. (user: js, size: 3672) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
40 41 42 43 44 45 46 | int of_application_main(int argc, char *argv[], Class cls) { OFApplication *app = [OFApplication sharedApplication]; id <OFApplicationDelegate> delegate = [[cls alloc] init]; | | | | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | int of_application_main(int argc, char *argv[], Class cls) { OFApplication *app = [OFApplication sharedApplication]; id <OFApplicationDelegate> delegate = [[cls alloc] init]; [app setArgumentCount: &argc andArgumentValues: &argv]; [app setDelegate: delegate]; [(id)delegate release]; [app run]; return 0; |
︙ | ︙ | |||
126 127 128 129 130 131 132 | [pool releaseObjects]; } [pool release]; return self; } | | | > > > | | | > > > > > > > | 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | [pool releaseObjects]; } [pool release]; return self; } - (void)setArgumentCount: (int*)argc_ andArgumentValues: (char***)argv_ { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; int i; [programName release]; [arguments release]; argc = argc_; argv = argv_; programName = [[OFString alloc] initWithCString: (*argv)[0]]; arguments = [[OFMutableArray alloc] init]; for (i = 1; i < *argc; i++) [arguments addObject: [OFString stringWithCString: *(argv)[i]]]; [pool release]; } - (void)getArgumentCount: (int**)argc_ andArgumentValues: (char****)argv_ { *argc_ = argc; *argv_ = argv; } - (OFString*)programName { return [[programName retain] autorelease]; } - (OFArray*)arguments |
︙ | ︙ |