Updated embedded PCRE to version 7.4 to avoid 2 CVE issues:-
[exim.git] / src / src / pcre / pcre_config.c
CommitLineData
47db1125 1/* $Cambridge: exim/src/src/pcre/pcre_config.c,v 1.6 2007/11/12 13:02:19 nm4 Exp $ */
8ac170f3
PH
2
3/*************************************************
4* Perl-Compatible Regular Expressions *
5*************************************************/
6
7/* PCRE is a library of functions to support regular expressions whose syntax
8and semantics are as close as possible to those of the Perl 5 language.
9
10 Written by Philip Hazel
64f2600a 11 Copyright (c) 1997-2007 University of Cambridge
8ac170f3
PH
12
13-----------------------------------------------------------------------------
14Redistribution and use in source and binary forms, with or without
15modification, are permitted provided that the following conditions are met:
16
17 * Redistributions of source code must retain the above copyright notice,
18 this list of conditions and the following disclaimer.
19
20 * Redistributions in binary form must reproduce the above copyright
21 notice, this list of conditions and the following disclaimer in the
22 documentation and/or other materials provided with the distribution.
23
24 * Neither the name of the University of Cambridge nor the names of its
25 contributors may be used to endorse or promote products derived from
26 this software without specific prior written permission.
27
28THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
32LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
33CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38POSSIBILITY OF SUCH DAMAGE.
39-----------------------------------------------------------------------------
40*/
41
42
43/* This module contains the external function pcre_config(). */
44
45
47db1125
NM
46#ifdef HAVE_CONFIG_H
47#include "config.h"
48#endif
49
8ac170f3
PH
50#include "pcre_internal.h"
51
52
53/*************************************************
54* Return info about what features are configured *
55*************************************************/
56
57/* This function has an extensible interface so that additional items can be
58added compatibly.
59
60Arguments:
61 what what information is required
62 where where to put the information
63
64Returns: 0 if data returned, negative on error
65*/
66
64f2600a 67PCRE_EXP_DEFN int
8ac170f3
PH
68pcre_config(int what, void *where)
69{
70switch (what)
71 {
72 case PCRE_CONFIG_UTF8:
73#ifdef SUPPORT_UTF8
74 *((int *)where) = 1;
75#else
76 *((int *)where) = 0;
77#endif
78 break;
79
80 case PCRE_CONFIG_UNICODE_PROPERTIES:
81#ifdef SUPPORT_UCP
82 *((int *)where) = 1;
83#else
84 *((int *)where) = 0;
85#endif
86 break;
87
88 case PCRE_CONFIG_NEWLINE:
89 *((int *)where) = NEWLINE;
90 break;
91
47db1125
NM
92 case PCRE_CONFIG_BSR:
93#ifdef BSR_ANYCRLF
94 *((int *)where) = 1;
95#else
96 *((int *)where) = 0;
97#endif
98 break;
99
8ac170f3
PH
100 case PCRE_CONFIG_LINK_SIZE:
101 *((int *)where) = LINK_SIZE;
102 break;
103
104 case PCRE_CONFIG_POSIX_MALLOC_THRESHOLD:
105 *((int *)where) = POSIX_MALLOC_THRESHOLD;
106 break;
107
108 case PCRE_CONFIG_MATCH_LIMIT:
109 *((unsigned int *)where) = MATCH_LIMIT;
110 break;
111
aa41d2de
PH
112 case PCRE_CONFIG_MATCH_LIMIT_RECURSION:
113 *((unsigned int *)where) = MATCH_LIMIT_RECURSION;
114 break;
115
8ac170f3
PH
116 case PCRE_CONFIG_STACKRECURSE:
117#ifdef NO_RECURSE
118 *((int *)where) = 0;
119#else
120 *((int *)where) = 1;
121#endif
122 break;
123
124 default: return PCRE_ERROR_BADOPTION;
125 }
126
127return 0;
128}
129
130/* End of pcre_config.c */