static void init_console_in() { if (!console_in) { console_in = GetStdHandle(STD_INPUT_HANDLE); MZ_REGISTER_STATIC(console_inport); console_inport = scheme_make_fd_input_port((int)console_in, scheme_intern_symbol("stdin"), 0, 0); } }
void wxDrop_GetArgs(int *argc, char ***argv, int *in_terminal) { *in_terminal = 1; MZ_REGISTER_STATIC(scheme_mac_argv); Install(); while (!scheme_mac_ready) { EventRecord event; WaitNextEvent(highLevelEventMask, &event, 0x7FFFFFFF, 0L); if (event.what == kHighLevelEvent) { AEProcessAppleEvent(&event); } } #ifdef OS_X { int from_finder; from_finder = (((*argc) > 1) && (strncmp((*argv)[1],"-psn_",5) == 0)); if (from_finder) { /* Finder started app, or someone wants us to think so; set *in_terminal to 0 and combine AE-based command-line with given command line */ int i, new_argc; char **new_argv; *in_terminal = 0; new_argc = (scheme_mac_argc - 1) + ((*argc) - 2) + 1; new_argv = (char **)malloc(new_argc * sizeof(char *)); new_argv[0] = (*argv)[0]; for (i = 2; i < (*argc); i++) { new_argv[i - 1] = (*argv)[i]; } for (; i < new_argc + 1; i++) { new_argv[i - 1] = scheme_mac_argv[i - (*argc) + 1]; } scheme_mac_argc = new_argc; scheme_mac_argv = new_argv; } else { /* command-line start; no AE arguments */ scheme_mac_argc = *argc; scheme_mac_argv = *argv; } GetStarterInfo(); /* Open the PLT_MrEd framework resources: */ { CFBundleRef fwBundle; fwBundle = CFBundleGetBundleWithIdentifier(CFSTR("org.plt-scheme.PLT_MrEd")); if (fwBundle) { SInt16 refNum; SInt16 lRefNum; CFBundleOpenBundleResourceFiles(fwBundle, &refNum, &lRefNum); } } } #endif *argc = scheme_mac_argc; *argv = scheme_mac_argv; }