diff options
author | Patrik Nyblom <[email protected]> | 2013-07-15 11:08:18 +0200 |
---|---|---|
committer | Patrik Nyblom <[email protected]> | 2013-07-19 18:06:02 +0200 |
commit | d0898734b7ae62572579a0ecd0b03ab451b233bb (patch) | |
tree | 48fd4a2aef87accf9d3c12d3a0c2c411f7f8f150 /erts/emulator/pcre/pcre_config.c | |
parent | 712f2cad96a941d68a2f9ad092badd5bc60e8cdd (diff) | |
download | otp-d0898734b7ae62572579a0ecd0b03ab451b233bb.tar.gz otp-d0898734b7ae62572579a0ecd0b03ab451b233bb.tar.bz2 otp-d0898734b7ae62572579a0ecd0b03ab451b233bb.zip |
Update to PCRE 8.33, w/o the erts_ prefix added
Diffstat (limited to 'erts/emulator/pcre/pcre_config.c')
-rw-r--r-- | erts/emulator/pcre/pcre_config.c | 78 |
1 files changed, 70 insertions, 8 deletions
diff --git a/erts/emulator/pcre/pcre_config.c b/erts/emulator/pcre/pcre_config.c index 122327d67d..a116cc7ac6 100644 --- a/erts/emulator/pcre/pcre_config.c +++ b/erts/emulator/pcre/pcre_config.c @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2008 University of Cambridge + Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ POSSIBILITY OF SUCH DAMAGE. */ -/* This module contains the external function erts_pcre_config(). */ +/* This module contains the external function pcre_config(). */ /* %ExternalCopyright% */ @@ -46,6 +46,13 @@ POSSIBILITY OF SUCH DAMAGE. #include "config.h" #endif +#ifdef ERLANG_INTEGRATION +#include "local_config.h" +#endif + +/* Keep the original link size. */ +static int real_link_size = LINK_SIZE; + #include "pcre_internal.h" @@ -63,18 +70,57 @@ Arguments: Returns: 0 if data returned, negative on error */ -PCRE_EXP_DEFN int -erts_pcre_config(int what, void *where) +#if defined COMPILE_PCRE8 +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION +pcre_config(int what, void *where) +#elif defined COMPILE_PCRE16 +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION +pcre16_config(int what, void *where) +#elif defined COMPILE_PCRE32 +PCRE_EXP_DEFN int PCRE_CALL_CONVENTION +pcre32_config(int what, void *where) +#endif { switch (what) { case PCRE_CONFIG_UTF8: -#ifdef SUPPORT_UTF8 +#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32 + *((int *)where) = 0; + return PCRE_ERROR_BADOPTION; +#else +#if defined SUPPORT_UTF + *((int *)where) = 1; +#else + *((int *)where) = 0; +#endif + break; +#endif + + case PCRE_CONFIG_UTF16: +#if defined COMPILE_PCRE8 || defined COMPILE_PCRE32 + *((int *)where) = 0; + return PCRE_ERROR_BADOPTION; +#else +#if defined SUPPORT_UTF *((int *)where) = 1; #else *((int *)where) = 0; #endif break; +#endif + + case PCRE_CONFIG_UTF32: +#if defined COMPILE_PCRE8 || defined COMPILE_PCRE16 + *((int *)where) = 0; + return PCRE_ERROR_BADOPTION; +#else +#if defined SUPPORT_UTF + *((int *)where) = 1; +#else + *((int *)where) = 0; +#endif + break; +#endif case PCRE_CONFIG_UNICODE_PROPERTIES: #ifdef SUPPORT_UCP @@ -84,6 +130,22 @@ switch (what) #endif break; + case PCRE_CONFIG_JIT: +#ifdef SUPPORT_JIT + *((int *)where) = 1; +#else + *((int *)where) = 0; +#endif + break; + + case PCRE_CONFIG_JITTARGET: +#ifdef SUPPORT_JIT + *((const char **)where) = PRIV(jit_get_target)(); +#else + *((const char **)where) = NULL; +#endif + break; + case PCRE_CONFIG_NEWLINE: *((int *)where) = NEWLINE; break; @@ -97,7 +159,7 @@ switch (what) break; case PCRE_CONFIG_LINK_SIZE: - *((int *)where) = LINK_SIZE; + *((int *)where) = real_link_size; break; case PCRE_CONFIG_POSIX_MALLOC_THRESHOLD: @@ -105,11 +167,11 @@ switch (what) break; case PCRE_CONFIG_MATCH_LIMIT: - *((unsigned int *)where) = MATCH_LIMIT; + *((unsigned long int *)where) = MATCH_LIMIT; break; case PCRE_CONFIG_MATCH_LIMIT_RECURSION: - *((unsigned int *)where) = MATCH_LIMIT_RECURSION; + *((unsigned long int *)where) = MATCH_LIMIT_RECURSION; break; case PCRE_CONFIG_STACKRECURSE: |