int main(int ac, char **av) { char *rf; int rl=0; void *tbuff; int j,c; int mem=-1, col=-1, hog=-1; argv=av; #ifdef USE_VM vmtest(); #endif SetParams(ac, av); uqlxInit(); QLRun(); }
int main (int argc, char *argv[]) { vm_mode_t mode = vm_normal_mode; int x, y, z; int i = 1; while (i < argc && argv[i][0] == '-') { char *arg = argv[i]; int j = 1; while (arg[j] != '\0') { switch (arg[j]) { case 't': mode = vm_trace_mode; break; case 's': mode = vm_step_mode; break; default: fprintf(stderr, "usage: %s [-t][-s] x y z\n", argv[0]); return EXIT_FAILURE; } j++; } i++; } if (argc < i + 3) { fprintf(stderr, "usage: %s [-t][-s] x y z\n", argv[0]); return EXIT_FAILURE; } x = atoi(argv[i]); y = atoi(argv[i+1]); z = atoi(argv[i+2]); vmtest(x, y, z, mode); return EXIT_SUCCESS; }