[gtk+/wip/cssvalue: 176/218] cssparser: Add _gtk_css_parser_error_full()



commit f3b4bca02f545731ed5d653fd1caec8bbb281588
Author: Benjamin Otte <otte redhat com>
Date:   Mon Mar 26 18:36:20 2012 +0200

    cssparser: Add _gtk_css_parser_error_full()

 gtk/gtkcssparser.c        |   17 +++++++++++++++++
 gtk/gtkcssparserprivate.h |    5 +++++
 2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssparser.c b/gtk/gtkcssparser.c
index b6fae87..8d3912e 100644
--- a/gtk/gtkcssparser.c
+++ b/gtk/gtkcssparser.c
@@ -142,6 +142,23 @@ _gtk_css_parser_error (GtkCssParser *parser,
   _gtk_css_parser_take_error (parser, error);
 }
 
+void
+_gtk_css_parser_error_full (GtkCssParser        *parser,
+                            GtkCssProviderError  code,
+                            const char          *format,
+                            ...)
+{
+  GError *error;
+
+  va_list args;
+
+  va_start (args, format);
+  error = g_error_new_valist (GTK_CSS_PROVIDER_ERROR,
+                              code, format, args);
+  va_end (args);
+
+  _gtk_css_parser_take_error (parser, error);
+}
 static gboolean
 gtk_css_parser_new_line (GtkCssParser *parser)
 {
diff --git a/gtk/gtkcssparserprivate.h b/gtk/gtkcssparserprivate.h
index ba36d6e..dd9e228 100644
--- a/gtk/gtkcssparserprivate.h
+++ b/gtk/gtkcssparserprivate.h
@@ -19,6 +19,7 @@
 #define __GTK_CSS_PARSER_PRIVATE_H__
 
 #include "gtk/gtkcsstypesprivate.h"
+#include <gtk/gtkcssprovider.h>
 #include <gtk/gtksymboliccolor.h>
 
 G_BEGIN_DECLS
@@ -48,6 +49,10 @@ void            _gtk_css_parser_take_error        (GtkCssParser          *parser
 void            _gtk_css_parser_error             (GtkCssParser          *parser,
                                                    const char            *format,
                                                     ...) G_GNUC_PRINTF (2, 3);
+void            _gtk_css_parser_error_full        (GtkCssParser          *parser,
+                                                   GtkCssProviderError    code,
+                                                   const char            *format,
+                                                    ...) G_GNUC_PRINTF (3, 4);
 
 guint           _gtk_css_parser_get_line          (GtkCssParser          *parser);
 guint           _gtk_css_parser_get_position      (GtkCssParser          *parser);



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