summaryrefslogtreecommitdiff
path: root/icclient/client.h
blob: 56db8fd0f86fda026133e5f70fdb5d65795b3d60 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef ICCLIENT_CLIENT_H
#define ICCLIENT_CLIENT_H

struct icclient_product;
struct icclient_catalog;
struct icclient_user;
struct icclient_ord_order;

#ifdef __cplusplus
extern "C" {
#endif

	bool icclient_init(const char *url, const char *certificate);
	void icclient_allproducts(size_t (*handler)(void *contents, size_t size
				, size_t nmemb, void *userdata)
			, struct icclient_catalog **catalogptr);
	void icclient_order(struct icclient_ord_order **orderptr, const char *sku
			, struct icclient_catalog *catalog);
	void icclient_newaccount(size_t (*handler)(void *contents, size_t size
				, size_t nmemb, void *userdata)
			, struct icclient_user *user
			, const char *username, const char *password
			, const char *verify, const char *successpage
			, const char *nextpage, const char *failpage);
	void icclient_login(size_t (*handler)(void *contents, size_t size
				, size_t nmemb, void *userdata)
			, struct icclient_user *user
			, const char *username, const char *password
			, const char *successpage, const char *nextpage
			, const char *failpage);
	void icclient_logout();
	void icclient_page(const char *path
			, size_t (*handler)(void *contents, size_t size
				, size_t nmemb, void *userdata)
			, void **dataptr);
	void icclient_freeproduct(struct icclient_product *product);
	void icclient_freecatalog(struct icclient_catalog *catalog);
	void icclient_cleanup();

#ifdef __cplusplus
}
#endif

#endif // ICCLIENT_CLIENT_H