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

Function main

test/core/test_cube2md5.c:13–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11bool mygetline(char *str, int len) { return fgets(str, len, file)!=NULL; }
12
13int main() {
14 file = fopen("test_cube2md5.txt", "r");
15 char buf[1024];
16 int tmp;
17 mygetline(buf, sizeof(buf));
18 if (sscanf(buf, " frame %d", &tmp)==1) {
19 printf("frame %d\n", tmp);
20 for (int numdata = 0; mygetline(buf, sizeof(buf)) && buf[0]!='}';) {
21 printf("frameline\n");
22 for (char *src = buf, *next = src; numdata < 198; numdata++, src = next) {
23 double x = strtod(src, &next);
24 printf("animdata[%d] = %.8f\n", numdata, x);
25 if (next <= src) break;
26 }
27 }
28 }
29 return 0;
30}

Callers

nothing calls this directly

Calls 5

fopenFunction · 0.85
mygetlineFunction · 0.85
sscanfFunction · 0.85
printfFunction · 0.85
strtodFunction · 0.85

Tested by

no test coverage detected