MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / hasext

Function hasext

test/browser/s3tc.c:34–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32#include <assert.h>
33
34int hasext(const char *exts, const char *ext) // from cube2, zlib licensed
35{
36 int len = strlen(ext);
37 if(len) for(const char *cur = exts; (cur = strstr(cur, ext)); cur += len)
38 {
39 if((cur == exts || cur[-1] == ' ') && (cur[len] == ' ' || !cur[len])) return 1;
40 }
41 return 0;
42}
43
44int main(int argc, char *argv[])
45{

Callers 1

mainFunction · 0.70

Calls 2

strlenFunction · 0.85
strstrFunction · 0.50

Tested by

no test coverage detected