~ubuntu-branches/ubuntu/trusty/pcre3/trusty

« back to all changes in this revision

Viewing changes to pcre_config.c

  • Committer: Package Import Robot
  • Author(s): Mark Baker
  • Date: 2012-03-23 22:34:54 UTC
  • mfrom: (23.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20120323223454-grhqqolk8a7x1h24
Tags: 1:8.30-4
* Reluctantly using an epoch, as it seems the funny version number with
  extra dots causes problems
* Bumped standard version to 3.9.3. No changes needed
* Converted to use new source format / quilt
* Put back obsolete pcre_info() API that upstream have dropped (Closes:
  #665300, #665356)
* Don't include pcregrep binary in debug package

Thanks to Elimar Riesebieter for the conversion to the new source format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
and semantics are as close as possible to those of the Perl 5 language.
7
7
 
8
8
                       Written by Philip Hazel
9
 
           Copyright (c) 1997-2009 University of Cambridge
 
9
           Copyright (c) 1997-2012 University of Cambridge
10
10
 
11
11
-----------------------------------------------------------------------------
12
12
Redistribution and use in source and binary forms, with or without
45
45
#include "config.h"
46
46
#endif
47
47
 
 
48
/* Keep the original link size. */
 
49
static int real_link_size = LINK_SIZE;
 
50
 
48
51
#include "pcre_internal.h"
49
52
 
50
53
 
62
65
Returns:           0 if data returned, negative on error
63
66
*/
64
67
 
 
68
#ifdef COMPILE_PCRE8
65
69
PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
66
70
pcre_config(int what, void *where)
 
71
#else
 
72
PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
 
73
pcre16_config(int what, void *where)
 
74
#endif
67
75
{
68
76
switch (what)
69
77
  {
70
78
  case PCRE_CONFIG_UTF8:
71
 
#ifdef SUPPORT_UTF8
72
 
  *((int *)where) = 1;
73
 
#else
74
 
  *((int *)where) = 0;
75
 
#endif
76
 
  break;
 
79
#if defined COMPILE_PCRE16
 
80
  *((int *)where) = 0;
 
81
  return PCRE_ERROR_BADOPTION;
 
82
#else
 
83
#if defined SUPPORT_UTF
 
84
  *((int *)where) = 1;
 
85
#else
 
86
  *((int *)where) = 0;
 
87
#endif
 
88
  break;
 
89
#endif
 
90
 
 
91
  case PCRE_CONFIG_UTF16:
 
92
#if defined COMPILE_PCRE8
 
93
  *((int *)where) = 0;
 
94
  return PCRE_ERROR_BADOPTION;
 
95
#else
 
96
#if defined SUPPORT_UTF
 
97
  *((int *)where) = 1;
 
98
#else
 
99
  *((int *)where) = 0;
 
100
#endif
 
101
  break;
 
102
#endif
77
103
 
78
104
  case PCRE_CONFIG_UNICODE_PROPERTIES:
79
105
#ifdef SUPPORT_UCP
83
109
#endif
84
110
  break;
85
111
 
 
112
  case PCRE_CONFIG_JIT:
 
113
#ifdef SUPPORT_JIT
 
114
  *((int *)where) = 1;
 
115
#else
 
116
  *((int *)where) = 0;
 
117
#endif
 
118
  break;
 
119
 
 
120
  case PCRE_CONFIG_JITTARGET:
 
121
#ifdef SUPPORT_JIT
 
122
  *((const char **)where) = PRIV(jit_get_target)();
 
123
#else
 
124
  *((const char **)where) = NULL;
 
125
#endif
 
126
  break;
 
127
 
86
128
  case PCRE_CONFIG_NEWLINE:
87
129
  *((int *)where) = NEWLINE;
88
130
  break;
96
138
  break;
97
139
 
98
140
  case PCRE_CONFIG_LINK_SIZE:
99
 
  *((int *)where) = LINK_SIZE;
 
141
  *((int *)where) = real_link_size;
100
142
  break;
101
143
 
102
144
  case PCRE_CONFIG_POSIX_MALLOC_THRESHOLD: