forked from cee-studio/orca
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reddit-internal.h
41 lines (30 loc) · 963 Bytes
/
reddit-internal.h
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
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef REDDIT_INTERNAL_H
#define REDDIT_INTERNAL_H
#include "json-actor.h"
#include "json-actor-boxed.h"
#include "user-agent.h"
#include "websockets.h"
#include "cee-utils.h"
#define BASE_API_URL "https://www.reddit.com"
#define BASE_OAUTH_URL "https://oauth.reddit.com"
struct reddit_adapter {
struct user_agent *ua;
struct reddit *p_client;
};
/* ADAPTER PRIVATE FUNCTIONS */
void reddit_adapter_init(struct reddit_adapter *adapter, struct logconf *config);
void reddit_adapter_cleanup(struct reddit_adapter *adapter);
ORCAcode reddit_adapter_run(
struct reddit_adapter *adapter,
struct sized_buffer *resp_body,
struct sized_buffer *req_body,
enum http_method http_method, char endpoint[], ...);
struct reddit {
struct sized_buffer username;
struct sized_buffer password;
struct sized_buffer client_id;
struct sized_buffer client_secret;
struct reddit_adapter adapter;
struct logconf config;
};
#endif // REDDIT_INTERNAL_H