blob: 3d3e0deb22488c9f41311f7e7d89ddab50f40ebb [file] [log] [blame]
Elliott Hughes9bc971b2018-07-27 13:23:14 -07001.TH PCRE2_GET_ERROR_MESSAGE 3 "24 March 2017" "PCRE2 10.30"
Janis Danisevskis53e448c2016-03-31 13:35:25 +01002.SH NAME
3PCRE2 - 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
17This function provides a textual error message for each PCRE2 error code.
18Compilation errors are positive numbers; UTF formatting errors and matching
19errors 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 Hughes9bc971b2018-07-27 13:23:14 -070025The function returns the length of the message in code units, excluding the
26trailing zero, or the negative error code PCRE2_ERROR_NOMEMORY if the buffer is
27too small. In this case, the returned message is truncated (but still with a
28trailing zero). If \fIerrorcode\fP does not contain a recognized error code
29number, the negative value PCRE2_ERROR_BADDATA is returned.
Janis Danisevskis53e448c2016-03-31 13:35:25 +010030.P
31There is a complete description of the PCRE2 native API in the
32.\" HREF
33\fBpcre2api\fP
34.\"
35page and a description of the POSIX API in the
36.\" HREF
37\fBpcre2posix\fP
38.\"
39page.