123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- #ifdef HAVE_CONFIG_H
- #include "config.h"
- #endif
- static int real_link_size = LINK_SIZE;
- #include "pcre_internal.h"
- #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:
- #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
- *((int *)where) = 1;
- #else
- *((int *)where) = 0;
- #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;
- case PCRE_CONFIG_BSR:
- #ifdef BSR_ANYCRLF
- *((int *)where) = 1;
- #else
- *((int *)where) = 0;
- #endif
- break;
- case PCRE_CONFIG_LINK_SIZE:
- *((int *)where) = real_link_size;
- break;
- case PCRE_CONFIG_POSIX_MALLOC_THRESHOLD:
- *((int *)where) = POSIX_MALLOC_THRESHOLD;
- break;
- case PCRE_CONFIG_PARENS_LIMIT:
- *((unsigned long int *)where) = PARENS_NEST_LIMIT;
- break;
- case PCRE_CONFIG_MATCH_LIMIT:
- *((unsigned long int *)where) = MATCH_LIMIT;
- break;
- case PCRE_CONFIG_MATCH_LIMIT_RECURSION:
- *((unsigned long int *)where) = MATCH_LIMIT_RECURSION;
- break;
- case PCRE_CONFIG_STACKRECURSE:
- #ifdef NO_RECURSE
- *((int *)where) = 0;
- #else
- *((int *)where) = 1;
- #endif
- break;
- default: return PCRE_ERROR_BADOPTION;
- }
- return 0;
- }
|