Commit Graph

99 Commits

Author SHA1 Message Date
Phillip Wood
38c4e31c8a Fix documentation typos
Character entities are not supposed to be supported by gtk-doc¹ and
fix the spelling of ‘optional’

¹https://bugzilla.gnome.org/show_bug.cgi?id=758137

https://bugzilla.gnome.org/show_bug.cgi?id=758174
2016-04-11 23:31:38 -04:00
Sébastien Wilmet
f14052461b docs: GRegex: @start_position is in bytes
The start_position arguments are passed to pcre_exec() as the
startoffset, which is in bytes (not characters).

I had recently a doubt about this, so it's better to document it.

https://bugzilla.gnome.org/show_bug.cgi?id=747927
2016-01-28 18:49:28 +01:00
Sebastian Geiger
192781d4b5 gregex: improve documentation for g_regex_new 2016-01-24 22:04:33 +01:00
Simon McVittie
bf181a3ac7 regex: if PCRE is 8.34 or later, disable auto-possessification for DFA
Normally, recent PCRE behaves as if certain patterns were replaced
by a more "possessive" pattern that gives the same answer for normal
regex matching, but is more efficient. However, the modified pattern
produces fewer results under DFA. If we want the full set of results
we have to apply PCRE_NO_AUTO_POSSESS, and that's a compile-time flag.

This currently only affects a system PCRE, but would also work fine for
an internal PCRE 8.34 or later if the embedded copy is updated.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=733325
Reviewed-by: Christian Persch <chpe@gnome.org>
2015-06-09 18:15:28 +01:00
Matthias Clasen
bc6ee788b4 docs: let go of &ast;
Since we are no longer using sgml mode, using /&ast; &ast;/ to
escape block comments inside examples does not work anymore.
Switch to using line comments with //
2014-02-14 21:33:36 -05:00
Matthias Clasen
35066ed6c6 Docs: Drop entities, switch away from sgml mode
Since all element markup is now gone from the doc comments,
we can turn off the gtk-doc sgml mode, which means that from
now on, docbook markup is no longer allowed in doc comments.

To make this possible, we have to replace all remaining
entities in doc comments by their replacement text, &amp; -> &
and so on.
2014-02-09 02:07:26 -05:00
Matthias Clasen
e7fd3de86d Eradicate links and xrefs
These are all replaced by markdown ref links.
2014-02-08 12:26:56 -05:00
Matthias Clasen
cb588d4532 Convert external links to markdown syntax 2014-02-05 21:23:28 -05:00
Matthias Clasen
adf892e96a Annotate all examples with their language
The C ones, at least.
2014-02-01 15:11:49 -05:00
Matthias Clasen
77c4ff80dc docs: Stop using the function tag 2014-02-01 12:19:04 -05:00
Matthias Clasen
42cf80780b Docs: Big entity cleanup
Strip lots of entity use from |[ ]| examples (which are now
implicit CDATA). Also remove many redundant uses of <!-- -->.
2014-02-01 12:00:30 -05:00
Matthias Clasen
c93c05faa3 gregex: Convert docs to markdown
In particular, convert lists to markdown syntax.
2014-02-01 10:22:45 -05:00
Sébastien Wilmet
6fbb146342 GRegex: add g_regex_get_max_lookbehind()
It is useful for multi-segment regex matching.

A unit test is included.

https://bugzilla.gnome.org/show_bug.cgi?id=689794
2013-07-23 15:43:22 +02:00
Sébastien Wilmet
4f327d6379 GRegex: update documentation for partial matching
The restrictions on partial matching no longer apply with PCRE >= 8.00.

The pcrepartial manpage contains the "FORMERLY RESTRICTED PATTERNS"
section:

"For  releases  of PCRE prior to 8.00, because of the way certain
internal optimizations were implemented in the pcre_exec() function, the
PCRE_PARTIAL option (predecessor of PCRE_PARTIAL_SOFT) could not be used
with all patterns. From release 8.00 onwards, the restrictions no
longer  apply,  and  partial  matching  with  can  be requested for any
pattern."

