Exemplo n.º 1
0
int
main(int argc, char *argv[])
{
	char *config = serenity_config(argc, argv);
	int rc;
	rc = sn_init(&serenity, config);
	if (rc == -1)
		return 1;
	rc = sn_open(&serenity);
	if (rc == -1)
		goto shutdown;
	sn_start(&serenity);
shutdown:
	sn_shutdown(&serenity);
	return 0;
}
Exemplo n.º 2
0
int main(int argc, char **argv) {
  int a_origin_size;
  int i, max;

  signal(SIGCHLD, sigchld_handler);
  signal(SIGTERM, clean);
  signal(SIGQUIT, clean);
  
  if(argc == 1) {
    printf("введите количество элементов в массиве: ");
    fflush(stdout);
  }
  
  scanf("%d", &a_origin_size);

  if(a_origin_size <= 0) {
    exit(0);
  }
  
  a_size = round2(a_origin_size);

  sn_init();

  for(i = max = 0; i < a_origin_size; i++) {
    scanf("%d", array + i);
    max = MAX(array[i], max);
  }
  for(; i < a_size; array[i++] = max);
  
  if(a_origin_size > 1) {
    build_schedule();
    //print_schedule();

    run();
  }

  for(i = 0; i < a_origin_size; printf("%d ", array[i++]));
  printf("\n");

  clean(0);
  
  return 0;
}
Exemplo n.º 3
0
/*
 * A pseudo-main function that handles command line processing, opening of
 * source files and invoking the parser on those files.
 */
int sn_main(int argc, char *argv[], char * group, FILE ** lexstream, int (*lexer)(), void (*reset)())
{
	sn_set_group(group);

	sn_process_options(argc, argv);

	if (optind < argc || sn_getopt(SN_OPT_LISTFILE))
	{
		sn_init();

		if ((char *) sn_getopt(SN_OPT_LISTFILE) != NULL)
		{
			/* This part is called when the project is being created. */
			sn_parse_all(lexstream, lexer, reset);
		}
		else
		{
			/*
			 * This part is called when a file has been saved, thus we parse the
			 * file.
			 */

			if (sn_register_filename(lexstream, argv[optind]) == 0)
			{
				reset();
				lexer();
			}
		}
	}
	else
	{
		sn_parser_help();
		sn_error("-y or file name required\n");
		return(1);
	}
	sn_close();
	return(0);
}
Exemplo n.º 4
0
Arquivo: main.c Projeto: hoglet67/b-em
void main_reset()
{
        m6502_reset();
        crtc_reset();
        video_reset();
        sysvia_reset();
        uservia_reset();
        serial_reset();
        acia_reset(&sysacia);
        wd1770_reset();
        i8271_reset();
        scsi_reset();
        vdfs_reset();
        sid_reset();
        music4000_reset();
        music5000_reset();
        sn_init();
        if (curtube != -1) tubes[curtube].reset();
        else               tube_exec = NULL;
        tube_reset();

        memset(ram, 0, 64 * 1024);
}