Esempio n. 1
0
PMARSDLL_API int pMarsBeginMatch(int argc, char** argv, char* errFile)
{
	freopen( errFile, "w", stderr );
	if (parse_param(argc,argv)==SUCCESS) 
	{
		reset_regs();
		init();
		body_load();
		if (errorcode != SUCCESS)
		{
			freopen( "CON", "w", stderr );
			return 2;
		}
		if (rounds!=0) 
		{
			begin_match();
		}
	}
	else
	{
		freopen( "CON", "w", stderr );
		return 1;
	}
	return 0;
}
Esempio n. 2
0
int	match(char *str1, char *str2)
{
  if ((str1 == NULL) ^ (str2 == NULL))
    return (0);
  if (str1 == NULL)
    return (1);
  if (*str1 == '*')
    begin_match(&str1, &str2);
  while (*str1 || *str2)
    {
      if (*str1 != *str2 && *str1 != '*')
	return (0);
      if (*str1 == '*')
	return (match(str1, str2));
      str1++;
      str2++;
    }
  if (*str1 ^ *str2)
    return (0);
  return (1);
}