[libgdata] core: Expose gdata_parser_error_from_json_error() internally



commit b354ff4c392c6adf65ccb5340dfb17c0dbab8363
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun Apr 19 18:36:16 2015 +0100

    core: Expose gdata_parser_error_from_json_error() internally
    
    Expose this as an internal helper function, which will be useful in
    upcoming commits.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687597

 gdata/gdata-parser.c |   17 ++++++++++++-----
 gdata/gdata-parser.h |    3 +++
 2 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/gdata/gdata-parser.c b/gdata/gdata-parser.c
index 0e655a5..ee74595 100644
--- a/gdata/gdata-parser.c
+++ b/gdata/gdata-parser.c
@@ -305,8 +305,9 @@ gdata_parser_error_not_iso8601_format_json (JsonReader *reader, const gchar *act
        return FALSE;
 }
 
-static gboolean
-parser_error_from_json_error (JsonReader *reader, const GError *json_error, GError **error)
+gboolean
+gdata_parser_error_from_json_error (JsonReader *reader,
+                                    const GError *json_error, GError **error)
 {
        g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR,
                     /* Translators: the parameter is an error message. */
@@ -776,7 +777,9 @@ gdata_parser_string_from_json_member (JsonReader *reader, const gchar *member_na
        text = json_reader_get_string_value (reader);
        child_error = json_reader_get_error (reader);
        if (child_error != NULL) {
-               *success = parser_error_from_json_error (reader, child_error, error);
+               *success = gdata_parser_error_from_json_error (reader,
+                                                              child_error,
+                                                              error);
                return TRUE;
        } else if ((options & P_REQUIRED && text == NULL) || (options & P_NON_EMPTY && text != NULL && *text 
== '\0')) {
                *success = gdata_parser_error_required_json_content_missing (reader, error);
@@ -842,7 +845,9 @@ gdata_parser_int64_time_from_json_member (JsonReader *reader, const gchar *membe
        text = json_reader_get_string_value (reader);
        child_error = json_reader_get_error (reader);
        if (child_error != NULL) {
-               *success = parser_error_from_json_error (reader, child_error, error);
+               *success = gdata_parser_error_from_json_error (reader,
+                                                              child_error,
+                                                              error);
                return TRUE;
        } else if (options & P_REQUIRED && (text == NULL || *text == '\0')) {
                *success = gdata_parser_error_required_json_content_missing (reader, error);
@@ -905,7 +910,9 @@ gdata_parser_boolean_from_json_member (JsonReader *reader, const gchar *member_n
        val = json_reader_get_boolean_value (reader);
        child_error = json_reader_get_error (reader);
        if (child_error != NULL) {
-               *success = parser_error_from_json_error (reader, child_error, error);
+               *success = gdata_parser_error_from_json_error (reader,
+                                                              child_error,
+                                                              error);
                return TRUE;
        }
 
diff --git a/gdata/gdata-parser.h b/gdata/gdata-parser.h
index 2c5ad2f..ed832d8 100644
--- a/gdata/gdata-parser.h
+++ b/gdata/gdata-parser.h
@@ -38,6 +38,9 @@ gboolean gdata_parser_error_duplicate_element (xmlNode *element, GError **error)
 gboolean gdata_parser_error_duplicate_json_element (JsonReader *reader, GError **error);
 gboolean gdata_parser_error_required_json_content_missing (JsonReader *reader, GError **error);
 gboolean gdata_parser_error_not_iso8601_format_json (JsonReader *reader, const gchar *actual_value, GError 
**error);
+gboolean
+gdata_parser_error_from_json_error (JsonReader *reader,
+                                    const GError *json_error, GError **error);
 
 gboolean gdata_parser_int64_from_date (const gchar *date, gint64 *_time);
 gchar *gdata_parser_date_from_int64 (gint64 _time) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]