- Timestamp:
- 07/20/06 11:16:20 (18 years ago)
- Location:
- trunk/launch/launch
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/launch/launch/README
r214 r265 1 launch 1. 0.1 [3 April 2005]1 launch 1.1d2 [unreleased] 2 2 ============ 3 3 … … 63 63 An Xcode project, 'launch.xcodeproj', is included. A precompiled Universal 64 64 binary is also provided. 'launch' was developed and tested under Mac OS X 65 10.4. 5 with Xcode 2.2.1, and does not require any additional software to65 10.4.7 with Xcode 2.3, and does not require any additional software to 66 66 build. 67 67 … … 223 223 224 224 1.1 - unreleased 225 - -L: send "launch" (ascr/noop) event to app, bypasses automatic 225 226 - -o: pass command-line arguments (broken, r. 4474993) 227 opening of untitled document, etc. 226 228 - display content type ID (UTI) 227 229 - switched to new LSOpen APIs (now requires Mac OS X 10.4 or later) 230 - switched to new date formatting APIs (the old ones are deprecated) 228 231 - for compatibility with open(1), take app path as argument to -a 229 232 1.0.1 - 3 April 2005 -
trunk/launch/launch/VERSION
r214 r265 1 1.1d 11 1.1d2 -
trunk/launch/launch/launch.xcodeproj/project.pbxproj
r215 r265 206 206 i386, 207 207 ); 208 MACOSX_DEPLOYMENT_TARGET = 10. 2;208 MACOSX_DEPLOYMENT_TARGET = 10.4; 209 209 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 210 210 }; … … 218 218 i386, 219 219 ); 220 MACOSX_DEPLOYMENT_TARGET = 10. 2;220 MACOSX_DEPLOYMENT_TARGET = 10.4; 221 221 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 222 222 }; … … 230 230 i386, 231 231 ); 232 MACOSX_DEPLOYMENT_TARGET = 10. 2;232 MACOSX_DEPLOYMENT_TARGET = 10.4; 233 233 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; 234 234 }; -
trunk/launch/launch/main.c
r214 r265 33 33 const char *APP_NAME; 34 34 35 #define VERSION "1.1d 1"35 #define VERSION "1.1d2" 36 36 37 37 #define STRBUF_LEN 1024 … … 92 92 93 93 void usage() { 94 fprintf(stderr, "usage: %s [-npswbmhCX U] [-c creator] [-i bundleID] [-u URL] [-a name] [-o argument] [item ...] [-]\n"95 " or: %s [-npflswbmhCX U] [-o argument] item ...\n", APP_NAME, APP_NAME);94 fprintf(stderr, "usage: %s [-npswbmhCXLU] [-c creator] [-i bundleID] [-u URL] [-a name] [-o argument] [item ...] [-]\n" 95 " or: %s [-npflswbmhCXLU] [-o argument] item ...\n", APP_NAME, APP_NAME); 96 96 fprintf(stderr, 97 97 " -n print matching paths/URLs instead of opening them\n" … … 108 108 " -C force CFM/PEF Carbon application to launch in Classic\n" 109 109 " -X don't start Classic for this app if Classic isn't running\n" 110 " -L suppress normal opening behavior (e.g. untitled window)\n" 110 111 " -U interpret items as URLs, even if same-named files exist\n" 111 112 " -c creator match application by four-character creator code ('ToyS')\n" … … 331 332 if (argc == 1) usage(); 332 333 333 while ( (ch = getopt(argc, argv, "npflswbmhCX Uc:i:u:a:o:")) != -1) {334 while ( (ch = getopt(argc, argv, "npflswbmhCXLUc:i:u:a:o:")) != -1) { 334 335 switch (ch) { 335 336 case 'n': … … 374 375 case 'C': LPARAMS.flags |= kLSLaunchInClassic; break; // force Classic 375 376 case 'X': LPARAMS.flags ^= kLSLaunchStartClassic; break;// don't start Classic for app 377 case 'L': 378 { 379 OSStatus err; 380 LPARAMS.initialEvent = malloc(sizeof(AppleEvent)); 381 err = AECreateAppleEvent(kASAppleScriptSuite, kASLaunchEvent, NULL, kAutoGenerateReturnID, kAnyTransactionID, LPARAMS.initialEvent); 382 if (err != noErr) osstatusexit(err, "unable to construct launch Apple Event", argv[0]); 383 } 376 384 case 'U': OPTS.forceURLs = true; break; 377 385 case 'c': … … 531 539 532 540 void printDateTime(const char *label, UTCDateTime *utcTime, const char *postLabel, Boolean printIfEmpty) { 533 static Str255 dateStr, timeStr; 534 LocalDateTime localTime; 535 LongDateTime longTime; 541 static CFDateFormatterRef formatter = NULL; 542 static char strBuffer[STRBUF_LEN]; 543 if (formatter == NULL) { 544 formatter = CFDateFormatterCreate(NULL, CFLocaleCopyCurrent(), kCFDateFormatterShortStyle, kCFDateFormatterMediumStyle); 545 } 546 CFAbsoluteTime absoluteTime; 536 547 OSStatus err; 537 548 538 err = ConvertUTCToLocalDateTime(utcTime, &localTime);549 err = UCConvertUTCDateTimeToCFAbsoluteTime(utcTime, &absoluteTime); 539 550 if (err == kUTCUnderflowErr) { 540 551 if (printIfEmpty) printf("\t%s: (not set)\n", label); 541 552 return; 542 553 } 543 if (err != noErr) osstatusexit(err, "unable to convert UTC %s date to local", label); 544 545 longTime = localTime.highSeconds; 546 longTime <<= 32; 547 longTime |= localTime.lowSeconds; 548 549 // strings include trailing newlines; strip them. 550 LongDateString(&longTime, shortDate, dateStr, nil); dateStr[dateStr[0] + 1] = '\0'; 551 LongTimeString(&longTime, true, timeStr, nil); timeStr[timeStr[0] + 1] = '\0'; 552 printf("\t%s: %s %s%s\n", label, dateStr + 1, timeStr + 1, postLabel); 554 if (err != noErr) osstatusexit(err, "unable to convert UTC %s time", label); 555 556 CFStringRef dateTimeString = CFDateFormatterCreateStringWithAbsoluteTime(NULL, formatter, absoluteTime); 557 CFStringGetCString(dateTimeString, strBuffer, STRBUF_LEN, kCFStringEncodingUTF8); 558 559 printf("\t%s: %s%s\n", label, strBuffer, postLabel); 553 560 } 554 561
Note:
See TracChangeset
for help on using the changeset viewer.