summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-11-26 19:05:39 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-11-26 19:05:39 +0000
commit2790821e0a8cab583222865c95a311efa6d5757c (patch)
tree3cc38a4bd92e4fb640ec3e81d98881be4f9f030b
parentdbbbe79aa483bafbf1c8d5c1dad75cc71d83e6e8 (diff)
downloadpcre-2790821e0a8cab583222865c95a311efa6d5757c.tar.gz
Add some words about multiple PCRE versions to the JIT documentation.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@768 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--doc/pcrejit.334
1 files changed, 27 insertions, 7 deletions
diff --git a/doc/pcrejit.3 b/doc/pcrejit.3
index 0f100d3..fba349c 100644
--- a/doc/pcrejit.3
+++ b/doc/pcrejit.3
@@ -34,11 +34,16 @@ The Power PC support is designated as experimental because it has not been
fully tested. If --enable-jit is set on an unsupported platform, compilation
fails.
.P
-A program can tell if JIT support is available by calling \fBpcre_config()\fP
-with the PCRE_CONFIG_JIT option. The result is 1 when JIT is available, and 0
-otherwise. However, a simple program does not need to check this in order to
-use JIT. The API is implemented in a way that falls back to the ordinary PCRE
-code if JIT is not available.
+A program that is linked with PCRE 8.20 or later can tell if JIT support is
+available by calling \fBpcre_config()\fP with the PCRE_CONFIG_JIT option. The
+result is 1 when JIT is available, and 0 otherwise. However, a simple program
+does not need to check this in order to use JIT. The API is implemented in a
+way that falls back to the ordinary PCRE code if JIT is not available.
+.P
+If your program may sometimes be linked with versions of PCRE that are older
+than 8.20, but you want to use JIT when it is available, you can test
+the values of PCRE_MAJOR and PCRE_MINOR, or the existence of a JIT macro such
+as PCRE_CONFIG_JIT, for compile-time control of your code.
.
.
.SH "SIMPLE USE OF JIT"
@@ -54,6 +59,21 @@ You have to do two things to make use of the JIT support in the simplest way:
no longer needed instead of just freeing it yourself. This
ensures that any JIT data is also freed.
.sp
+For a program that may be linked with pre-8.20 versions of PCRE, you can insert
+.sp
+ #ifndef PCRE_STUDY_JIT_COMPILE
+ #define PCRE_STUDY_JIT_COMPILE 0
+ #endif
+.sp
+so that no option is passed to \fBpcre_study()\fP, and then use something like
+this to free the study data:
+.sp
+ #ifdef PCRE_CONFIG_JIT
+ pcre_free_study(study_ptr);
+ #else
+ pcre_free(study_ptr);
+ #endif
+.sp
In some circumstances you may need to call additional functions. These are
described in the section entitled
.\" HTML <a href="#stackcontrol">
@@ -95,7 +115,7 @@ supported.
.P
The unsupported pattern items are:
.sp
- \eC match a single byte; not supported in UTF-8 mode
+ \eC match a single byte; not supported in UTF-8 mode
(?Cn) callouts
(*COMMIT) )
(*MARK) )
@@ -337,6 +357,6 @@ Cambridge CB2 3QH, England.
.rs
.sp
.nf
-Last updated: 22 November 2011
+Last updated: 26 November 2011
Copyright (c) 1997-2011 University of Cambridge.
.fi