Files
dat-thang/extra/dat-dpi/inc/win_fnmatch.h
T
divorce b735900f2e 0.0.002
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>
2026-10-19 00:17:02 -04:00

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