aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
new file mode 100644
index 0000000..fc6d34a
--- /dev/null
+++ b/src/net.h
@@ -0,0 +1,28 @@
+#ifndef NET_H
+#define NET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <curl/curl.h>
+#include <json.h>
+
+struct MemoryStruct {
+ uint8_t* memory;
+ size_t size;
+};
+
+void net_init();
+void net_deinit();
+
+struct MemoryStruct* downloadToRam(const char* URL);
+size_t downloadToFile(const char*, const char*);
+void freeDownload(struct MemoryStruct* chunk);
+struct json_object* fetchJSON(const char*);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif