This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
2017-03-18 23:04:38 +10:00

41 lines
602 B
C

#include <string.h>
#include <ctype.h>
#include <oslib/os.h>
#include <oslib/ospattern.h>
bool osCheckPattern(char *pattern)
{
return(TRUE);
}
bool osMatchPattern(char *pattern,char *str)
{
int c;
for(c=0;pattern[c];c++)
{
if(pattern[c]=='*')
return(TRUE);
if(str[c] == 0)
return(FALSE);
if(pattern[c]!='?' && tolower(pattern[c])!=tolower(str[c]))
return(FALSE);
}
if(str[c]!=0)
return(FALSE);
return(TRUE);
}
bool osIsPattern(char *pat)
{
if(strchr(pat,'?') || strchr(pat,'*'))
return(TRUE);
return(FALSE);
}