aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
blob: 5ad71f8b741170d9c193862361eec1129d955ba7 (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-c/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