Add API to get the compile and match flags from a GRegex
authorChristian Persch <chpe@gnome.org>
Wed, 28 Apr 2010 10:36:30 +0000 (12:36 +0200)
committerChristian Persch <chpe@gnome.org>
Sat, 1 May 2010 11:57:11 +0000 (13:57 +0200)
Bug #616967.

docs/reference/glib/glib-sections.txt
docs/reference/glib/tmpl/gregex.sgml
glib/glib.symbols
glib/gregex.c
glib/gregex.h

index c0b2606..ae4020e 100644 (file)
@@ -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
index 51fbeb8..f3d4479 100644 (file)
@@ -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>
 
index 859fc9f..9ae94c6 100644 (file)
@@ -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
index 7e3448f..4a305b8 100644 (file)
@@ -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
index a96fbda..af2ec4a 100644 (file)
@@ -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,