Elliott Hughes | 9bc971b | 2018-07-27 13:23:14 -0700 | [diff] [blame] | 1 | .TH PCRE2_GET_ERROR_MESSAGE 3 "24 March 2017" "PCRE2 10.30" |
Janis Danisevskis | 53e448c | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 2 | .SH NAME |
| 3 | PCRE2 - Perl-compatible regular expressions (revised API) |
| 4 | .SH SYNOPSIS |
| 5 | .rs |
| 6 | .sp |
| 7 | .B #include <pcre2.h> |
| 8 | .PP |
| 9 | .nf |
| 10 | .B int pcre2_get_error_message(int \fIerrorcode\fP, PCRE2_UCHAR *\fIbuffer\fP, |
| 11 | .B " PCRE2_SIZE \fIbufflen\fP);" |
| 12 | .fi |
| 13 | . |
| 14 | .SH DESCRIPTION |
| 15 | .rs |
| 16 | .sp |
| 17 | This function provides a textual error message for each PCRE2 error code. |
| 18 | Compilation errors are positive numbers; UTF formatting errors and matching |
| 19 | errors are negative numbers. The arguments are: |
| 20 | .sp |
| 21 | \fIerrorcode\fP an error code (positive or negative) |
| 22 | \fIbuffer\fP where to put the message |
| 23 | \fIbufflen\fP the length of the buffer (code units) |
| 24 | .sp |
Elliott Hughes | 9bc971b | 2018-07-27 13:23:14 -0700 | [diff] [blame] | 25 | The function returns the length of the message in code units, excluding the |
| 26 | trailing zero, or the negative error code PCRE2_ERROR_NOMEMORY if the buffer is |
| 27 | too small. In this case, the returned message is truncated (but still with a |
| 28 | trailing zero). If \fIerrorcode\fP does not contain a recognized error code |
| 29 | number, the negative value PCRE2_ERROR_BADDATA is returned. |
Janis Danisevskis | 53e448c | 2016-03-31 13:35:25 +0100 | [diff] [blame] | 30 | .P |
| 31 | There is a complete description of the PCRE2 native API in the |
| 32 | .\" HREF |
| 33 | \fBpcre2api\fP |
| 34 | .\" |
| 35 | page and a description of the POSIX API in the |
| 36 | .\" HREF |
| 37 | \fBpcre2posix\fP |
| 38 | .\" |
| 39 | page. |