File: http.h

package info (click to toggle)
lastpass-cli 1.6.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 912 kB
  • sloc: ansic: 10,203; sh: 683; makefile: 45
file content (28 lines) | stat: -rw-r--r-- 927 bytes parent folder | download | duplicates (5)
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