[Pcre-svn] [768] code/trunk/doc/pcrejit.3: Add some words ab…

Startseite
Nachricht löschen
Autor: Subversion repository
Datum:  
To: pcre-svn
Betreff: [Pcre-svn] [768] code/trunk/doc/pcrejit.3: Add some words about multiple PCRE versions to the JIT documentation.
Revision: 768
          http://vcs.pcre.org/viewvc?view=rev&revision=768
Author:   ph10
Date:     2011-11-26 19:05:39 +0000 (Sat, 26 Nov 2011)


Log Message:
-----------
Add some words about multiple PCRE versions to the JIT documentation.

Modified Paths:
--------------
    code/trunk/doc/pcrejit.3


Modified: code/trunk/doc/pcrejit.3
===================================================================
--- code/trunk/doc/pcrejit.3    2011-11-26 12:48:56 UTC (rev 767)
+++ code/trunk/doc/pcrejit.3    2011-11-26 19:05:39 UTC (rev 768)
@@ -34,11 +34,16 @@
 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 @@
       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 @@
 .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 @@
 .rs
 .sp
 .nf
-Last updated: 22 November 2011
+Last updated: 26 November 2011
 Copyright (c) 1997-2011 University of Cambridge.
 .fi