1PCRE2_SERIALIZE_DECODE(3) Library Functions Manual PCRE2_SERIALIZE_DECODE(3)
2
3
4
6 PCRE2 - Perl-compatible regular expressions (revised API)
7
9
10 #include <pcre2.h>
11
12 int32_t pcre2_serialize_decode(pcre2_code **codes,
13 int32_t number_of_codes, const uint8_t *bytes,
14 pcre2_general_context *gcontext);
15
17
18 This function decodes a serialized set of compiled patterns back into a
19 list of individual patterns. This is possible only on a host that is
20 running the same version of PCRE2, with the same code unit width, and
21 the host must also have the same endianness, pointer width and
22 PCRE2_SIZE type. The arguments for pcre2_serialize_decode() are:
23
24 codes pointer to a vector in which to build the list
25 number_of_codes number of slots in the vector
26 bytes the serialized byte stream
27 gcontext pointer to a general context or NULL
28
29 The bytes argument must point to a block of data that was originally
30 created by pcre2_serialize_encode(), though it may have been saved on
31 disc or elsewhere in the meantime. If there are more codes in the seri‐
32 alized data than slots in the list, only those compiled patterns that
33 will fit are decoded. The yield of the function is the number of
34 decoded patterns, or one of the following negative error codes:
35
36 PCRE2_ERROR_BADDATA number_of_codes is zero or less
37 PCRE2_ERROR_BADMAGIC mismatch of id bytes in bytes
38 PCRE2_ERROR_BADMODE mismatch of variable unit size or PCRE version
39 PCRE2_ERROR_MEMORY memory allocation failed
40 PCRE2_ERROR_NULL codes or bytes is NULL
41
42 PCRE2_ERROR_BADMAGIC may mean that the data is corrupt, or that it was
43 compiled on a system with different endianness.
44
45 There is a complete description of the PCRE2 native API in the pcre2api
46 page and a description of the serialization functions in the pcre2seri‐
47 alize page.
48
49
50
51PCRE2 10.32 27 June 2018 PCRE2_SERIALIZE_DECODE(3)