mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-24 23:22:25 +01:00
byuu says: Basically just a project rename, with s/bsnes/higan and the new icon from lowkee added in. It won't compile on Windows because I forgot to update the resource.rc file, and a path transform command isn't working on Windows. It was really just meant as a starting point, so that v091 WIPs can flow starting from .00 with the new name (it overshadows bsnes v091, so publicly speaking this "shouldn't exist" and will probably be deleted from Google Code when v092 is ready.)
79 lines
1.5 KiB
C++
Executable File
79 lines
1.5 KiB
C++
Executable File
#ifdef NALL_STRING_INTERNAL_HPP
|
|
|
|
namespace nall {
|
|
|
|
bool wildcard(const char *s, const char *p) {
|
|
const char *cp = 0, *mp = 0;
|
|
while(*s && *p != '*') {
|
|
if(*p != '?' && *s != *p) return false;
|
|
p++, s++;
|
|
}
|
|
while(*s) {
|
|
if(*p == '*') {
|
|
if(!*++p) return true;
|
|
mp = p, cp = s + 1;
|
|
} else if(*p == '?' || *p == *s) {
|
|
p++, s++;
|
|
} else {
|
|
p = mp, s = cp++;
|
|
}
|
|
}
|
|
while(*p == '*') p++;
|
|
return !*p;
|
|
}
|
|
|
|
bool iwildcard(const char *s, const char *p) {
|
|
const char *cp = 0, *mp = 0;
|
|
while(*s && *p != '*') {
|
|
if(*p != '?' && chrlower(*s) != chrlower(*p)) return false;
|
|
p++, s++;
|
|
}
|
|
while(*s) {
|
|
if(*p == '*') {
|
|
if(!*++p) return true;
|
|
mp = p, cp = s + 1;
|
|
} else if(*p == '?' || chrlower(*p) == chrlower(*s)) {
|
|
p++, s++;
|
|
} else {
|
|
p = mp, s = cp++;
|
|
}
|
|
}
|
|
while(*p == '*') p++;
|
|
return !*p;
|
|
}
|
|
|
|
inline bool tokenize(const char *s, const char *p) {
|
|
while(*s) {
|
|
if(*p == '*') {
|
|
while(*s) if(tokenize(s++, p + 1)) return true;
|
|
return !*++p;
|
|
}
|
|
if(*s++ != *p++) return false;
|
|
}
|
|
while(*p == '*') p++;
|
|
return !*p;
|
|
}
|
|
|
|
inline bool tokenize(lstring &list, const char *s, const char *p) {
|
|
while(*s) {
|
|
if(*p == '*') {
|
|
const char *b = s;
|
|
while(*s) {
|
|
if(tokenize(list, s++, p + 1)) {
|
|
list.prepend(substr(b, 0, --s - b));
|
|
return true;
|
|
}
|
|
}
|
|
list.prepend(b);
|
|
return !*++p;
|
|
}
|
|
if(*s++ != *p++) return false;
|
|
}
|
|
while(*p == '*') { list.prepend(s); p++; }
|
|
return !*p;
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|