https://bugzilla.gnome.org/show_bug.cgi?id=704250
2013-07-20 11:07:46 +02:00
Cosimo Cecchi
4b602940e2 glib: don't quote quark names for G_DEFINE_QUARK 2012-08-28 13:16:24 -04:00
Matthias Clasen
4f12f7c029 Use G_DEFINE_QUARK for GLib's own quarks
This commit just deals with glib/.
gobject/ and gio/ will be handled in separate commits.
2012-08-28 00:08:07 -04:00
Matthias Clasen
6bee6dbce5 Miscellaneous string fixes
Typo and punctuation fixes, and some rewording, based
on a patch by Philip Withnall, bug
https://bugzilla.gnome.org/review?bug=628193
2012-08-16 23:02:41 -04:00
Matthias Clasen
34b2125edf Fix doc build 2012-07-13 17:37:12 -04:00
Krzesimir Nowak
ce1b50bf2a GRegex, GConvert: Add some missing annotations.
Also, removed pointless (allow-none) return annotation.

https://bugzilla.gnome.org/show_bug.cgi?id=679762
2012-07-12 16:09:57 +02:00
Christian Persch
53b3175cfa regex: Add new GRegexError code from PCRE 8.31 2012-07-07 22:08:08 +02:00
Daniel Mustieles
1519d6b894 Fixed a a «big bug» in a string ;-) 2012-07-02 17:24:45 +02:00
Christian Persch
a2f54a3408 regex: Add FIRSTLINE compile flag
This option exists since PCRE 6.0.
2012-07-02 15:59:39 +02:00
Christian Persch
e99e34f65f regex: Add NOTEMPTY_ATSTART match option
Since PCRE 8.00 it supports a variant of PCRE_NOTEMPTY that works
similarly except that it only applies to the start of the matched string
but permits empty matches further in.
2012-07-02 15:59:39 +02:00
Christian Persch
1171215014 regex: Add PARTIAL_HARD match option
Since PCRE 8.00 it supports a new partial matching method PCRE_PARTIAL_HARD.
2012-07-02 15:59:39 +02:00
Christian Persch
0a2967030a regex: Add JavaScript compat mode
Since PCRE 7.7, there's a flag that changes the behaviour to be more
JavaScript compatible. Since it's no effort to expose it, just do so.
2012-07-02 15:59:39 +02:00
Christian Persch
e5550a24db regex: Don't leak internal PCRE options
g_regex_get_compile_get_compile_flags() and g_regex_get_match_flags()
were leaking PCRE flags that don't exist in the corresponding
public GRegexCompileFlags and GRegexMatchFlags; this change masks
these internal flags.
2012-07-02 15:59:39 +02:00
Christian Persch
26d91ddc08 regex: Add BSR_ANYCRLF and BSR_ANY match options
These flags override the compile option at match time. They use PCRE_BSR_ANYCRLF
and PCRE_BSR_UNICODE, resp., which make \R match only CR, LF and CRLF, or any
Unicode newline character or character sequences, resp.
2012-07-02 15:59:39 +02:00
Christian Persch
88ac3839f5 regex: Add BSR_ANYCRLF compile option
When this flag is set, \R only matches CR, LF and CRLF.
2012-07-02 15:59:39 +02:00
Christian Persch
86a04a05e6 regex: Fix newline definition for system PCRE
While we PCRE_BSR_UNICODE is the default in the internal PCRE, that may
not be true for the system one. Force the PCRE_BSR_UNICODE flag on it.
2012-07-02 15:59:39 +02:00
Christian Persch
91ba8ae156 regex: Don't return from inside a g_once_init_enter/leave block
When using the system PCRE, and it was compiled with incompatible options,
the code was returning from inside a g_once_init_enter/leave block without
calling g_once_init_leave().
2012-07-02 15:59:38 +02:00
Christian Persch
69a12e3275 regex: Add accessor for PCRE_INFO_HASCRORLF
This flag is new in PCRE 7.3, and checks whether there is an explicit
CR or LF reference in the pattern.
2012-07-02 15:59:34 +02:00
Christian Persch
7ada976516 regex: Remove message for unused error code
Since PCRE 7.3 the PCRE_ERROR_NULLWSLIMIT error is not returned anymore.
2012-07-02 14:17:34 +02:00
Christian Persch
592531019e regex: Add NEWLINE_ANYCRLF match option
This PCRE option is new in PCRE 7.1.
2012-07-02 14:17:34 +02:00
Christian Persch
c8c049b177 regex: Add NEWLINE_ANYCRLF compile option
The PCRE_NEWLINE_ANYCRLF option is new in PCRE 7.1. With it set, the only
only newline sequences recognised are CR, LF and CRLF.
2012-07-02 14:17:34 +02:00
Christian Persch
7e8b5ea442 regex: Assert that our flags values are the same as PCRE's
We rely on those flags having the same values as PCRE's (so we can pass
them right through), so assert this at compile time.
2012-07-02 14:17:34 +02:00
Christian Persch
6d5484b296 regex: Handle PCRE_ERROR_RECURSIONLOOP
Was missing from the error conversion routine.
2012-07-01 14:00:11 +02:00
Christian Persch
7e5615138a regex: Update GRegexError with newer PCRE error codes
Update the GRegexError enum with new PCRE errors up to PCRE 8.30.

