1<html>
2<head>
3<title>pcre2_serialize_decode specification</title>
4</head>
5<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
6<h1>pcre2_serialize_decode man page</h1>
7<p>
8Return to the <a href="index.html">PCRE2 index page</a>.
9</p>
10<p>
11This page is part of the PCRE2 HTML documentation. It was generated
12automatically from the original man page. If there is any nonsense in it,
13please consult the man page, in case the conversion went wrong.
14<br>
15<br><b>
16SYNOPSIS
17</b><br>
18<P>
19<b>#include &#60;pcre2.h&#62;</b>
20</P>
21<P>
22<b>int32_t pcre2_serialize_decode(pcre2_code **<i>codes</i>,</b>
23<b>  int32_t <i>number_of_codes</i>, const uint8_t *<i>bytes</i>,</b>
24<b>  pcre2_general_context *<i>gcontext</i>);</b>
25</P>
26<br><b>
27DESCRIPTION
28</b><br>
29<P>
30This function decodes a serialized set of compiled patterns back into a list of
31individual patterns. This is possible only on a host that is running the same
32version of PCRE2, with the same code unit width, and the host must also have
33the same endianness, pointer width and PCRE2_SIZE type. The arguments for
34<b>pcre2_serialize_decode()</b> are:
35<pre>
36  <i>codes</i>            pointer to a vector in which to build the list
37  <i>number_of_codes</i>  number of slots in the vector
38  <i>bytes</i>            the serialized byte stream
39  <i>gcontext</i>         pointer to a general context or NULL
40</pre>
41The <i>bytes</i> argument must point to a block of data that was originally
42created by <b>pcre2_serialize_encode()</b>, though it may have been saved on
43disc or elsewhere in the meantime. If there are more codes in the serialized
44data than slots in the list, only those compiled patterns that will fit are
45decoded. The yield of the function is the number of decoded patterns, or one of
46the following negative error codes:
47<pre>
48  PCRE2_ERROR_BADDATA   <i>number_of_codes</i> is zero or less
49  PCRE2_ERROR_BADMAGIC  mismatch of id bytes in <i>bytes</i>
50  PCRE2_ERROR_BADMODE   mismatch of variable unit size or PCRE version
51  PCRE2_ERROR_MEMORY    memory allocation failed
52  PCRE2_ERROR_NULL      <i>codes</i> or <i>bytes</i> is NULL
53</pre>
54PCRE2_ERROR_BADMAGIC may mean that the data is corrupt, or that it was compiled
55on a system with different endianness.
56</P>
57<P>
58There is a complete description of the PCRE2 native API in the
59<a href="pcre2api.html"><b>pcre2api</b></a>
60page and a description of the serialization functions in the
61<a href="pcre2serialize.html"><b>pcre2serialize</b></a>
62page.
63<p>
64Return to the <a href="index.html">PCRE2 index page</a>.
65</p>
66