[glib] Add API to get the compile and match flags from a GRegex



commit 4c10cad66175c9a4a79b764c2f807482811c5dcc
Author: Christian Persch <chpe gnome org>
Date:   Wed Apr 28 12:36:30 2010 +0200

    Add API to get the compile and match flags from a GRegex
    
    Bug #616967.

 docs/reference/glib/glib-sections.txt |    2 +
 docs/reference/glib/tmpl/gregex.sgml  |   18 ++++++++++++++++
 glib/glib.symbols                     |    2 +
 glib/gregex.c                         |   36 +++++++++++++++++++++++++++++++++
 glib/gregex.h                         |    3 ++
 5 files changed, 61 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt
index c0b2606..ae4020e 100644
--- a/docs/reference/glib/glib-sections.txt
+++ b/docs/reference/glib/glib-sections.txt
@@ -942,6 +942,8 @@ g_regex_get_pattern
 g_regex_get_max_backref
 g_regex_get_capture_count
 g_regex_get_string_number
+g_regex_get_compile_flags
+g_regex_get_match_flags
 g_regex_escape_string
 g_regex_match_simple
 g_regex_match
diff --git a/docs/reference/glib/tmpl/gregex.sgml b/docs/reference/glib/tmpl/gregex.sgml
index 51fbeb8..f3d4479 100644
--- a/docs/reference/glib/tmpl/gregex.sgml
+++ b/docs/reference/glib/tmpl/gregex.sgml
@@ -326,6 +326,24 @@ need the #GRegex or the matched string.
 @Returns: 
 
 
+<!-- ##### FUNCTION g_regex_get_compile_flags ##### -->
+<para>
+
+</para>
+
+ regex: 
+ Returns: 
+
+
+<!-- ##### FUNCTION g_regex_get_match_flags ##### -->
+<para>
+
+</para>
+
+ regex: 
+ Returns: 
+
+
 <!-- ##### FUNCTION g_regex_escape_string ##### -->
 <para>
 
diff --git a/glib/glib.symbols b/glib/glib.symbols
index 859fc9f..9ae94c6 100644
--- a/glib/glib.symbols
+++ b/glib/glib.symbols
@@ -1631,6 +1631,8 @@ g_regex_get_pattern
 g_regex_get_max_backref
 g_regex_get_capture_count
 g_regex_get_string_number
+g_regex_get_compile_flags
+g_regex_get_match_flags
 g_regex_escape_string
 g_regex_match_simple
 g_regex_match
diff --git a/glib/gregex.c b/glib/gregex.c
index 7e3448f..4a305b8 100644
--- a/glib/gregex.c
+++ b/glib/gregex.c
@@ -1268,6 +1268,42 @@ g_regex_get_capture_count (const GRegex *regex)
 }
 
 /**
+ * g_regex_get_compile_flags:
+ * @regex: a #GRegex
+ *
+ * Returns the compile options that @regex was created with.
+ *
+ * Returns: flags from #GRegexCompileFlags
+ *
+ * Since: 2.26
+ */
+GRegexCompileFlags
+g_regex_get_compile_flags (GRegex *regex)
+{
+  g_return_val_if_fail (regex != NULL, 0);
+
+  return regex->compile_opts;
+}
+
+/**
+ * g_regex_get_match_flags:
+ * @regex: a #GRegex
+ *
+ * Returns the match options that @regex was created with.
+ *
+ * Returns: flags from #GRegexMatchFlags
+ *
+ * Since: 2.26
+ */
+GRegexMatchFlags
+g_regex_get_match_flags (GRegex *regex)
+{
+  g_return_val_if_fail (regex != NULL, 0);
+
+  return regex->match_opts;
+}
+
+/**
  * g_regex_match_simple:
  * @pattern: the regular expression
  * @string: the string to scan for matches
diff --git a/glib/gregex.h b/glib/gregex.h
index a96fbda..af2ec4a 100644
--- a/glib/gregex.h
+++ b/glib/gregex.h
@@ -140,6 +140,9 @@ gint		  g_regex_get_string_number	(const GRegex        *regex,
 gchar		 *g_regex_escape_string		(const gchar         *string,
 						 gint                 length);
 
+GRegexCompileFlags g_regex_get_compile_flags    (GRegex              *regex);
+GRegexMatchFlags   g_regex_get_match_flags      (GRegex              *regex);
+
 /* Matching. */
 gboolean	  g_regex_match_simple		(const gchar         *pattern,
 						 const gchar         *string,



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