コード例 #1
0
int main(void) {
    initialise_screen();
    initialise_serial();
    init_multithread();

    execute_parallel(thread1, thread2);

    return 0;
}
コード例 #2
0
ファイル: main.c プロジェクト: caiboyang/CS
int
main (int argc, char **argv)
{
  int opt;
  int command_number = 1;
  int print_tree = 0;
  int time_travel = 0;
  program_name = argv[0];

  for (;;)
    switch (getopt (argc, argv, "pt"))
      {
      case 'p': print_tree = 1; break;
      case 't': time_travel = 1; break;
      default: usage (); break;
      case -1: goto options_exhausted;
      }
 options_exhausted:;

  // There must be exactly one file argument.
  if (optind != argc - 1)
    usage ();

  script_name = argv[optind];
  FILE *script_stream = fopen (script_name, "r");
  if (! script_stream)
    error (1, errno, "%s: cannot open", script_name);
  command_stream_t command_stream =
    make_command_stream (get_next_byte, script_stream);

  command_t last_command = NULL;
  command_t command;
  while ((command = read_command_stream (command_stream)))
    {
      if (print_tree)
	{
	  printf ("# %d\n", command_number++);
	  print_command (command);
	}
      else
	{
	  last_command = command;
	  execute_command (command, time_travel);
	}
    }
    if(time_travel){
   // execute_command (command, time_travel);
  build_dependency();
  separate_list();
 execute_parallel();
  }

  return print_tree || !last_command ? 0 : command_status (last_command);
}
コード例 #3
0
ファイル: breakmeggy.c プロジェクト: nelfin/yameggyjros
int main(void) {
    initialise_multithreading();
    initialise_screen();
    initialise_keys();
    enable_sound();

    for (;;) {
        pause_screen();
        die_anim(150);
        execute_parallel(play_breakmeggy, play_bgmusic);
    }

    return 0;
}