libpurple/protocols/facebook/json.h

Thu, 03 Dec 2020 04:34:04 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Thu, 03 Dec 2020 04:34:04 -0600
changeset 40634
4d3018b00ad4
parent 39819
3554dac2991b
child 41084
72d6941bfa2e
permissions
-rw-r--r--

Fix the PurpleProtocolClient interface and split it out to its own file.

Testing Done:
Compile and unit tests.

Reviewed at https://reviews.imfreedom.org/r/193/

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
39819
3554dac2991b Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39550
diff changeset
22 #ifndef PURPLE_FACEBOOK_JSON_H
3554dac2991b Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39550
diff changeset
23 #define PURPLE_FACEBOOK_JSON_H
37250
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: 37334
diff changeset
25 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
26 * SECTION:json
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
27 * @section_id: facebook-json
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
28 * @short_description: <filename>json.h</filename>
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
29 * @title: JSON Utilities
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
30 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
31 * The JSON utilities.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
32 */
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
33
37309
556eea7a45da facebook: merged local glibcompat.h into libpurple's
James Geboski <jgeboski@gmail.com>
parents: 37299
diff changeset
34 #include <glib.h>
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
35 #include <json-glib/json-glib.h>
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
36
39550
808e0a11eb9f Use G_DECLARE* in facebook prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37473
diff changeset
37 #define FB_TYPE_JSON_VALUES fb_json_values_get_type()
37373
d6291cb2e46a facebook: fixed inconsistent type declaration
James Geboski <jgeboski@gmail.com>
parents: 37363
diff changeset
38
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
39 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
40 * FB_JSON_ERROR:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
41 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
42 * The #GQuark of the domain of JSON errors.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
43 */
37471
32c1e77d0474 facebook: coding style consistencies
James Geboski <jgeboski@gmail.com>
parents: 37415
diff changeset
44 #define FB_JSON_ERROR fb_json_error_quark()
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
45
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
46 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
47 * FbJsonError:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
48 * @FB_JSON_ERROR_SUCCESS: There is no error.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
49 * @FB_JSON_ERROR_AMBIGUOUS: The node has ambiguous matches.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
50 * @FB_JSON_ERROR_GENERAL: General failure.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
51 * @FB_JSON_ERROR_NOMATCH: The node does not match anything.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
52 * @FB_JSON_ERROR_NULL: The node is of type NULL.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
53 * @FB_JSON_ERROR_TYPE: The node has an unexpected type.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
54 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
55 * The error codes for the #FB_JSON_ERROR domain.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
56 */
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
57 typedef enum
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
58 {
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
59 FB_JSON_ERROR_SUCCESS = 0,
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
60 FB_JSON_ERROR_AMBIGUOUS,
37314
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
61 FB_JSON_ERROR_GENERAL,
37299
b14336308988 facebook: migrated FQL usage to GraphQL
James Geboski <jgeboski@gmail.com>
parents: 37269
diff changeset
62 FB_JSON_ERROR_NOMATCH,
37316
9e3520d6ec49 facebook: refactored and improved JSON error handling
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
63 FB_JSON_ERROR_NULL,
9e3520d6ec49 facebook: refactored and improved JSON error handling
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
64 FB_JSON_ERROR_TYPE
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
65 } FbJsonError;
37316
9e3520d6ec49 facebook: refactored and improved JSON error handling
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
66
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
67 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
68 * FbJsonType:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
69 * @FB_JSON_TYPE_NULL: An unknown value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
70 * @FB_JSON_TYPE_BOOL: A boolean (#TRUE or #FALSE).
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
71 * @FB_JSON_TYPE_DBL: A floating point number.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
72 * @FB_JSON_TYPE_INT: A signed integer.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
73 * @FB_JSON_TYPE_STR: A string.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
74 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
75 * The JSON data types.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
76 */
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
77 typedef enum
37316
9e3520d6ec49 facebook: refactored and improved JSON error handling
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
78 {
9e3520d6ec49 facebook: refactored and improved JSON error handling
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
79 FB_JSON_TYPE_NULL = 0,
9e3520d6ec49 facebook: refactored and improved JSON error handling
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
80 FB_JSON_TYPE_BOOL = G_TYPE_BOOLEAN,
37359
79374d83fae5 facebook: removed alignment whitespace
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
81 FB_JSON_TYPE_DBL = G_TYPE_DOUBLE,
79374d83fae5 facebook: removed alignment whitespace
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
82 FB_JSON_TYPE_INT = G_TYPE_INT64,
79374d83fae5 facebook: removed alignment whitespace
James Geboski <jgeboski@gmail.com>
parents: 37347
diff changeset
83 FB_JSON_TYPE_STR = G_TYPE_STRING
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
84 } FbJsonType;
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
85
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
86 /**
37363
7201f07fe8f7 facebook: gobjectified the FbJsonValues interface
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
87 * fb_json_values_get_type:
7201f07fe8f7 facebook: gobjectified the FbJsonValues interface
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
88 *
7201f07fe8f7 facebook: gobjectified the FbJsonValues interface
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
89 * Returns: The #GType for an #FbJsonValues.
7201f07fe8f7 facebook: gobjectified the FbJsonValues interface
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
90 */
39550
808e0a11eb9f Use G_DECLARE* in facebook prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37473
diff changeset
91 G_DECLARE_FINAL_TYPE(FbJsonValues, fb_json_values, FB, JSON_VALUES,
808e0a11eb9f Use G_DECLARE* in facebook prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37473
diff changeset
92 GObject)
37314
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
93
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
94 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
95 * fb_json_error_quark:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
96 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
97 * Gets the #GQuark of the domain of JSON errors.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
98 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
99 * Returns: The #GQuark of the domain.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
100 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
101 GQuark
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
102 fb_json_error_quark(void);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
103
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
104 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
105 * fb_json_bldr_new:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
106 * @type: The starting #JsonNodeType.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
107 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
108 * Creates a new #JsonBuilder. The starting #JsonNodeType is likely to
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
109 * be #JSON_NODE_OBJECT. The returned #JsonBuilder should be freed with
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
110 * #g_object_unref() when no longer needed. Optionally, instead of
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
111 * freeing, the returned #JsonBuilder can be closed with
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
112 * #fb_json_bldr_close().
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
113 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
114 * Returns: The new #JsonBuilder.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
115 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
116 JsonBuilder *
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
117 fb_json_bldr_new(JsonNodeType type);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
118
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
119 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
120 * fb_json_bldr_close:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
121 * @bldr: The #JsonBuilder.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
122 * @type: The ending #JsonNodeType.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
123 * @size: The return local for the size of the returned string.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
124 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
125 * Closes the #JsonBuilder by returning a string representing the
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
126 * #JsonBuilder. The ending #JsonNodeType is likely to be
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
127 * #JSON_NODE_OBJECT. This calls #g_object_unref(). The returned
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
128 * 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: 37334
diff changeset
129 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
130 * Returns: The string representation of the #JsonBuilder.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
131 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
132 gchar *
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
133 fb_json_bldr_close(JsonBuilder *bldr, JsonNodeType type, gsize *size);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
134
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
135 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
136 * fb_json_bldr_arr_begin:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
137 * @bldr: The #JsonBuilder.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
138 * @name: The member name or #NULL.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
139 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
140 * Begins an array member in the #JsonBuilder.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
141 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
142 void
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
143 fb_json_bldr_arr_begin(JsonBuilder *bldr, const gchar *name);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
144
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
145 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
146 * fb_json_bldr_arr_end:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
147 * @bldr: The #JsonBuilder.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
148 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
149 * Ends an array member in the #JsonBuilder.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
150 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
151 void
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
152 fb_json_bldr_arr_end(JsonBuilder *bldr);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
153
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
154 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
155 * fb_json_bldr_obj_begin:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
156 * @bldr: The #JsonBuilder.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
157 * @name: The member name or #NULL.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
158 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
159 * Begins an object member in the #JsonBuilder.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
160 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
161 void
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
162 fb_json_bldr_obj_begin(JsonBuilder *bldr, const gchar *name);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
163
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
164 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
165 * fb_json_bldr_obj_end:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
166 * @bldr: The #JsonBuilder.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
167 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
168 * Ends an array member in the #JsonBuilder.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
169 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
170 void
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
171 fb_json_bldr_obj_end(JsonBuilder *bldr);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
172
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
173 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
174 * fb_json_bldr_add_bool:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
175 * @bldr: The #JsonBuilder.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
176 * @name: The member name or #NULL.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
177 * @value: The value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
178 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
179 * Adds a boolean memeber to the #JsonBuilder.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
180 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
181 void
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
182 fb_json_bldr_add_bool(JsonBuilder *bldr, const gchar *name, gboolean value);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
183
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
184 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
185 * fb_json_bldr_add_dbl:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
186 * @bldr: The #JsonBuilder.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
187 * @name: The member name or #NULL.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
188 * @value: The value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
189 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
190 * Adds a floating point memeber to the #JsonBuilder.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
191 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
192 void
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
193 fb_json_bldr_add_dbl(JsonBuilder *bldr, const gchar *name, gdouble value);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
194
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
195 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
196 * fb_json_bldr_add_int:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
197 * @bldr: The #JsonBuilder.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
198 * @name: The member name or #NULL.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
199 * @value: The value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
200 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
201 * Adds a integer memeber to the #JsonBuilder.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
202 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
203 void
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
204 fb_json_bldr_add_int(JsonBuilder *bldr, const gchar *name, gint64 value);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
205
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
206 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
207 * fb_json_bldr_add_str:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
208 * @bldr: The #JsonBuilder.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
209 * @name: The member name or #NULL.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
210 * @value: The value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
211 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
212 * Adds a string memeber to the #JsonBuilder.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
213 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
214 void
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
215 fb_json_bldr_add_str(JsonBuilder *bldr, const gchar *name, const gchar *value);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
216
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
217 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
218 * fb_json_bldr_add_strf:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
219 * @bldr: The #JsonBuilder.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
220 * @name: The member name or #NULL.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
221 * @format: The format string literal.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
222 * @...: The arguments for @format.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
223 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
224 * Adds a formatted string memeber to the #JsonBuilder.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
225 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
226 void
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
227 fb_json_bldr_add_strf(JsonBuilder *bldr, const gchar *name,
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
228 const gchar *format, ...)
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
229 G_GNUC_PRINTF(3, 4);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
230
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
231 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
232 * fb_json_node_new:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
233 * @data: The string JSON.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
234 * @size: The size of @json or -1 if null-terminated.
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
235 * @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: 37334
diff changeset
236 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
237 * Creates a new #JsonNode. The returned #JsonBuilder should be freed
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
238 * wuth #json_node_free() when no longer needed.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
239 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
240 * Returns: The new #JsonNode.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
241 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
242 JsonNode *
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
243 fb_json_node_new(const gchar *data, gssize size, GError **error);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
244
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
245 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
246 * fb_json_node_get:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
247 * @root: The root #JsonNode.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
248 * @expr: The #JsonPath expression.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
249 * @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: 37334
diff changeset
250 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
251 * Gets a new #JsonNode value from a parent #JsonNode with a #JsonPath
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
252 * expression. The returned #JsonNode should be freed with
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
253 * #json_node_free() when no longer needed.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
254 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
255 * Returns: The new #JsonNode.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
256 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
257 JsonNode *
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
258 fb_json_node_get(JsonNode *root, const gchar *expr, GError **error);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
259
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
260 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
261 * fb_json_node_get_nth:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
262 * @root: The root #JsonNode.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
263 * @n: The index number.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
264 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
265 * Gets a #JsonNode value from a parent #JsonNode by index. The
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
266 * returned #JsonNode should not be freed.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
267 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
268 * Return: The #JsonNode.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
269 */
37315
7a7771557143 facebook: implemented handling of message attachments
James Geboski <jgeboski@gmail.com>
parents: 37314
diff changeset
270 JsonNode *
7a7771557143 facebook: implemented handling of message attachments
James Geboski <jgeboski@gmail.com>
parents: 37314
diff changeset
271 fb_json_node_get_nth(JsonNode *root, guint n);
7a7771557143 facebook: implemented handling of message attachments
James Geboski <jgeboski@gmail.com>
parents: 37314
diff changeset
272
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
273 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
274 * fb_json_node_get_arr:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
275 * @root: The root #JsonNode.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
276 * @expr: The #JsonPath expression.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
277 * @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: 37334
diff changeset
278 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
279 * Gets a new #JsonArray value from a parent #JsonNode with a #JsonPath
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
280 * expression. The returned #JsonArray should be freed with
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
281 * #json_array_unref() when no longer needed.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
282 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
283 * Returns: The new #JsonArray.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
284 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
285 JsonArray *
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
286 fb_json_node_get_arr(JsonNode *root, const gchar *expr, GError **error);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
287
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
288 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
289 * fb_json_node_get_bool:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
290 * @root: The root #JsonNode.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
291 * @expr: The #JsonPath expression.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
292 * @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: 37334
diff changeset
293 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
294 * Gets a boolean value from a parent #JsonNode with a #JsonPath
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
295 * expression.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
296 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
297 * Returns: The boolean value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
298 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
299 gboolean
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
300 fb_json_node_get_bool(JsonNode *root, const gchar *expr, GError **error);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
301
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
302 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
303 * fb_json_node_get_dbl:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
304 * @root: The root #JsonNode.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
305 * @expr: The #JsonPath expression.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
306 * @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: 37334
diff changeset
307 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
308 * Gets a floating point value from a parent #JsonNode with a #JsonPath
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
309 * expression.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
310 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
311 * Returns: The floating point value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
312 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
313 gdouble
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
314 fb_json_node_get_dbl(JsonNode *root, const gchar *expr, GError **error);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
315
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
316 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
317 * fb_json_node_get_int:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
318 * @root: The root #JsonNode.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
319 * @expr: The #JsonPath expression.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
320 * @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: 37334
diff changeset
321 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
322 * Gets an integer value from a parent #JsonNode with a #JsonPath
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
323 * expression.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
324 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
325 * Returns: The integer value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
326 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
327 gint64
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
328 fb_json_node_get_int(JsonNode *root, const gchar *expr, GError **error);
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: 37334
diff changeset
330 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
331 * fb_json_node_get_str:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
332 * @root: The root #JsonNode.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
333 * @expr: The #JsonPath expression.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
334 * @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: 37334
diff changeset
335 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
336 * Gets an string value from a parent #JsonNode with a #JsonPath
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
337 * expression. The returned string should be freed with #g_free()
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
338 * when no longer needed.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
339 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
340 * Returns: The string value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
341 */
37269
129e87951cd6 facebook: fixed JSON parsing for older json-glib versions
James Geboski <jgeboski@gmail.com>
parents: 37265
diff changeset
342 gchar *
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
343 fb_json_node_get_str(JsonNode *root, const gchar *expr, GError **error);
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
344
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
345 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
346 * fb_json_values_new:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
347 * @root: The root #JsonNode.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
348 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
349 * Creates a new #FbJsonValues. The returned #FbJsonValues should be
37363
7201f07fe8f7 facebook: gobjectified the FbJsonValues interface
James Geboski <jgeboski@gmail.com>
parents: 37359
diff changeset
350 * freed with #g_object_unref when no longer needed.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
351 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
352 * Returns: The new #FbJsonValues.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
353 */
37314
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
354 FbJsonValues *
37334
860ee76f5f58 facebook: fixed all JSON arrays being required
James Geboski <jgeboski@gmail.com>
parents: 37316
diff changeset
355 fb_json_values_new(JsonNode *root);
37314
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
356
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
357 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
358 * fb_json_values_add:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
359 * @values: The #FbJsonValues.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
360 * @type: The #FbJsonType.
37473
9fd3018c170f facebook: trivial GTK-Doc fixes
James Geboski <jgeboski@gmail.com>
parents: 37471
diff changeset
361 * @required: #TRUE if the node is required, otherwise #FALSE.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
362 * @expr: The #JsonPath expression.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
363 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
364 * Adds a new #FbJsonValue to the #FbJsonValues.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
365 */
37314
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
366 void
37316
9e3520d6ec49 facebook: refactored and improved JSON error handling
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
367 fb_json_values_add(FbJsonValues *values, FbJsonType type, gboolean required,
9e3520d6ec49 facebook: refactored and improved JSON error handling
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
368 const gchar *expr);
37314
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
369
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
370 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
371 * fb_json_values_get_root:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
372 * @values: The #FbJsonValues.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
373 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
374 * Gets the current working root #JsonNode. This is either the current
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
375 * array #JsonNode or the root #JsonNode. The returned #JsonNode should
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
376 * not be freed.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
377 */
37314
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
378 JsonNode *
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
379 fb_json_values_get_root(FbJsonValues *values);
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
380
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
381 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
382 * fb_json_values_set_array:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
383 * @values: The #FbJsonValues.
37473
9fd3018c170f facebook: trivial GTK-Doc fixes
James Geboski <jgeboski@gmail.com>
parents: 37471
diff changeset
384 * @required: #TRUE if the node is required, otherwise #FALSE.
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
385 * @expr: The #JsonPath expression.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
386 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
387 * Sets the #JsonPath for an array to base all #FbJsonValue's off.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
388 */
37334
860ee76f5f58 facebook: fixed all JSON arrays being required
James Geboski <jgeboski@gmail.com>
parents: 37316
diff changeset
389 void
860ee76f5f58 facebook: fixed all JSON arrays being required
James Geboski <jgeboski@gmail.com>
parents: 37316
diff changeset
390 fb_json_values_set_array(FbJsonValues *values, gboolean required,
860ee76f5f58 facebook: fixed all JSON arrays being required
James Geboski <jgeboski@gmail.com>
parents: 37316
diff changeset
391 const gchar *expr);
860ee76f5f58 facebook: fixed all JSON arrays being required
James Geboski <jgeboski@gmail.com>
parents: 37316
diff changeset
392
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
393 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
394 * fb_json_values_update:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
395 * @values: The #FbJsonValues.
37415
a06ade737f26 facebook: fixed grammar errors in the GTK-Doc
James Geboski <jgeboski@gmail.com>
parents: 37373
diff changeset
396 * @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: 37334
diff changeset
397 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
398 * Updates the current working root. This should be called after all of
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
399 * the #FbJsonValue's have been added with #fb_json_values_add(). If an
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
400 * array was set with #fb_json_values_set_array(), then this should be
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
401 * called in a while loop, until #FALSE is returned.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
402 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
403 * Returns: #TRUE if the values were updated, otherwise #FALSE.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
404 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
405 gboolean
37314
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
406 fb_json_values_update(FbJsonValues *values, GError **error);
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
407
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
408 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
409 * fb_json_values_next:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
410 * @values: The #FbJsonValues.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
411 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
412 * Gets the next #GValue from the #FbJsonValues. Before calling this
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
413 * function, #fb_json_values_update() must be called.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
414 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
415 * Returns: The #GValue.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
416 */
37314
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
417 const GValue *
37316
9e3520d6ec49 facebook: refactored and improved JSON error handling
James Geboski <jgeboski@gmail.com>
parents: 37315
diff changeset
418 fb_json_values_next(FbJsonValues *values);
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
419
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
420 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
421 * fb_json_values_next_bool:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
422 * @values: The #FbJsonValues.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
423 * @defval: The default value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
424 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
425 * Gets the next boolean value from the #FbJsonValues. Before calling
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
426 * this function, #fb_json_values_update() must be called.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
427 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
428 * Returns: The boolean value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
429 */
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
430 gboolean
37314
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
431 fb_json_values_next_bool(FbJsonValues *values, gboolean defval);
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
432
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
433 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
434 * fb_json_values_next_dbl:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
435 * @values: The #FbJsonValues.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
436 * @defval: The default value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
437 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
438 * Gets the next floating point value from the #FbJsonValues. Before
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
439 * calling this function, #fb_json_values_update() must be called.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
440 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
441 * Returns: The floating point value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
442 */
37314
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
443 gdouble
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
444 fb_json_values_next_dbl(FbJsonValues *values, gdouble defval);
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
445
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
446 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
447 * fb_json_values_next_int:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
448 * @values: The #FbJsonValues.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
449 * @defval: The default value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
450 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
451 * Gets the next integer value from the #FbJsonValues. Before calling
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
452 * this function, #fb_json_values_update() must be called.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
453 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
454 * Returns: The integer value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
455 */
37314
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
456 gint64
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
457 fb_json_values_next_int(FbJsonValues *values, gint64 defval);
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
458
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
459 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
460 * fb_json_values_next_str:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
461 * @values: The #FbJsonValues.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
462 * @defval: The default value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
463 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
464 * Gets the next string value from the #FbJsonValues. Before calling
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
465 * this function, #fb_json_values_update() must be called.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
466 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
467 * Returns: The string value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
468 */
37314
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
469 const gchar *
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
470 fb_json_values_next_str(FbJsonValues *values, const gchar *defval);
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
471
37347
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
472 /**
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
473 * fb_json_values_next_str_dup:
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
474 * @values: The #FbJsonValues.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
475 * @defval: The default value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
476 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
477 * Gets the next duplicate string value from the #FbJsonValues. Before
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
478 * calling this function, #fb_json_values_update() must be called.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
479 *
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
480 * Returns: The duplicate string value.
34d43f8c10d1 facebook: added GTK-Doc for the internal APIs
James Geboski <jgeboski@gmail.com>
parents: 37334
diff changeset
481 */
37314
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
482 gchar *
1fedb5e19577 facebook: refactored the parsing of JSON values
James Geboski <jgeboski@gmail.com>
parents: 37309
diff changeset
483 fb_json_values_next_str_dup(FbJsonValues *values, const gchar *defval);
37250
3f5570a17b15 facebook: initial import of bitlbee-facebook
James Geboski <jgeboski@gmail.com>
parents:
diff changeset
484
39819
3554dac2991b Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39550
diff changeset
485 #endif /* PURPLE_FACEBOOK_JSON_H */

mercurial