ddat interop with dat js cable interop with cabal js ddat's frontend = dat-thang cable fe = cable-thang dillo support based on cel's dillo-dat bootstrap node xplatform support Signed-off-by: divo <418@cryspace.space>
25 lines
641 B
C
25 lines
641 B
C
#ifndef DATGPT_WIN_FNMATCH_H
|
|
#define DATGPT_WIN_FNMATCH_H
|
|
#ifdef _WIN32
|
|
static int dat_win_fnmatch(const char *pattern, const char *text)
|
|
{
|
|
while (*pattern) {
|
|
if (*pattern == '*') {
|
|
while (*pattern == '*') pattern++;
|
|
if (!*pattern) return 0;
|
|
do { if (dat_win_fnmatch(pattern, text) == 0) return 0; } while (*text++);
|
|
return 1;
|
|
}
|
|
if (!*text) return 1;
|
|
if (*pattern == '?') { pattern++; text++; continue; }
|
|
if (*pattern != *text) return 1;
|
|
pattern++; text++;
|
|
}
|
|
return *text ? 1 : 0;
|
|
}
|
|
#define fnmatch(pattern, text, flags) ((void)(flags), dat_win_fnmatch((pattern), (text)))
|
|
#else
|
|
#include <fnmatch.h>
|
|
#endif
|
|
#endif
|