[pango/serializer-rewrite: 12/18] Add gtk_json_parser_set_error




commit 1c4f09a52e16da3339ef12ce1322588836816151
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Nov 30 14:23:31 2021 -0500

    Add gtk_json_parser_set_error

 pango/json/gtkjsonparser.c        | 9 +++++++++
 pango/json/gtkjsonparserprivate.h | 3 +++
 2 files changed, 12 insertions(+)
---
diff --git a/pango/json/gtkjsonparser.c b/pango/json/gtkjsonparser.c
index a2acb043..fd9ba519 100644
--- a/pango/json/gtkjsonparser.c
+++ b/pango/json/gtkjsonparser.c
@@ -1129,3 +1129,12 @@ gtk_json_parser_end (GtkJsonParser *self)
   return TRUE;
 }
 
+void
+gtk_json_parser_set_error (GtkJsonParser *self,
+                           GError        *error)
+{
+  if (self->error)
+    g_error_free (error);
+  else
+    self->error = error;
+}
diff --git a/pango/json/gtkjsonparserprivate.h b/pango/json/gtkjsonparserprivate.h
index f3ff43fd..81c001cc 100644
--- a/pango/json/gtkjsonparserprivate.h
+++ b/pango/json/gtkjsonparserprivate.h
@@ -60,6 +60,9 @@ gboolean                gtk_json_parser_start_object            (GtkJsonParser
 gboolean                gtk_json_parser_start_array             (GtkJsonParser          *self);
 gboolean                gtk_json_parser_end                     (GtkJsonParser          *self);
 
+void                    gtk_json_parser_set_error               (GtkJsonParser          *self,
+                                                                 GError                 *error);
+
 
 G_END_DECLS
 


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