int main(int argc, char *argv[]) { // initialize Qt MultiMC app(argc, argv); Q_INIT_RESOURCE(graphics); Q_INIT_RESOURCE(generated); switch (app.status()) { case MultiMC::Initialized: return main_gui(app); case MultiMC::Failed: return 1; case MultiMC::Succeeded: return 0; } }
int main(int argc, char *argv[]) { // initialize Qt MultiMC app(argc, argv); Q_INIT_RESOURCE(instances); Q_INIT_RESOURCE(multimc); Q_INIT_RESOURCE(backgrounds); switch (app.status()) { case MultiMC::Initialized: return main_gui(app); case MultiMC::Failed: return 1; case MultiMC::Succeeded: return 0; } }
/* thread function for running the application main_gui() */ static DWORD WINAPI appThread(LPVOID par) { (void)par; /* unused parameter */ return (DWORD)main_gui(); /* run the QF-nano application */ }
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { return main_gui(hInstance, hPrevInstance, lpCmdLine, nCmdShow); }
int main(int argc, char *argv[]) { char cmd = '_'; unsigned char no_header = 0; int long_opt_ind = 0; int long_opt_val = 0; static struct option long_opts[] = { { "wii", no_argument, 0, 'w' }, { "neo2", no_argument, 0, 'q' }, { "neo3", no_argument, 0, 'z' }, { "sim", required_argument, 0, 's' }, { "config", required_argument, 0, 'd' }, { "gui", no_argument, 0, 'g' }, { "accel", no_argument, 0, 'a' }, { "new", required_argument, 0, 'n' }, { "view", required_argument, 0, 'o' }, { "train", required_argument, 0, 'e' }, { "record", required_argument, 0, 'r' }, { "upload", required_argument, 0, 'u' }, { "verbose", no_argument, 0, 'p' }, { "confirm", no_argument, 0, 'c' }, { "no-header", no_argument, 0, 'H' }, { "version", no_argument, 0, 'v' }, { "help", no_argument, 0, 'h' }, { 0, 0, 0, 0 } }; g_mode = console; g_dev = dev_none; dir[0] = '\0'; file[0] = '\0'; verbose = 0; confirm = 0; opterr = 0; while ((long_opt_val = getopt_long(argc, argv, "wqzsd:gan:o:e:rupcHvh", long_opts, &long_opt_ind)) != -1) { switch (long_opt_val) { case 'w': /* --wii */ g_dev = (g_dev == dev_none) ? dev_wii : g_dev; break; case 'q': /* --neo2 */ g_dev = (g_dev == dev_none) ? dev_neo2 : g_dev; break; case 'z': /* --neo3 */ g_dev = (g_dev == dev_none) ? dev_neo3 : g_dev; break; case 's': /* --sim */ g_dev = (g_dev == dev_none) ? dev_sim : g_dev; strncpy(sim_filename, optarg, sizeof(sim_filename)); sim_filename[sizeof(sim_filename) / sizeof(sim_filename[0]) - 1] = '\0'; break; case 'd': /* --config */ strncpy(dir, optarg, sizeof(dir)); dir[sizeof(dir) / sizeof(dir[0]) - 1] = '\0'; break; case 'n': /* --new */ case 'o': /* --view */ case 'e': /* --train */ case 'r': /* --record */ case 'u': /* --upload */ strncpy(file, optarg, sizeof(file)); file[sizeof(file) / sizeof(file[0]) - 1] = '\0'; case 'g': /* --gui */ case 'a': /* --accel */ cmd = long_opt_val; break; case 'p': /* --verbose */ verbose = 1; break; case 'c': /* --confirm */ confirm = 1; break; case 'H': /* no-header */ no_header = 1; break; case 'v': /* --version */ print_version(); exit(0); break; case 'h': /* --help */ case '?': print_usage(); exit(0); break; } } if (!no_header) { print_header(); } /* minimum requirements */ if ((g_dev == dev_none) || (dir[0] == '\0') || (cmd == '_')) { print_usage(); exit(1); } /* should be ok here */ if (cmd == 'g') /* --gui */ { g_mode = graphical; main_gui(argc, argv); } else if (cmd == 'u') { /* --upload */ chdir(dir); if (upload(file)) { printf("File '%s' uploaded successfully\n", file); fflush(stdout); } else { fprintf(stderr, "Sorry, could not upload file '%s'\n", file); fflush(stderr); exit(1); } } else { handshake(cmd); } dev_close(g_dev); return 0; }