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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
#ifndef _REST_PROXY
#define _REST_PROXY
#include <glib-object.h>
#include <json-glib/json-glib.h>
G_BEGIN_DECLS
#define REST_TYPE_PROXY rest_proxy_get_type()
#define REST_PROXY(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), REST_TYPE_PROXY, RestProxy))
#define REST_PROXY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), REST_TYPE_PROXY, RestProxyClass))
#define REST_IS_PROXY(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), REST_TYPE_PROXY))
#define REST_IS_PROXY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), REST_TYPE_PROXY))
#define REST_PROXY_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), REST_TYPE_PROXY, RestProxyClass))
typedef struct {
GObject parent;
} RestProxy;
typedef struct {
GObjectClass parent_class;
} RestProxyClass;
typedef void (*RestProxyCallRawCallback)(RestProxy *proxy,
guint status_code,
const gchar *response_message,
GHashTable *headers,
const gchar *payload,
goffset len,
GObject *weak_object,
gpointer userdata);
typedef void (*RestProxyCallJsonCallback)(RestProxy *proxy,
guint status_code,
const gchar *response_message,
GHashTable *headers,
JsonNode *root,
GObject *weak_object,
gpointer userdata);
GType rest_proxy_get_type (void);
RestProxy *rest_proxy_new (const gchar *url_format,
gboolean binding_required);
gboolean rest_proxy_bind (RestProxy *proxy, const gchar *first_param, ...);
gboolean rest_proxy_call_raw_async (RestProxy *proxy,
const gchar *function,
const gchar *method,
RestProxyCallRawCallback callback,
GObject *weak_object,
gpointer userdata,
GError **error,
const gchar *first_field_name,
...);
gboolean rest_proxy_call_raw_async_valist (RestProxy *proxy,
const gchar *function,
const gchar *method,
RestProxyCallRawCallback callback,
GObject *weak_object,
gpointer userdata,
GError **error,
const gchar *first_field_name,
va_list params);
gboolean rest_proxy_run_raw (RestProxy *proxy,
const gchar *function,
const gchar *method,
guint *status_code,
gchar **response_message,
GHashTable **headers,
gchar **payload,
goffset *len,
GError **error,
const gchar *first_field_name,
...);
gboolean rest_proxy_call_json_async (RestProxy *proxy,
const gchar *function,
const gchar *method,
RestProxyCallJsonCallback callback,
GObject *weak_object,
gpointer userdata,
GError **error,
const gchar *first_field_name,
...);
gboolean
rest_proxy_call_json_async_valist (RestProxy *proxy,
const gchar *function,
const gchar *method,
RestProxyCallJsonCallback callback,
GObject *weak_object,
gpointer userdata,
GError **error,
const gchar *first_field_name,
va_list params);
G_END_DECLS
#endif /* _REST_PROXY */
|