diff options
author | chpe <chpe@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2012-10-16 15:53:30 +0000 |
---|---|---|
committer | chpe <chpe@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2012-10-16 15:53:30 +0000 |
commit | 62c2f93fe63ee94ff2692091a42a7d594f5d4fe3 (patch) | |
tree | 3d1739b24c57943c20fa880eed55ab341db96a81 /pcre_config.c | |
parent | 3f6d05379ea067a3b4f4a61e4be268ee8c37e7a6 (diff) | |
download | pcre-62c2f93fe63ee94ff2692091a42a7d594f5d4fe3.tar.gz |
pcre32: Add 32-bit library
Create libpcre32 that operates on 32-bit characters (UTF-32).
This turned out to be surprisingly simple after the UTF-16 support
was introduced; mostly just extra ifdefs and adjusting and adding
some tests.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1055 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcre_config.c')
-rw-r--r-- | pcre_config.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/pcre_config.c b/pcre_config.c index aa0ef86..3d5689f 100644 --- a/pcre_config.c +++ b/pcre_config.c @@ -65,18 +65,21 @@ Arguments: Returns: 0 if data returned, negative on error */ -#ifdef COMPILE_PCRE8 +#if defined COMPILE_PCRE8 PCRE_EXP_DEFN int PCRE_CALL_CONVENTION pcre_config(int what, void *where) -#else +#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 +#if defined COMPILE_PCRE16 || defined COMPILE_PCRE32 *((int *)where) = 0; return PCRE_ERROR_BADOPTION; #else @@ -89,7 +92,20 @@ switch (what) #endif case PCRE_CONFIG_UTF16: -#if defined COMPILE_PCRE8 +#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 |