diff --git a/doc/html/pcre2_compile.html b/doc/html/pcre2_compile.html index 2c85655..615e090 100644 --- a/doc/html/pcre2_compile.html +++ b/doc/html/pcre2_compile.html @@ -98,8 +98,12 @@ private data structure that contains the compiled pattern, or NULL if an error was detected. In the error case, a text error message can be obtained by passing the value returned via the errorcode argument to the the pcre2_get_error_message() function. The offset (in code units) where the -error was encountered is returned via the erroroffset argument. Both -values are set to zero for a successful return. +error was encountered is returned via the erroroffset argument. +

+

+If there is no error, the value passed via errorcode returns the message +"no error" if passed to pcre2_get_error_message(), and the value passed +via erroroffset is zero.

There is a complete description of the PCRE2 native API, with more detail on diff --git a/doc/html/pcre2api.html b/doc/html/pcre2api.html index c1fe824..ec2e2b2 100644 --- a/doc/html/pcre2api.html +++ b/doc/html/pcre2api.html @@ -1383,8 +1383,7 @@ If errorcode or erroroffset is NULL, pcre2_compile() return NULL immediately. Otherwise, the variables to which these point are set to an error code and an offset (number of code units) within the pattern, respectively, when pcre2_compile() returns NULL because a compilation -error has occurred. The values are both zero when compilation is successful -and pcre2_compile() returns a non-NULL value. +error has occurred.

There are nearly 100 positive error codes that pcre2_compile() may return @@ -1399,15 +1398,18 @@ because the textual error messages that are obtained by calling the message" below) should be self-explanatory. Macro names starting with PCRE2_ERROR_ are defined -for both positive and negative error codes in pcre2.h. +for both positive and negative error codes in pcre2.h. When compilation +is successful errorcode is set to a value that returns the message "no +error" if passed to pcre2_get_error_message().

The value returned in erroroffset is an indication of where in the -pattern the error occurred. It is not necessarily the furthest point in the -pattern that was read. For example, after the error "lookbehind assertion is -not fixed length", the error offset points to the start of the failing -assertion. For an invalid UTF-8 or UTF-16 string, the offset is that of the -first code unit of the failing character. +pattern an error occurred. When there is no error, zero is returned. A non-zero +value is not necessarily the furthest point in the pattern that was read. For +example, after the error "lookbehind assertion is not fixed length", the error +offset points to the start of the failing assertion. For an invalid UTF-8 or +UTF-16 string, the offset is that of the first code unit of the failing +character.

