void real_main (int argc, TCHAR **argv) { show_version_full (); restart_program = 1; fetch_configurationpath (restart_config, sizeof (restart_config) / sizeof (TCHAR)); _tcscat (restart_config, OPTIONSFILENAME); default_config = 1; // -------- FIXME keyboard_settrans (); #ifdef CATWEASEL catweasel_init (); #endif while (restart_program) { int ret; changed_prefs = currprefs; ret = real_main2 (argc, argv); if (ret == 0 && quit_to_gui) restart_program = 1; leave_program (); quit_program = 0; } zfile_exit (); }
static void parse_cmdline (int argc, char **argv) { int i; for (i = 1; i < argc; i++) { if (strcmp (argv[i], "-cfgparam") == 0) { if (i + 1 < argc) i++; } else if (strncmp (argv[i], "-config=", 8) == 0) { #ifdef FILESYS free_mountinfo (currprefs.mountinfo); currprefs.mountinfo = alloc_mountinfo (); #endif if (cfgfile_load (&currprefs, argv[i] + 8, 0)) strcpy (optionsfile, argv[i] + 8); } /* Check for new-style "-f xxx" argument, where xxx is config-file */ else if (strcmp (argv[i], "-f") == 0) { if (i + 1 == argc) { write_log ("Missing argument for '-f' option.\n"); } else { #ifdef FILESYS free_mountinfo (currprefs.mountinfo); currprefs.mountinfo = alloc_mountinfo (); #endif if (cfgfile_load (&currprefs, argv[++i], 0)) strcpy (optionsfile, argv[i]); } } else if (strcmp (argv[i], "-s") == 0) { if (i + 1 == argc) write_log ("Missing argument for '-s' option.\n"); else cfgfile_parse_line (&currprefs, argv[++i], 0); } else if (strcmp (argv[i], "-h") == 0 || strcmp (argv[i], "-help") == 0) { usage (); exit (0); } else if (strcmp (argv[i], "-version") == 0) { show_version_full (); exit (0); } else if (strcmp (argv[i], "-scsilog") == 0) { log_scsi = 1; } else { if (argv[i][0] == '-' && argv[i][1] != '\0') { const char *arg = argv[i] + 2; int extra_arg = *arg == '\0'; if (extra_arg) arg = i + 1 < argc ? argv[i + 1] : 0; if (parse_cmdline_option (&currprefs, argv[i][1], (char*)arg) && extra_arg) i++; } } } }
void real_main (int argc, TCHAR **argv) { show_version_full (); restart_program = 1; fetch_configurationpath (restart_config, sizeof (restart_config) / sizeof (TCHAR)); _tcscat (restart_config, OPTIONSFILENAME); default_config = 1; #ifdef NATMEM_OFFSET preinit_shm (); #endif write_log (_T("Enumerating display devices.. \n")); enumeratedisplays (); write_log (_T("Sorting devices and modes..\n")); sortdisplays (); // write_log (_T("Display buffer mode = %d\n"), ddforceram); // enumerate_sound_devices (); write_log (_T("done\n")); keyboard_settrans (); #ifdef CATWEASEL catweasel_init (); #endif #ifdef PARALLEL_PORT paraport_mask = paraport_init (); #endif while (restart_program) { int ret; changed_prefs = currprefs; ret = real_main2 (argc, argv); if (ret == 0 && quit_to_gui) restart_program = 1; leave_program (); quit_program = 0; } zfile_exit (); }