aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
blob: 098a8d7ef47894e2d0be58daa5162bd05178ef02 (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);
void net_deinit(void);

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