Some errors are not detected until the whole pattern has been scanned; in these diff --git a/doc/pcre2.txt b/doc/pcre2.txt index d2aefaa..c318432 100644 --- a/doc/pcre2.txt +++ b/doc/pcre2.txt @@ -1372,27 +1372,29 @@ COMPILING A PATTERN diately. Otherwise, the variables to which these point are set to an error code and an offset (number of code units) within the pattern, re- spectively, when pcre2_compile() returns NULL because a compilation er- - ror has occurred. The values are both zero when compilation is success- - ful and pcre2_compile() returns a non-NULL value. + ror has occurred. - There are nearly 100 positive error codes that pcre2_compile() may re- - turn if it finds an error in the pattern. There are also some negative - error codes that are used for invalid UTF strings when validity check- - ing is in force. These are the same as given by pcre2_match() and + There are nearly 100 positive error codes that pcre2_compile() may re- + turn if it finds an error in the pattern. There are also some negative + error codes that are used for invalid UTF strings when validity check- + ing is in force. These are the same as given by pcre2_match() and pcre2_dfa_match(), and are described in the pcre2unicode documentation. - There is no separate documentation for the positive error codes, be- - cause the textual error messages that are obtained by calling the + There is no separate documentation for the positive error codes, be- + cause the textual error messages that are obtained by calling the pcre2_get_error_message() function (see "Obtaining a textual error mes- - sage" below) should be self-explanatory. Macro names starting with - PCRE2_ERROR_ are defined for both positive and negative error codes in - pcre2.h. + sage" below) should be self-explanatory. Macro names starting with + PCRE2_ERROR_ are defined for both positive and negative error codes in + pcre2.h. When compilation is successful errorcode is set to a value + that returns the message "no error" if passed to pcre2_get_error_mes- + sage(). The value returned in erroroffset is an indication of where in the pat- - tern the error occurred. It is not necessarily the furthest point in - the pattern that was read. For example, after the error "lookbehind as- - sertion is not fixed length", the error offset points to the start of - the failing assertion. For an invalid UTF-8 or UTF-16 string, the off- - set is that of the first code unit of the failing character. + tern an error occurred. When there is no error, zero is returned. A + non-zero value is not necessarily the furthest point in the pattern + that was read. For example, after the error "lookbehind assertion is + not fixed length", the error offset points to the start of the failing + assertion. For an invalid UTF-8 or UTF-16 string, the offset is that of + the first code unit of the failing character. Some errors are not detected until the whole pattern has been scanned; in these cases, the offset passed back is the length of the pattern. diff --git a/doc/pcre2_compile.3 b/doc/pcre2_compile.3 index 441f45d..5a07b8b 100644 --- a/doc/pcre2_compile.3 +++ b/doc/pcre2_compile.3 @@ -86,8 +86,11 @@ private data structure that contains the compiled pattern, or NULL if an error was detected. In the error case, a text error message can be obtained by passing the value returned via the \fIerrorcode\fP argument to the the \fBpcre2_get_error_message()\fP function. The offset (in code units) where the -error was encountered is returned via the \fIerroroffset\fP argument. Both -values are set to zero for a successful return. +error was encountered is returned via the \fIerroroffset\fP argument. +.P +If there is no error, the value passed via \fIerrorcode\fP returns the message +"no error" if passed to \fBpcre2_get_error_message()\fP, and the value passed +via \fIerroroffset\fP is zero. .P There is a complete description of the PCRE2 native API, with more detail on each option, in the diff --git a/doc/pcre2api.3 b/doc/pcre2api.3 index 4c840c3..1cc8892 100644 --- a/doc/pcre2api.3 +++ b/doc/pcre2api.3 @@ -1323,8 +1323,7 @@ If \fIerrorcode\fP or \fIerroroffset\fP is NULL, \fBpcre2_compile()\fP returns NULL immediately. Otherwise, the variables to which these point are set to an error code and an offset (number of code units) within the pattern, respectively, when \fBpcre2_compile()\fP returns NULL because a compilation -error has occurred. The values are both zero when compilation is successful -and \fBpcre2_compile()\fP returns a non-NULL value. +error has occurred. .P There are nearly 100 positive error codes that \fBpcre2_compile()\fP may return if it finds an error in the pattern. There are also some negative error codes @@ -1343,14 +1342,17 @@ message" below) .\" should be self-explanatory. Macro names starting with PCRE2_ERROR_ are defined -for both positive and negative error codes in \fBpcre2.h\fP. +for both positive and negative error codes in \fBpcre2.h\fP. When compilation +is successful \fIerrorcode\fP is set to a value that returns the message "no +error" if passed to \fBpcre2_get_error_message()\fP. .P The value returned in \fIerroroffset\fP is an indication of where in the -pattern the error occurred. It is not necessarily the furthest point in the -pattern that was read. For example, after the error "lookbehind assertion is -not fixed length", the error offset points to the start of the failing -assertion. For an invalid UTF-8 or UTF-16 string, the offset is that of the -first code unit of the failing character. +pattern an error occurred. When there is no error, zero is returned. A non-zero +value is not necessarily the furthest point in the pattern that was read. For +example, after the error "lookbehind assertion is not fixed length", the error +offset points to the start of the failing assertion. For an invalid UTF-8 or +UTF-16 string, the offset is that of the first code unit of the failing +character. .P Some errors are not detected until the whole pattern has been scanned; in these cases, the offset passed back is the length of the pattern. Note that the