https://bugzilla.gnome.org/show_bug.cgi?id=677579
2012-07-01 14:00:11 +02:00
Christian Persch
20ab7e2aea regex: Deprecate an obsolete error code
G_REGEX_ERROR_DEFINE_REPETION is dead and never raised by PCRE.
2012-07-01 14:00:11 +02:00
Christian Persch
d9e8d3e0f0 regex: Fix PCRE error code conversion
Use the shifted error codes for comparisions.

https://bugzilla.gnome.org/show_bug.cgi?id=677578
2012-07-01 14:00:11 +02:00
Robert Ancell
4143842eb4 Add missing allow-none annotations for function parameters.
Found using:
find . -name '*.c' | xargs grep 'or %NULL' | grep ' \* @' | grep -v '@error' | grep -v allow-none
2012-03-31 20:34:28 +11:00
Javier Jardón
2ae83e116b glib/*: Use g_list_free_full() 2012-01-03 16:53:47 +01:00
Chun-wei Fan
8f340e2d75 Fix warning/error C4013 (implicit declarations)
-Include gthread.h in gregex.c as g_once_init_enter and g_once_init_leave
 are used.
-Define prototype for g_thread_DllMain in gthreadprivate.h for Windows
2011-09-25 09:07:59 +08:00
Ryan Lortie
066c7b8121 GRegex: fix thread-unsafe initialiser code 2011-09-09 19:54:06 -04:00
Matthias Clasen
1b28408b8b Spelling fixes
Spelling fixes in comments and docs, provided by
Kjartan Maraas in bug 657336.
2011-08-29 14:49:32 -04:00
Paolo Bonzini
5eee90fbbc add g_regex_escape_nul
The function can be used to let regex compile non-NUL-terminated
strings without redesigning the way the pattern is stored in GRegex
objects and retrieved with g_regex_get_pattern.

https://bugzilla.gnome.org/show_bug.cgi?id=615895
2011-07-11 00:02:22 -04:00
Christian Persch
c2b112bc56 Typo fix 2011-06-24 01:07:18 +02:00
Christian Persch
00afe3fed3 Make GMatchInfo refcounted 2011-06-24 01:03:46 +02:00
Matthias Clasen
77110304cc Cosmetic changes
Use inc/dec for refcounting.
2011-05-23 00:48:10 -04:00
Matthias Clasen
f8b154f53a GMatchInfo: improve struct packing 2011-04-12 09:55:59 -04:00
Matthias Clasen
c03dc6bf7d Update the included copy of PCRE
Update PCRE to version 8.12.
At the same time, also add Unicode 6.0 script support.
2011-01-21 23:10:01 -05:00