[gtk+/wip/css: 105/167] css: Add _gtk_css_parser_has_prefix()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/css: 105/167] css: Add _gtk_css_parser_has_prefix()
- Date: Sun, 8 Jan 2012 04:51:33 +0000 (UTC)
commit a022b8b118af8fc20786317514f6172dd4b765a4
Author: Benjamin Otte <otte redhat com>
Date: Tue Dec 20 08:15:18 2011 +0100
css: Add _gtk_css_parser_has_prefix()
gtk/gtkcssparser.c | 9 +++++++++
gtk/gtkcssparserprivate.h | 2 ++
2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssparser.c b/gtk/gtkcssparser.c
index 8867e04..8bdcfc2 100644
--- a/gtk/gtkcssparser.c
+++ b/gtk/gtkcssparser.c
@@ -92,6 +92,15 @@ _gtk_css_parser_begins_with (GtkCssParser *parser,
return *parser->data == c;
}
+gboolean
+_gtk_css_parser_has_prefix (GtkCssParser *parser,
+ const char *prefix)
+{
+ g_return_val_if_fail (GTK_IS_CSS_PARSER (parser), FALSE);
+
+ return g_ascii_strncasecmp (parser->data, prefix, strlen (prefix)) == 0;
+}
+
guint
_gtk_css_parser_get_line (GtkCssParser *parser)
{
diff --git a/gtk/gtkcssparserprivate.h b/gtk/gtkcssparserprivate.h
index dd58fa6..f751b73 100644
--- a/gtk/gtkcssparserprivate.h
+++ b/gtk/gtkcssparserprivate.h
@@ -47,6 +47,8 @@ guint _gtk_css_parser_get_position (GtkCssParser *parser
gboolean _gtk_css_parser_is_eof (GtkCssParser *parser);
gboolean _gtk_css_parser_begins_with (GtkCssParser *parser,
char c);
+gboolean _gtk_css_parser_has_prefix (GtkCssParser *parser,
+ const char *prefix);
gboolean _gtk_css_parser_is_string (GtkCssParser *parser);
/* IMPORTANT:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]