aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-12-31 11:49:14 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-12-31 11:49:14 -0800
commitada59f0a9d23d8ec19ee6a1326977ddf6e93f5f9 (patch)
tree1e1f079b5569ae2d7269ff2abf4b520ad82d3cdd /system
parent2f4401a79e96917f78876c3e09b8d31754a26f70 (diff)
parente97f48a2c9376354a6b8927191322322f13808ba (diff)
Merge branch 'incoming'
Diffstat (limited to 'system')
-rw-r--r--system/include/emscripten/emscripten.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/system/include/emscripten/emscripten.h b/system/include/emscripten/emscripten.h
index 3eefe0b8..926fe2e5 100644
--- a/system/include/emscripten/emscripten.h
+++ b/system/include/emscripten/emscripten.h
@@ -187,6 +187,30 @@ float emscripten_random();
void emscripten_async_wget(const char* url, const char* file, void (*onload)(const char*), void (*onerror)(const char*));
/*
+ * Data version of emscripten_async_wget. Instead of writing
+ * to a file, it writes to a buffer directly in memory.
+ * This avoids the overhead of using the emulated
+ * filesystem, note however that since files are not used,
+ * It cannot do the 'prepare' stage to set things up for
+ * IMG_Load and so forth (IMG_Load etc. work on files).
+ *
+ * @param arg User-defined data that is passed to the callbacks,
+ *
+ * @param onload Callback on success, with the @arg that
+ * was provided to this function, a pointer
+ * to a buffer with the data, and the size
+ * of the buffer. As in the worker API, the
+ * data buffer only lives during the
+ * callback, so you should use it or copy
+ * it during that time and not later.
+ *
+ * @param onerror An optional callback on failure, with the
+ * @arg that was provided to this function.
+ *
+ */
+void emscripten_async_wget_data(const char* url, void *arg, void (*onload)(void*, void*, int), void (*onerror)(void*));
+
+/*
* Prepare a file in asynchronous way. This does just the
* preparation part of emscripten_async_wget, that is, it
* works on file data already present, and asynchronously