blob: c47ac217f766437c995c53f722d2bd0e807b6773 [file] [edit]
// Copyright 2016 The Emscripten Authors. All rights reserved.
// Emscripten is available under two separate licenses, the MIT license and the
// University of Illinois/NCSA Open Source License. Both these licenses can be
// found in the LICENSE file.
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <emscripten/fetch.h>
int main()
{
emscripten_fetch_attr_t attr;
emscripten_fetch_attr_init(&attr);
strcpy(attr.requestMethod, "GET");
attr.attributes = EMSCRIPTEN_FETCH_LOAD_TO_MEMORY | EMSCRIPTEN_FETCH_SYNCHRONOUS;
emscripten_fetch_t *fetch = emscripten_fetch(&attr, "gears.png");
if (result == 0) {
result = 2;
printf("emscripten_fetch() failed to run synchronously!\n");
}
#ifdef REPORT_RESULT
REPORT_RESULT(result);
#endif
}