示例#1
0
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
	return common_main();
} // WinMain
示例#2
0
文件: ap_main.c 项目: zenhack/zero
void ap_main(void) {
	remap_8259pic();
	disable_8259pic();
	apic_setup();
	apic_timer_init(APIC_TIMER_INT_NO, 7, APIC_TIMER_PERIODIC);
	apic_timer_set(apic_timer_init_count);
	common_main();
}
示例#3
0
文件: main.cpp 项目: Jaa-c/GPU-led
/** The main. */
int main(int argc, char* argv[]) 
{
    return common_main(g_WindowWidth, g_WindowHeight,
                       "[39GPU] Ice melting simulation",
                       cbInitGL,              // init GL callback function
                       cbDisplay,             // display callback function
                       cbWindowSizeChanged,   // window resize callback function
                       cbKeyboardChanged,     // keyboard callback function
                       NULL,                  // mouse button callback function
                       NULL                   // mouse motion callback function
                       );
}
示例#4
0
int main(int argc, char *argv[])
{
	return common_main();
} // main
示例#5
0
int main(int argc, char ** argv)
{
    return common_main(argc, argv);
}
示例#6
0
文件: mkdir.c 项目: gawen947/sunix
int main(int argc, char *argv[])
{
  int ch, exitval, success, pflag;
  mode_t omode;
  void *set = NULL;
  char *mode;

  struct option opts[] = {
    { "mode", required_argument, NULL, 'm' },
    { "parents", no_argument, NULL, 'p' },
    { "verbose", no_argument, NULL, 'v' },
    { "context", required_argument, NULL, 'Z' },
    { NULL, 0, NULL, 0 }
  };

  common_main(argc, argv, "mkdir", "/bin/mkdir.real", usage, opts);

  omode = pflag = 0;
  mode = NULL;
  while ((ch = getopt_long(argc, argv, "m:pvZ:", opts, NULL)) != -1)
    switch(ch) {
    case 'm':
      mode = optarg;
      break;
    case 'p':
      pflag = 1;
      break;
    case 'v':
      vflag = 1;
      break;
    case 'Z':
      warnx("SELinux not implemented");
      break;
    default:
    case '?':
      record_invalid(argv[0], argv[optind - 1]);
      usage();
    }

  argc -= optind;
  argv += optind;
  if (argv[0] == NULL)
    usage();

  if (mode == NULL) {
    omode = S_IRWXU | S_IRWXG | S_IRWXO;
  } else {
    if ((set = setmode(mode)) == NULL)
      errx(1, "invalid file mode: %s", mode);
    omode = getmode(set, S_IRWXU | S_IRWXG | S_IRWXO);
    free(set);
  }

  for (exitval = 0; *argv != NULL; ++argv) {
    if (pflag) {
      success = build(*argv, omode);
    } else if (mkdir(*argv, omode) < 0) {
      if (errno == ENOTDIR || errno == ENOENT)
        warn("%s", dirname(*argv));
      else
        warn("%s", *argv);
      success = 0;
    } else {
      success = 1;
      if (vflag)
        (void)printf("%s\n", *argv);
    }
    if (!success)
      exitval = 1;
    /*
     * The mkdir() and umask() calls both honor only the low
     * nine bits, so if you try to set a mode including the
     * sticky, setuid, setgid bits you lose them.  Don't do
     * this unless the user has specifically requested a mode,
     * as chmod will (obviously) ignore the umask.  Do this
     * on newly created directories only.
     */
    if (success == 1 && mode != NULL && chmod(*argv, omode) == -1) {
      warn("%s", *argv);
      exitval = 1;
    }
  }
  exit(exitval);
}