diff options
author | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2015-01-23 16:51:47 +0000 |
---|---|---|
committer | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2015-01-23 16:51:47 +0000 |
commit | 61cb4c76713910670d84bc0e3bb9dad8c2661b37 (patch) | |
tree | 914eae7e92f8016c26af1da38ef04db5521e7d5e /doc/pcre2_serialize_encode.3 | |
parent | cb63a5307cf484d7f274a808501be414e297f411 (diff) | |
download | pcre2-61cb4c76713910670d84bc0e3bb9dad8c2661b37.tar.gz |
Add serialization functions and tests with updated pcre2test. Fix
PCRE2_INFO_SIZE issues.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@185 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'doc/pcre2_serialize_encode.3')
-rw-r--r-- | doc/pcre2_serialize_encode.3 | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/doc/pcre2_serialize_encode.3 b/doc/pcre2_serialize_encode.3 new file mode 100644 index 0000000..57077eb --- /dev/null +++ b/doc/pcre2_serialize_encode.3 @@ -0,0 +1,49 @@ +.TH PCRE2_SERIALIZE_ENCODE 3 "19 January 2015" "PCRE2 10.10" +.SH NAME +PCRE2 - Perl-compatible regular expressions (revised API) +.SH SYNOPSIS +.rs +.sp +.B #include <pcre2.h> +.PP +.nf +.B int32_t pcre2_serialize_encode(pcre2_code **\fIcodes\fP, +.B " int32_t \fInumber_of_codes\fP, uint32_t **\fIserialized_bytes\fP," +.B " PCRE2_SIZE *\fIserialized_size\fP, pcre2_general_context *\fIgcontext\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This function encodes a list of compiled patterns into a byte stream that can +be saved on disc or elsewhere. Its arguments are: +.sp + \fIcodes\fP pointer to a vector containing the list + \fInumber_of_codes\fP number of slots in the vector + \fIserialized_bytes\fP set to point to the serialized byte stream + \fIserialized_size\fP set to the number of bytes in the byte stream + \fIgcontext\fP pointer to a general context or NULL +.sp +The context argument is used to obtain memory for the byte stream. When the +serialized data is no longer needed, it must be freed by calling +\fBpcre2_serialize_free()\fP. The yield of the function is the number of +serialized patterns, or one of the following negative error codes: +.sp + PCRE2_ERROR_BADDATA \fInumber_of_codes\fP is zero or less + PCRE2_ERROR_BADMAGIC mismatch of id bytes in one of the patterns + PCRE2_ERROR_MEMORY memory allocation failed + PCRE2_ERROR_MIXEDTABLES the patterns do not all use the same tables + PCRE2_ERROR_NULL an argument other than \fIgcontext\fP is NULL +.sp +PCRE2_ERROR_BADMAGIC means either that a pattern's code has been corrupted, or +that a slot in the vector does not point to a compiled pattern. +.P +There is a complete description of the PCRE2 native API in the +.\" HREF +\fBpcre2api\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcre2posix\fP +.\" +page. |