int idaapi accept_file(linput_t *fp, char fileformatname[MAX_FILE_FORMAT_NAME], int n)
{
  if (n) return(0);

  rel_track test_valid(fp);

  // Check if valid
  if (!test_valid.is_good())
    return 0;

  // file has passed all sanity checks and might be a rel
  qstrncpy(fileformatname, "Nintendo REL", MAX_FILE_FORMAT_NAME);
  return(ACCEPT_FIRST | 0xD07);
}
Exemple #2
0
static int	main_tests(int argc, char **argv, int *fd, t_init *n)
{
	if (argc < 2 || (*fd = open(argv[1], O_RDONLY)) < 0)
	{
		ft_putstr("open error or too few arguments.\n");
		return (-1);
	}
	if ((get_line_and_len(*fd, &n->parsed)) < 0)
	{
		ft_putstr("read error.");
		return (-2);
	}
	if ((test_valid(n->parsed, n)) < 0)
	{
		ft_putstr("parse error, file is |\n");
		ft_putstr(n->parsed);
		return (-3);
	}
	return (-5);
}
Exemple #3
0
Fichier : ops5.c Projet : mpw/p2
void pop_ws(void)
{
  /* Step 1: toss top of wait stack - return if at end */

  reset_start(wsc);
  if (end_adv(wsc))
    return;
  delete(wsc);
  adv(wsc);

  /* Step 2: continue popping items that are no longer valid
             or the wait stack is empty */

  while( !end_adv(wsc) ) {
      if (test_valid(wsc.cont, wsc.cursor_position))
         return;
      delete(wsc);
      adv(wsc);
  }
}