aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
blob: fc6d34a7b3fb9158e6b2bc46eab59d3ca0a8ed48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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