-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransport.h
More file actions
47 lines (38 loc) · 1.13 KB
/
transport.h
File metadata and controls
47 lines (38 loc) · 1.13 KB
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
42
43
44
45
46
#ifndef _AOL_TRANSPORT_H
#define _AOL_TRANSPORT_H
#include "atmos_util.h"
typedef struct credentialsval {
char tokenid[120];
char secret[120];
char accesspoint[120];
} credentials;
typedef struct PD {
char *data;
size_t body_size;
size_t bytes_remaining;
size_t offset;
size_t bytes_written;
}postdata;
typedef struct hdrval {
void *header_data;
size_t header_size;
void *next_header;
} hdr;
#define MAX_HEADERS 1024
typedef struct ws_result {
int return_code;
char *response_body;
size_t body_size;
char *headers[MAX_HEADERS];
int header_count;
} ws_result;
#define true 1
#define false 0
#define HTTP_HDR_SIZE 4096
const char *http_request(credentials *c,http_method method, char *uri,char * content_type, char **headers, int header_count, postdata* a, ws_result* ws_result) ;
const char *http_request_ns(credentials *c,http_method method, char *uri, char *content_type, char **headers, int header_count, postdata* a, ws_result *ws_result) ;
void ws_init(ws_result*);
void ws_deinit(ws_result*);
void result_deinit(ws_result *result);
void result_init(ws_result *result);
#endif