libpurple/protocols/facebook/http.h

Sun, 25 Jun 2017 04:16:48 -0300

author
dx <dx@dxzone.com.ar>
date
Sun, 25 Jun 2017 04:16:48 -0300
changeset 38396
a7a919217259
parent 37473
9fd3018c170f
child 39819
3554dac2991b
permissions
-rw-r--r--

facebook: Refactor, split fb_api_cb_publish_ms into ..._new_message

37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
1 /* purple
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
2 *
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
3 * Purple is the legal property of its developers, whose names are too numerous
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
5 * source distribution.
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
6 *
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
10 * (at your option) any later version.
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
11 *
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
15 * GNU General Public License for more details.
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
16 *
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
20 */
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
21
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
22 #ifndef _FACEBOOK_HTTP_H_
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
23 #define _FACEBOOK_HTTP_H_
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
24
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
25 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
26 * SECTION:http
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
27 * @section_id: facebook-http
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
28 * @short_description: <filename>http.h</filename>
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
29 * @title: HTTP Utilities
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
30 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
31 * The HTTP utilities.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
32 */
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
33
37309
556eea7a45da facebook: merged local glibcompat.h into libpurple's
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
34 #include <glib.h>
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
35
37309
556eea7a45da facebook: merged local glibcompat.h into libpurple's
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
36 #include <libpurple/http.h>
37265
df6d420a48b7 facebook: added glib compatibility symbols
James Geboski <jgeboski@gmail.com>
parents: 37257
diff changeset
37
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
38 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
39 * FB_HTTP_ERROR:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
40 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
41 * The #GQuark of the domain of HTTP errors.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
42 */
37471
32c1e77d0474 facebook: coding style consistencies
James Geboski <jgeboski@gmail.com>
parents: 37433
diff changeset
43 #define FB_HTTP_ERROR fb_http_error_quark()
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
44
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
45 /**
37433
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
46 * FbHttpConns:
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
47 *
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
48 * Represents a set of #PurpleHttpConnection.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
49 */
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
50 typedef struct _FbHttpConns FbHttpConns;
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
51
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
52 /**
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
53 * FbHttpParams:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
54 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
55 * Represents a set of key/value HTTP parameters.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
56 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
57 typedef GHashTable FbHttpParams;
37257
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
58
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
59 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
60 * FbHttpError:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
61 * @FB_HTTP_ERROR_SUCCESS: There is no error.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
62 * @FB_HTTP_ERROR_NOMATCH: The name does not match anything.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
63 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
64 * The error codes for the #FB_HTTP_ERROR domain.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
65 */
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
66 typedef enum
37257
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
67 {
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
68 FB_HTTP_ERROR_SUCCESS = 0,
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
69 FB_HTTP_ERROR_NOMATCH
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
70 } FbHttpError;
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
71
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
72 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
73 * fb_http_error_quark:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
74 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
75 * Gets the #GQuark of the domain of HTTP errors.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
76 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
77 * Returns: The #GQuark of the domain.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
78 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
79 GQuark
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
80 fb_http_error_quark(void);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
81
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
82 /**
37433
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
83 * fb_http_conns_new:
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
84 *
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
85 * Creates a new #FbHttpConns. The returned #FbHttpConns should be
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
86 * freed with #fb_http_conns_free() when no longer needed.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
87 *
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
88 * Returns: The new #FbHttpConns.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
89 */
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
90 FbHttpConns *
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
91 fb_http_conns_new(void);
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
92
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
93 /**
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
94 * fb_http_conns_free:
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
95 * @cons: The #FbHttpConns.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
96 *
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
97 * Frees all memory used by the #FbHttpConns. This will *not* cancel
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
98 * the any of the added #PurpleHttpConnection.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
99 */
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
100 void
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
101 fb_http_conns_free(FbHttpConns *cons);
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
102
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
103 /**
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
104 * fb_http_conns_cancel_all:
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
105 * @cons: The #FbHttpConns.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
106 *
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
107 * Cancels each #PurpleHttpConnection in the #FbHttpConns.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
108 */
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
109 void
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
110 fb_http_conns_cancel_all(FbHttpConns *cons);
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
111
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
112 /**
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
113 * fb_http_conns_is_canceled:
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
114 * @cons: The #FbHttpConns.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
115 *
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
116 * Determines if the #FbHttpConns has been canceled.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
117 *
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
118 * Returns: #TRUE if it has been canceled, otherwise #FALSE.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
119 */
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
120 gboolean
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
121 fb_http_conns_is_canceled(FbHttpConns *cons);
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
122
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
123 /**
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
124 * fb_http_conns_add:
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
125 * @cons: The #FbHttpConns.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
126 * @con: The #PurpleHttpConnection.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
127 *
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
128 * Adds a #PurpleHttpConnection to the #FbHttpConns.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
129 */
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
130 void
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
131 fb_http_conns_add(FbHttpConns *cons, PurpleHttpConnection *con);
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
132
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
133 /**
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
134 * fb_http_conns_remove:
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
135 * @cons: The #FbHttpConns.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
136 * @con: The #PurpleHttpConnection.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
137 *
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
138 * Removes a #PurpleHttpConnection from the #FbHttpConns.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
139 */
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
140 void
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
141 fb_http_conns_remove(FbHttpConns *cons, PurpleHttpConnection *con);
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
142
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
143 /**
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
144 * fb_http_conns_reset:
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
145 * @cons: The #FbHttpConns.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
146 *
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
147 * Resets the #FbHttpConns. This removes each #PurpleHttpConnection
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
148 * from the #FbHttpConns *without* canceling it. This allows the the
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
149 * #FbHttpConns to be reused.
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
150 */
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
151 void
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
152 fb_http_conns_reset(FbHttpConns *cons);
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
153
50bb40c42245 facebook: implemented better HTTP connection handling
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
154 /**
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
155 * fb_http_error_chk:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
156 * @res: The #PurpleHttpResponse.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37354
diff changeset
157 * @error: The return location for the #GError or #NULL.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
158 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
159 * Checks a #PurpleHttpResponse for success. This optionally assigns an
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
160 * appropriate #GError upon failure.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
161 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
162 * Returns: #TRUE if the request was successful, otherwise #FALSE.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
163 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
164 gboolean
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
165 fb_http_error_chk(PurpleHttpResponse *res, GError **error);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
166
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
167 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
168 * fb_http_params_new:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
169 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
170 * Creates a new #FbHttpParams. The returned #FbHttpParams should be
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
171 * freed with #fb_http_params_free() when no longer needed. Optionally,
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
172 * instead of freeing, the returned #FbHttpParams can be closed with
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
173 * #fb_http_params_close().
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
174 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
175 * Returns: The new #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
176 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
177 FbHttpParams *
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
178 fb_http_params_new(void);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
179
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
180 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
181 * fb_http_params_new_parse:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
182 * @data: The string containing HTTP parameters.
37473
9fd3018c170f facebook: trivial GTK-Doc fixes
James Geboski <jgeboski@gmail.com>
parents: 37471
diff changeset
183 * @isurl: #TRUE if @data is a URL, otherwise #FALSE.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
184 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
185 * Creates a new #FbHttpParams. This parses the #FbHttpParams from a
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
186 * string, which can be a URL. The returned #FbHttpParams should be
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
187 * freed with #fb_http_params_free() when no longer needed. Optionally,
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
188 * instead of freeing, the returned #FbHttpParams can be closed with
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
189 * #fb_http_params_close().
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
190 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
191 * Returns: The new #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
192 */
37257
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
193 FbHttpParams *
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
194 fb_http_params_new_parse(const gchar *data, gboolean isurl);
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
195
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
196 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
197 * fb_http_params_free:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
198 * @params: The #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
199 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
200 * Frees all memory used by the #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
201 */
37257
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
202 void
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
203 fb_http_params_free(FbHttpParams *params);
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
204
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
205 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
206 * fb_http_params_close:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
207 * @params: The #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
208 * @url: The URL or #NULL.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
209 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
210 * Closes the #FbHttpParams by returning a string representing the HTTP
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
211 * parameters. If @url is non-#NULL, then the parameters are appended
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
212 * to the value of @url. This frees the #FbHttpParams. The returned
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
213 * string should be freed with #g_free() when no longer needed.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
214 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
215 * Returns: The string representation of the HTTP parameters.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
216 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
217 gchar *
37315
7a7771557143 facebook: implemented handling of message attachments
James Geboski <jgeboski@gmail.com>
parents: 37314
diff changeset
218 fb_http_params_close(FbHttpParams *params, const gchar *url);
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
219
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
220 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
221 * fb_http_params_get_bool:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
222 * @params: The #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
223 * @name: The parameter name.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37354
diff changeset
224 * @error: The return location for the #GError or #NULL.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
225 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
226 * Gets a boolean value from the #FbHttpParams. This optionally assigns
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
227 * an appropriate #GError upon failure.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
228 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
229 * Return: The boolean value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
230 */
37257
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
231 gboolean
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
232 fb_http_params_get_bool(FbHttpParams *params, const gchar *name,
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
233 GError **error);
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
234
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
235 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
236 * fb_http_params_get_dbl:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
237 * @params: The #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
238 * @name: The parameter name.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37354
diff changeset
239 * @error: The return location for the #GError or #NULL.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
240 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
241 * Gets a floating point value from the #FbHttpParams. This optionally
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
242 * assigns an appropriate #GError upon failure.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
243 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
244 * Return: The floating point value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
245 */
37257
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
246 gdouble
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
247 fb_http_params_get_dbl(FbHttpParams *params, const gchar *name,
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
248 GError **error);
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
249
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
250 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
251 * fb_http_params_get_int:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
252 * @params: The #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
253 * @name: The parameter name.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37354
diff changeset
254 * @error: The return location for the #GError or #NULL.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
255 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
256 * Gets an integer value from the #FbHttpParams. This optionally
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
257 * assigns an appropriate #GError upon failure.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
258 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
259 * Return: The integer value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
260 */
37257
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
261 gint64
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
262 fb_http_params_get_int(FbHttpParams *params, const gchar *name,
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
263 GError **error);
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
264
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
265 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
266 * fb_http_params_get_str:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
267 * @params: The #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
268 * @name: The parameter name.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37354
diff changeset
269 * @error: The return location for the #GError or #NULL.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
270 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
271 * Gets a string value from the #FbHttpParams. This optionally assigns
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
272 * an appropriate #GError upon failure.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
273 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
274 * Return: The string value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
275 */
37257
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
276 const gchar *
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
277 fb_http_params_get_str(FbHttpParams *params, const gchar *name,
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
278 GError **error);
5ba291680ac4 facebook: compare checksums before fetching icons
James Geboski <jgeboski@gmail.com>
parents: 37250
diff changeset
279
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
280 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
281 * fb_http_params_dup_str:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
282 * @params: The #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
283 * @name: The parameter name.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37354
diff changeset
284 * @error: The return location for the #GError or #NULL.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
285 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
286 * Gets a duplicated string value from the #FbHttpParams. This
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
287 * optionally assigns an appropriate #GError upon failure. The returned
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
288 * string should be freed with #g_free() when no longer needed.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
289 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
290 * Return: The duplicated string value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
291 */
37315
7a7771557143 facebook: implemented handling of message attachments
James Geboski <jgeboski@gmail.com>
parents: 37314
diff changeset
292 gchar *
7a7771557143 facebook: implemented handling of message attachments
James Geboski <jgeboski@gmail.com>
parents: 37314
diff changeset
293 fb_http_params_dup_str(FbHttpParams *params, const gchar *name,
7a7771557143 facebook: implemented handling of message attachments
James Geboski <jgeboski@gmail.com>
parents: 37314
diff changeset
294 GError **error);
7a7771557143 facebook: implemented handling of message attachments
James Geboski <jgeboski@gmail.com>
parents: 37314
diff changeset
295
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
296 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
297 * fb_http_params_set_bool:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
298 * @params: The #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
299 * @name: The parameter name.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
300 * @value: The value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
301 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
302 * Sets a boolean value to the #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
303 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
304 void
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
305 fb_http_params_set_bool(FbHttpParams *params, const gchar *name,
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
306 gboolean value);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
307
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
308 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
309 * fb_http_params_set_dbl:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
310 * @params: The #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
311 * @name: The parameter name.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
312 * @value: The value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
313 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
314 * Sets a floating point value to the #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
315 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
316 void
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
317 fb_http_params_set_dbl(FbHttpParams *params, const gchar *name, gdouble value);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
318
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
319 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
320 * fb_http_params_set_int:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
321 * @params: The #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
322 * @name: The parameter name.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
323 * @value: The value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
324 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
325 * Sets an integer value to the #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
326 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
327 void
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
328 fb_http_params_set_int(FbHttpParams *params, const gchar *name, gint64 value);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
329
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
330 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
331 * fb_http_params_set_str:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
332 * @params: The #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
333 * @name: The parameter name.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
334 * @value: The value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
335 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
336 * Sets a string value to the #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
337 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
338 void
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
339 fb_http_params_set_str(FbHttpParams *params, const gchar *name,
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
340 const gchar *value);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
341
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
342 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
343 * fb_http_params_set_strf:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
344 * @params: The #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
345 * @name: The parameter name.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
346 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
347 * @...: The arguments for @format.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
348 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
349 * Sets a formatted string value to the #FbHttpParams.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
350 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
351 void
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
352 fb_http_params_set_strf(FbHttpParams *params, const gchar *name,
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
353 const gchar *format, ...)
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
354 G_GNUC_PRINTF(3, 4);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
355
37354
14857ad5b6b7 facebook: fixed URL comparisons being overly strict
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
356 /**
14857ad5b6b7 facebook: fixed URL comparisons being overly strict
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
357 * fb_http_urlcmp:
14857ad5b6b7 facebook: fixed URL comparisons being overly strict
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
358 * @url1: The first URL.
14857ad5b6b7 facebook: fixed URL comparisons being overly strict
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
359 * @url2: The second URL.
14857ad5b6b7 facebook: fixed URL comparisons being overly strict
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
360 * @protocol: #TRUE to match the protocols, otherwise #FALSE.
14857ad5b6b7 facebook: fixed URL comparisons being overly strict
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
361 *
14857ad5b6b7 facebook: fixed URL comparisons being overly strict
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
362 * Compares two URLs. This is more reliable than just comparing two URL
14857ad5b6b7 facebook: fixed URL comparisons being overly strict
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
363 * strings, as it avoids casing in some areas, while not in others. It
14857ad5b6b7 facebook: fixed URL comparisons being overly strict
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
364 * can also, optionally, ignore the matching of the URL protocol.
14857ad5b6b7 facebook: fixed URL comparisons being overly strict
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
365 *
14857ad5b6b7 facebook: fixed URL comparisons being overly strict
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
366 * Returns: #TRUE if the URLs match, otherwise #FALSE.
14857ad5b6b7 facebook: fixed URL comparisons being overly strict
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
367 */
14857ad5b6b7 facebook: fixed URL comparisons being overly strict
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
368 gboolean
14857ad5b6b7 facebook: fixed URL comparisons being overly strict
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
369 fb_http_urlcmp(const gchar *url1, const gchar *url2, gboolean protocol);
14857ad5b6b7 facebook: fixed URL comparisons being overly strict
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
370
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
371 #endif /* _FACEBOOK_HTTP_H_ */

mercurial