forked from lastpass/lastpass-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
http.h
28 lines (22 loc) · 927 Bytes
/
http.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
#ifndef HTTP_H
#define HTTP_H
#include <stddef.h>
#include <stdarg.h>
#include <curl/curl.h>
#include "session.h"
struct http_param_set
{
char **argv;
size_t n_alloced;
};
#define LASTPASS_SERVER "lastpass.com"
#define HTTP_ERROR_CODE CURLE_HTTP_RETURNED_ERROR
#define HTTP_ERROR_CONNECT CURLE_SSL_CONNECT_ERROR
int http_init();
void http_post_add_params(struct http_param_set *params, ...);
char *http_post_lastpass(const char *page, const struct session *session, size_t *len, ...);
char *http_post_lastpass_v(const char *server, const char *page, const struct session *session, size_t *len, char **argv);
char *http_post_lastpass_param_set(const char *page, const struct session *session, size_t *len,
struct http_param_set *params);
char *http_post_lastpass_v_noexit(const char *server, const char *page, const struct session *session, size_t *final_len, char **argv, int *curl_ret, long *http_code);
#endif