Blame doc/pcre2_serialize_decode.3

Packit Service 02e2fd
.TH PCRE2_SERIALIZE_DECODE 3 "27 June 2018" "PCRE2 10.32"
Packit Service 02e2fd
.SH NAME
Packit Service 02e2fd
PCRE2 - Perl-compatible regular expressions (revised API)
Packit Service 02e2fd
.SH SYNOPSIS
Packit Service 02e2fd
.rs
Packit Service 02e2fd
.sp
Packit Service 02e2fd
.B #include <pcre2.h>
Packit Service 02e2fd
.PP
Packit Service 02e2fd
.nf
Packit Service 02e2fd
.B int32_t pcre2_serialize_decode(pcre2_code **\fIcodes\fP,
Packit Service 02e2fd
.B "  int32_t \fInumber_of_codes\fP, const uint8_t *\fIbytes\fP,"
Packit Service 02e2fd
.B "  pcre2_general_context *\fIgcontext\fP);"
Packit Service 02e2fd
.fi
Packit Service 02e2fd
.
Packit Service 02e2fd
.SH DESCRIPTION
Packit Service 02e2fd
.rs
Packit Service 02e2fd
.sp
Packit Service 02e2fd
This function decodes a serialized set of compiled patterns back into a list of
Packit Service 02e2fd
individual patterns. This is possible only on a host that is running the same
Packit Service 02e2fd
version of PCRE2, with the same code unit width, and the host must also have
Packit Service 02e2fd
the same endianness, pointer width and PCRE2_SIZE type. The arguments for
Packit Service 02e2fd
\fBpcre2_serialize_decode()\fP are:
Packit Service 02e2fd
.sp
Packit Service 02e2fd
  \fIcodes\fP            pointer to a vector in which to build the list
Packit Service 02e2fd
  \fInumber_of_codes\fP  number of slots in the vector
Packit Service 02e2fd
  \fIbytes\fP            the serialized byte stream
Packit Service 02e2fd
  \fIgcontext\fP         pointer to a general context or NULL
Packit Service 02e2fd
.sp
Packit Service 02e2fd
The \fIbytes\fP argument must point to a block of data that was originally
Packit Service 02e2fd
created by \fBpcre2_serialize_encode()\fP, though it may have been saved on
Packit Service 02e2fd
disc or elsewhere in the meantime. If there are more codes in the serialized
Packit Service 02e2fd
data than slots in the list, only those compiled patterns that will fit are
Packit Service 02e2fd
decoded. The yield of the function is the number of decoded patterns, or one of
Packit Service 02e2fd
the following negative error codes:
Packit Service 02e2fd
.sp
Packit Service 02e2fd
  PCRE2_ERROR_BADDATA   \fInumber_of_codes\fP is zero or less
Packit Service 02e2fd
  PCRE2_ERROR_BADMAGIC  mismatch of id bytes in \fIbytes\fP
Packit Service 02e2fd
  PCRE2_ERROR_BADMODE   mismatch of variable unit size or PCRE version
Packit Service 02e2fd
  PCRE2_ERROR_MEMORY    memory allocation failed
Packit Service 02e2fd
  PCRE2_ERROR_NULL      \fIcodes\fP or \fIbytes\fP is NULL
Packit Service 02e2fd
.sp
Packit Service 02e2fd
PCRE2_ERROR_BADMAGIC may mean that the data is corrupt, or that it was compiled
Packit Service 02e2fd
on a system with different endianness.
Packit Service 02e2fd
.P
Packit Service 02e2fd
There is a complete description of the PCRE2 native API in the
Packit Service 02e2fd
.\" HREF
Packit Service 02e2fd
\fBpcre2api\fP
Packit Service 02e2fd
.\"
Packit Service 02e2fd
page and a description of the serialization functions in the
Packit Service 02e2fd
.\" HREF
Packit Service 02e2fd
\fBpcre2serialize\fP
Packit Service 02e2fd
.\"
Packit Service 02e2fd
page.