Split GRegex into GRegex and GMatchInfo. (#419368, Marco Barisione)

2007-04-30  Matthias Clasen  <mclasen@redhat.com>

        * glib/glib.symbols:
        * glib/gregex.[hc]: Split GRegex into GRegex and GMatchInfo.
        (#419368, Marco Barisione)

        * tests/regex-test.c: Adapt.


svn path=/trunk/; revision=5468
This commit is contained in:
Matthias Clasen
2007-04-30 16:02:26 +00:00
committed by Matthias Clasen
parent 3dd3293d87
commit a793051fda
8 changed files with 1171 additions and 2029 deletions

View File

@@ -1,3 +1,9 @@
2007-04-30 Matthias Clasen <mclasen@redhat.com>
* glib/glib-sections.txt:
* glib/tmpl/gregex.sgml: Update for the GRegex/GMatchInfo
split.
2007-04-24 Matthias Clasen <mclasen@redhat.com>
* glib/glib-sections.txt: Add g_option_context_get_help.

View File

@@ -874,35 +874,31 @@ GRegex
GRegexEvalCallback
g_regex_new
g_regex_free
g_regex_optimize
g_regex_copy
g_regex_get_pattern
g_regex_clear
g_regex_get_string_number
g_regex_escape_string
g_regex_match_simple
g_regex_match
g_regex_match_full
g_regex_match_next
g_regex_match_next_full
g_regex_match_all
g_regex_match_all_full
g_regex_get_match_count
g_regex_is_partial_match
g_regex_fetch
g_regex_fetch_pos
g_regex_fetch_named
g_regex_fetch_named_pos
g_regex_fetch_all
g_regex_get_string_number
g_regex_split_simple
g_regex_split
g_regex_split_full
g_regex_split_next
g_regex_split_next_full
g_regex_expand_references
g_regex_replace
g_regex_replace_literal
g_regex_replace_eval
g_regex_escape_string
GMatchInfo
g_match_info_free
g_match_info_next
g_match_info_get_match_count
g_match_info_is_partial_match
g_match_info_expand_references
g_match_info_fetch
g_match_info_fetch_pos
g_match_info_fetch_named
g_match_info_fetch_named_pos
g_match_info_fetch_all
<SUBSECTION Private>
g_regex_error_quark
</SECTION>

View File

@@ -56,10 +56,10 @@ encountered. This indicates a comment that lasts until after the next
newline.
</para>
<para>
If you have two threads manipulating the same #GRegex, they must use a
lock to synchronize their operation, as these functions are not threadsafe.
Creating and manipulating different #GRegex structures from different
threads is not a problem.
Creating and manipulating the same #GRegex structure from different
threads is not a problem as #GRegex does not modify its internal
state between creation and destruction, on the other hand #GMatchInfo is
not threadsafe.
</para>
<para>
The regular expressions low level functionalities are obtained through
@@ -81,7 +81,7 @@ Error codes returned by regular expressions functions.
</para>
@G_REGEX_ERROR_COMPILE: Compilation of the regular expression in g_regex_new() failed.
@G_REGEX_ERROR_OPTIMIZE: Optimization of the regular expression in g_regex_optimize() failed.
@G_REGEX_ERROR_OPTIMIZE: Optimization of the regular expression failed.
@G_REGEX_ERROR_REPLACE: Replacement failed due to an ill-formed replacement string.
@G_REGEX_ERROR_MATCH: The match process failed.
@Since: 2.14
@@ -139,6 +139,9 @@ flag they are considered as a raw sequence of bytes.
parentheses in the pattern. Any opening parenthesis that is not followed
by "?" behaves as if it were followed by "?:" but named parentheses can
still be used for capturing (and they acquire numbers in the usual way).
@G_REGEX_OPTIMIZE: Optimize the regular expression. If the pattern will
be used many times, then it may be worth the effort to optimize it to
improve the speed of matches.
@G_REGEX_DUPNAMES: Names used to identify capturing subpatterns need not
be unique. This can be helpful for certain types of pattern when it is known
that only one instance of the named subpattern can ever be matched.
@@ -204,17 +207,12 @@ It is called for each occurance of the pattern @regex in @string, and it
should append the replacement to @result.
</para>
<para>
Do not call on @regex functions that modify its internal state, such as
g_regex_match(); if you need it you can create a temporary copy of
@regex using g_regex_copy().
</para>
@Param1: a #GRegex.
@Param2: the string used to perform matches against.
@Param3: a #GString containing the new string.
@Param4: user data passed to g_regex_replace_eval().
@Returns: %FALSE to continue the replacement process, %TRUE to stop it.
@Param1: the #GRegex passed to g_regex_replace_eval()
@Param2: the #GMatchInfo generated by the match
@Param3: the string used to perform matches against
@Param4: a #GString containing the new string
@Param5: user data passed to g_regex_replace_eval()
@Returns: %FALSE to continue the replacement process, %TRUE to stop it
@Since: 2.14
@@ -238,25 +236,6 @@ g_regex_match(); if you need it you can create a temporary copy of
@regex:
<!-- ##### FUNCTION g_regex_optimize ##### -->
<para>
</para>
@regex:
@error:
@Returns:
<!-- ##### FUNCTION g_regex_copy ##### -->
<para>
</para>
@regex:
@Returns:
<!-- ##### FUNCTION g_regex_get_pattern ##### -->
<para>
@@ -266,12 +245,24 @@ g_regex_match(); if you need it you can create a temporary copy of
@Returns:
<!-- ##### FUNCTION g_regex_clear ##### -->
<!-- ##### FUNCTION g_regex_get_string_number ##### -->
<para>
</para>
@regex:
@name:
@Returns:
<!-- ##### FUNCTION g_regex_escape_string ##### -->
<para>
</para>
@string:
@length:
@Returns:
<!-- ##### FUNCTION g_regex_match_simple ##### -->
@@ -294,6 +285,7 @@ g_regex_match(); if you need it you can create a temporary copy of
@regex:
@string:
@match_options:
@match_info:
@Returns:
@@ -307,31 +299,7 @@ g_regex_match(); if you need it you can create a temporary copy of
@string_len:
@start_position:
@match_options:
@error:
@Returns:
<!-- ##### FUNCTION g_regex_match_next ##### -->
<para>
</para>
@regex:
@string:
@match_options:
@Returns:
<!-- ##### FUNCTION g_regex_match_next_full ##### -->
<para>
</para>
@regex:
@string:
@string_len:
@start_position:
@match_options:
@match_info:
@error:
@Returns:
@@ -344,6 +312,7 @@ g_regex_match(); if you need it you can create a temporary copy of
@regex:
@string:
@match_options:
@match_info:
@Returns:
@@ -357,94 +326,11 @@ g_regex_match(); if you need it you can create a temporary copy of
@string_len:
@start_position:
@match_options:
@match_info:
@error:
@Returns:
<!-- ##### FUNCTION g_regex_get_match_count ##### -->
<para>
</para>
@regex:
@Returns:
<!-- ##### FUNCTION g_regex_is_partial_match ##### -->
<para>
</para>
@regex:
@Returns:
<!-- ##### FUNCTION g_regex_fetch ##### -->
<para>
</para>
@regex:
@match_num:
@string:
@Returns:
<!-- ##### FUNCTION g_regex_fetch_pos ##### -->
<para>
</para>
@regex:
@match_num:
@start_pos:
@end_pos:
@Returns:
<!-- ##### FUNCTION g_regex_fetch_named ##### -->
<para>
</para>
@regex:
@name:
@string:
@Returns:
<!-- ##### FUNCTION g_regex_fetch_named_pos ##### -->
<para>
</para>
@regex:
@name:
@start_pos:
@end_pos:
@Returns:
<!-- ##### FUNCTION g_regex_fetch_all ##### -->
<para>
</para>
@regex:
@string:
@Returns:
<!-- ##### FUNCTION g_regex_get_string_number ##### -->
<para>
</para>
@regex:
@name:
@Returns:
<!-- ##### FUNCTION g_regex_split_simple ##### -->
<para>
@@ -483,43 +369,6 @@ g_regex_match(); if you need it you can create a temporary copy of
@Returns:
<!-- ##### FUNCTION g_regex_split_next ##### -->
<para>
</para>
@regex:
@string:
@match_options:
@Returns:
<!-- ##### FUNCTION g_regex_split_next_full ##### -->
<para>
</para>
@regex:
@string:
@string_len:
@start_position:
@match_options:
@error:
@Returns:
<!-- ##### FUNCTION g_regex_expand_references ##### -->
<para>
</para>
@regex:
@string:
@string_to_expand:
@error:
@Returns:
<!-- ##### FUNCTION g_regex_replace ##### -->
<para>
@@ -566,13 +415,112 @@ g_regex_match(); if you need it you can create a temporary copy of
@Returns:
<!-- ##### FUNCTION g_regex_escape_string ##### -->
<!-- ##### STRUCT GMatchInfo ##### -->
<para>
#GMatchInfo is used to retrieve information about the regular expression match
which created it.
This structure is opaque and its fields cannot be accessed directly.
</para>
@Since: 2.14
<!-- ##### FUNCTION g_match_info_free ##### -->
<para>
</para>
@string:
@length:
@match_info:
<!-- ##### FUNCTION g_match_info_next ##### -->
<para>
</para>
@match_info:
@error:
@Returns:
<!-- ##### FUNCTION g_match_info_get_match_count ##### -->
<para>
</para>
@match_info:
@Returns:
<!-- ##### FUNCTION g_match_info_is_partial_match ##### -->
<para>
</para>
@match_info:
@Returns:
<!-- ##### FUNCTION g_match_info_expand_references ##### -->
<para>
</para>
@match_info:
@string_to_expand:
@error:
@Returns:
<!-- ##### FUNCTION g_match_info_fetch ##### -->
<para>
</para>
@match_info:
@match_num:
@Returns:
<!-- ##### FUNCTION g_match_info_fetch_pos ##### -->
<para>
</para>
@match_info:
@match_num:
@start_pos:
@end_pos:
@Returns:
<!-- ##### FUNCTION g_match_info_fetch_named ##### -->
<para>
</para>
@match_info:
@name:
@Returns:
<!-- ##### FUNCTION g_match_info_fetch_named_pos ##### -->
<para>
</para>
@match_info:
@name:
@start_pos:
@end_pos:
@Returns:
<!-- ##### FUNCTION g_match_info_fetch_all ##### -->
<para>
</para>
@match_info:
@Returns: