1
Revision: apache2--dilinger--2.0--patch-10
2
Archive: dilinger@voxel.net--2004
3
Creator: Andres Salomon <dilinger@voxel.net>
4
Date: Tue Mar 9 01:34:52 EST 2004
5
Standard-date: 2004-03-09 06:34:52 GMT
6
Modified-files: server/util.c srclib/pcre/RunTest.in
7
srclib/pcre/dftables.c srclib/pcre/get.c
8
srclib/pcre/internal.h srclib/pcre/maketables.c
9
srclib/pcre/pcre.c srclib/pcre/pcre.def
10
srclib/pcre/pcre.hw srclib/pcre/pcre.in
11
srclib/pcre/pcredemo.c srclib/pcre/pcregrep.c
12
srclib/pcre/pcreposix.c srclib/pcre/pcreposix.h
13
srclib/pcre/pcretest.c srclib/pcre/pgrep.c
15
New-patches: dilinger@voxel.net--2004/apache2--dilinger--2.0--patch-10
16
Summary: rename internal pcre symbols
21
{arch}/apache2/apache2--dilinger/apache2--dilinger--2.0/dilinger@voxel.net--2004/patch-log/patch-10
23
* file metadata changed
25
./srclib/pcre/RunTest.in
31
--- orig/apache2/server/util.c
32
+++ mod/apache2/server/util.c
37
- * Here's a pool-based interface to POSIX regex's regcomp().
38
+ * Here's a pool-based interface to POSIX regex's ap_pcreposix_regcomp().
39
* Note that we return regex_t instead of being passed one.
40
* The reason is that if you use an already-used regex_t structure,
41
* the memory that you've already allocated gets forgotten, and
42
- * regfree() doesn't clear it. So we don't allow it.
43
+ * ap_pcreposix_regfree() doesn't clear it. So we don't allow it.
46
static apr_status_t regex_cleanup(void *preg)
48
- regfree((regex_t *) preg);
49
+ ap_pcreposix_regfree((regex_t *) preg);
55
regex_t *preg = apr_palloc(p, sizeof(regex_t));
57
- if (regcomp(preg, pattern, cflags)) {
58
+ if (ap_pcreposix_regcomp(preg, pattern, cflags)) {
64
AP_DECLARE(void) ap_pregfree(apr_pool_t *p, regex_t * reg)
67
+ ap_pcreposix_regfree(reg);
68
apr_pool_cleanup_kill(p, (void *) reg, regex_cleanup);
75
- * Apache stub function for the regex libraries regexec() to make sure the
76
+ * Apache stub function for the regex libraries ap_pcreposix_regexec() to make sure the
77
* whole regex(3) API is available through the Apache (exported) namespace.
78
* This is especially important for the DSO situations of modules.
79
* DO NOT MAKE A MACRO OUT OF THIS FUNCTION!
81
AP_DECLARE(int) ap_regexec(regex_t *preg, const char *string,
82
size_t nmatch, regmatch_t pmatch[], int eflags)
84
- return regexec(preg, string, nmatch, pmatch, eflags);
85
+ return ap_pcreposix_regexec(preg, string, nmatch, pmatch, eflags);
88
AP_DECLARE(size_t) ap_regerror(int errcode, const regex_t *preg, char *errbuf,
91
- return regerror(errcode, preg, errbuf, errbuf_size);
92
+ return ap_pcreposix_regerror(errcode, preg, errbuf, errbuf_size);
98
--- orig/apache2/srclib/pcre/dftables.c
99
+++ mod/apache2/srclib/pcre/dftables.c
102
/* This is a support program to generate the file chartables.c, containing
103
character tables of various kinds. They are built according to the default C
104
-locale and used as the default tables by PCRE. Now that pcre_maketables is
105
+locale and used as the default tables by PCRE. Now that ap_pcre_maketables is
106
a function visible to the outside world, we make use of its code from here in
107
order to be consistent. */
113
-const unsigned char *tables = pcre_maketables();
114
+const unsigned char *tables = ap_pcre_maketables();
117
"/*************************************************\n"
120
--- orig/apache2/srclib/pcre/get.c
121
+++ mod/apache2/srclib/pcre/get.c
123
subject the subject string that was matched
124
ovector pointer to the offsets table
125
stringcount the number of substrings that were captured
126
- (i.e. the yield of the pcre_exec call, unless
127
+ (i.e. the yield of the ap_pcre_exec call, unless
128
that was zero, in which case it should be 1/3
129
of the offset table size)
130
stringnumber the number of the required substring
135
-pcre_copy_substring(const char *subject, int *ovector, int stringcount,
136
+ap_pcre_copy_substring(const char *subject, int *ovector, int stringcount,
137
int stringnumber, char *buffer, int size)
141
subject the subject string that was matched
142
ovector pointer to the offsets table
143
stringcount the number of substrings that were captured
144
- (i.e. the yield of the pcre_exec call, unless
145
+ (i.e. the yield of the ap_pcre_exec call, unless
146
that was zero, in which case it should be 1/3
147
of the offset table size)
148
listptr set to point to the list of pointers
153
-pcre_get_substring_list(const char *subject, int *ovector, int stringcount,
154
+ap_pcre_get_substring_list(const char *subject, int *ovector, int stringcount,
155
const char ***listptr)
159
for (i = 0; i < double_count; i += 2)
160
size += sizeof(char *) + ovector[i+1] - ovector[i] + 1;
162
-stringlist = (char **)(pcre_malloc)(size);
163
+stringlist = (char **)(ap_pcre_malloc)(size);
164
if (stringlist == NULL) return PCRE_ERROR_NOMEMORY;
166
*listptr = (const char **)stringlist;
167
@@ -144,20 +144,20 @@
170
/*************************************************
171
-* Free store obtained by get_substring_list *
172
+* Free store obtained by ap_get_substring_list *
173
*************************************************/
175
/* This function exists for the benefit of people calling PCRE from non-C
176
-programs that can call its functions, but not free() or (pcre_free)() directly.
177
+programs that can call its functions, but not free() or (ap_pcre_free)() directly.
179
-Argument: the result of a previous pcre_get_substring_list()
180
+Argument: the result of a previous ap_pcre_get_substring_list()
185
-pcre_free_substring_list(const char **pointer)
186
+ap_pcre_free_substring_list(const char **pointer)
188
-(pcre_free)((void *)pointer);
189
+(ap_pcre_free)((void *)pointer);
194
subject the subject string that was matched
195
ovector pointer to the offsets table
196
stringcount the number of substrings that were captured
197
- (i.e. the yield of the pcre_exec call, unless
198
+ (i.e. the yield of the ap_pcre_exec call, unless
199
that was zero, in which case it should be 1/3
200
of the offset table size)
201
stringnumber the number of the required substring
206
-pcre_get_substring(const char *subject, int *ovector, int stringcount,
207
+ap_pcre_get_substring(const char *subject, int *ovector, int stringcount,
208
int stringnumber, const char **stringptr)
212
return PCRE_ERROR_NOSUBSTRING;
214
yield = ovector[stringnumber+1] - ovector[stringnumber];
215
-substring = (char *)(pcre_malloc)(yield + 1);
216
+substring = (char *)(ap_pcre_malloc)(yield + 1);
217
if (substring == NULL) return PCRE_ERROR_NOMEMORY;
218
memcpy(substring, subject + ovector[stringnumber], yield);
219
substring[yield] = 0;
220
@@ -208,20 +208,20 @@
223
/*************************************************
224
-* Free store obtained by get_substring *
225
+* Free store obtained by ap_get_substring *
226
*************************************************/
228
/* This function exists for the benefit of people calling PCRE from non-C
229
-programs that can call its functions, but not free() or (pcre_free)() directly.
230
+programs that can call its functions, but not free() or (ap_pcre_free)() directly.
232
Argument: the result of a previous pcre_get_substring()
237
-pcre_free_substring(const char *pointer)
238
+ap_pcre_free_substring(const char *pointer)
240
-(pcre_free)((void *)pointer);
241
+(ap_pcre_free)((void *)pointer);
247
--- orig/apache2/srclib/pcre/internal.h
248
+++ mod/apache2/srclib/pcre/internal.h
250
#define PCRE_INGROUP 0x08000000 /* compiling inside a group */
251
#define PCRE_ICHANGED 0x04000000 /* i option changes within regex */
253
-/* Options for the "extra" block produced by pcre_study(). */
254
+/* Options for the "extra" block produced by ap_pcre_study(). */
256
#define PCRE_STUDY_MAPPED 0x01 /* a map of starting chars exists */
262
-/* The real format of the extra block returned by pcre_study(). */
263
+/* The real format of the extra block returned by ap_pcre_study(). */
265
typedef struct real_pcre_extra {
269
--- orig/apache2/srclib/pcre/maketables.c
270
+++ mod/apache2/srclib/pcre/maketables.c
272
/* This function builds a set of character tables for use by PCRE and returns
273
a pointer to them. They are build using the ctype functions, and consequently
274
their contents will depend upon the current locale setting. When compiled as
275
-part of the library, the store is obtained via pcre_malloc(), but when compiled
276
+part of the library, the store is obtained via ap_pcre_malloc(), but when compiled
277
inside dftables, use malloc().
283
const unsigned char *
284
-pcre_maketables(void)
285
+ap_pcre_maketables(void)
287
unsigned char *yield, *p;
291
-yield = (unsigned char*)(pcre_malloc)(tables_length);
292
+yield = (unsigned char*)(ap_pcre_malloc)(tables_length);
294
yield = (unsigned char*)malloc(tables_length);
298
--- orig/apache2/srclib/pcre/pcre.c
299
+++ mod/apache2/srclib/pcre/pcre.c
301
indirections below, which are can be changed by the caller, but are shared
302
between all threads. */
304
-void *(*pcre_malloc)(size_t) = malloc;
305
-void (*pcre_free)(void *) = free;
306
+void *(*ap_pcre_malloc)(size_t) = malloc;
307
+void (*ap_pcre_free)(void *) = free;
312
/* A default set of character tables is included in the PCRE binary. Its source
313
is built by the maketables auxiliary program, which uses the default C ctypes
314
functions, and put in the file chartables.c. These tables are used by PCRE
315
-whenever the caller of pcre_compile() does not provide an alternate set of
316
+whenever the caller of ap_pcre_compile() does not provide an alternate set of
319
#include "chartables.c"
321
#define XSTRING(s) STRING(s)
325
+ap_pcre_version(void)
327
return XSTRING(PCRE_MAJOR) "." XSTRING(PCRE_MINOR) " " XSTRING(PCRE_DATE);
330
backwards compatibility. The public options are passed back in an int - though
331
the re->options field has been expanded to a long int, all the public options
332
at the low end of it, and so even on 16-bit systems this will still be OK.
333
-Therefore, I haven't changed the API for pcre_info().
334
+Therefore, I haven't changed the API for ap_pcre_info().
337
external_re points to compiled code
342
-pcre_info(const pcre *external_re, int *optptr, int *first_char)
343
+ap_pcre_info(const pcre *external_re, int *optptr, int *first_char)
345
const real_pcre *re = (const real_pcre *)external_re;
346
if (re == NULL) return PCRE_ERROR_NULL;
351
-pcre_fullinfo(const pcre *external_re, const pcre_extra *study_data, int what,
352
+ap_pcre_fullinfo(const pcre *external_re, const pcre_extra *study_data, int what,
355
const real_pcre *re = (const real_pcre *)external_re;
356
@@ -2475,7 +2475,7 @@
360
-pcre_compile(const char *pattern, int options, const char **errorptr,
361
+ap_pcre_compile(const char *pattern, int options, const char **errorptr,
362
int *erroroffset, const unsigned char *tables)
365
@@ -3052,7 +3052,7 @@
366
difference to the value of the offsetof(). */
368
size = length + offsetof(real_pcre, code[0]);
369
-re = (real_pcre *)(pcre_malloc)(size);
370
+re = (real_pcre *)(ap_pcre_malloc)(size);
374
@@ -3102,7 +3102,7 @@
376
if (*errorptr != NULL)
379
+ (ap_pcre_free)(re);
381
*erroroffset = ptr - (const uschar *)pattern;
383
@@ -3373,7 +3373,7 @@
384
if (code - re->code > length)
388
+ (ap_pcre_free)(re);
389
*erroroffset = ptr - (uschar *)pattern;
392
@@ -3715,7 +3715,7 @@
394
if (c < 16) save = stacksave; else
396
- save = (int *)(pcre_malloc)((c+1) * sizeof(int));
397
+ save = (int *)(ap_pcre_malloc)((c+1) * sizeof(int));
401
@@ -3729,7 +3729,7 @@
403
for (i = 1; i <= c; i++)
404
md->offset_vector[md->offset_end - i] = save[i];
405
- if (save != stacksave) (pcre_free)(save);
406
+ if (save != stacksave) (ap_pcre_free)(save);
407
if (!rc) return FALSE;
409
/* In case the recursion has set more capturing values, save the final
410
@@ -4867,7 +4867,7 @@
413
external_re points to the compiled expression
414
- external_extra points to "hints" from pcre_study() or is NULL
415
+ external_extra points to "hints" from ap_pcre_study() or is NULL
416
subject points to the subject string
417
length length of subject string (may contain binary zeros)
418
start_offset where to start in the subject string
419
@@ -4882,7 +4882,7 @@
423
-pcre_exec(const pcre *external_re, const pcre_extra *external_extra,
424
+ap_pcre_exec(const pcre *external_re, const pcre_extra *external_extra,
425
const char *subject, int length, int start_offset, int options, int *offsets,
428
@@ -4944,7 +4944,7 @@
429
if (re->top_backref > 0 && re->top_backref >= ocount/3)
431
ocount = re->top_backref * 3 + 3;
432
- match_block.offset_vector = (int *)(pcre_malloc)(ocount * sizeof(int));
433
+ match_block.offset_vector = (int *)(ap_pcre_malloc)(ocount * sizeof(int));
434
if (match_block.offset_vector == NULL) return PCRE_ERROR_NOMEMORY;
435
using_temporary_offsets = TRUE;
436
DPRINTF(("Got memory to hold back references\n"));
437
@@ -5139,7 +5139,7 @@
438
match_block.offset_overflow = TRUE;
440
DPRINTF(("Freeing temporary memory\n"));
441
- (pcre_free)(match_block.offset_vector);
442
+ (ap_pcre_free)(match_block.offset_vector);
445
rc = match_block.offset_overflow? 0 : match_block.end_offset_top/2;
446
@@ -5163,7 +5163,7 @@
447
if (using_temporary_offsets)
449
DPRINTF(("Freeing temporary memory\n"));
450
- (pcre_free)(match_block.offset_vector);
451
+ (ap_pcre_free)(match_block.offset_vector);
454
DPRINTF((">>>> returning %d\n", match_block.errorcode));
457
--- orig/apache2/srclib/pcre/pcre.def
458
+++ mod/apache2/srclib/pcre/pcre.def
471
-pcre_get_substring_list
477
+ap_pcre_copy_substring
479
+ap_pcre_get_substring
480
+ap_pcre_get_substring_list
490
+ap_pcreposix_regcomp
491
+ap_pcreposix_regexec
492
+ap_pcreposix_regerror
493
+ap_pcreposix_regfree
496
--- orig/apache2/srclib/pcre/pcre.hw
497
+++ mod/apache2/srclib/pcre/pcre.hw
499
#define PCRE_ERROR_NOMEMORY (-6)
500
#define PCRE_ERROR_NOSUBSTRING (-7)
502
-/* Request types for pcre_fullinfo() */
503
+/* Request types for ap_pcre_fullinfo() */
505
#define PCRE_INFO_OPTIONS 0
506
#define PCRE_INFO_SIZE 1
508
functions if required. Some magic is required for Win32 DLL; it is null on
511
-PCRE_DL_IMPORT extern void *(*pcre_malloc)(size_t);
512
-PCRE_DL_IMPORT extern void (*pcre_free)(void *);
513
+PCRE_DL_IMPORT extern void *(*ap_pcre_malloc)(size_t);
514
+PCRE_DL_IMPORT extern void (*ap_pcre_free)(void *);
516
#undef PCRE_DL_IMPORT
520
-extern pcre *pcre_compile(const char *, int, const char **, int *,
521
+extern pcre *ap_pcre_compile(const char *, int, const char **, int *,
522
const unsigned char *);
523
-extern int pcre_copy_substring(const char *, int *, int, int, char *, int);
524
-extern int pcre_exec(const pcre *, const pcre_extra *, const char *,
525
+extern int ap_pcre_copy_substring(const char *, int *, int, int, char *, int);
526
+extern int ap_pcre_exec(const pcre *, const pcre_extra *, const char *,
527
int, int, int, int *, int);
528
-extern void pcre_free_substring(const char *);
529
-extern void pcre_free_substring_list(const char **);
530
-extern int pcre_get_substring(const char *, int *, int, int, const char **);
531
-extern int pcre_get_substring_list(const char *, int *, int, const char ***);
532
-extern int pcre_info(const pcre *, int *, int *);
533
-extern int pcre_fullinfo(const pcre *, const pcre_extra *, int, void *);
534
-extern const unsigned char *pcre_maketables(void);
535
-extern pcre_extra *pcre_study(const pcre *, int, const char **);
536
-extern const char *pcre_version(void);
537
+extern void ap_pcre_free_substring(const char *);
538
+extern void ap_pcre_free_substring_list(const char **);
539
+extern int ap_pcre_get_substring(const char *, int *, int, int, const char **);
540
+extern int ap_pcre_get_substring_list(const char *, int *, int, const char ***);
541
+extern int ap_pcre_info(const pcre *, int *, int *);
542
+extern int ap_pcre_fullinfo(const pcre *, const pcre_extra *, int, void *);
543
+extern const unsigned char *ap_pcre_maketables(void);
544
+extern pcre_extra *ap_pcre_study(const pcre *, int, const char **);
545
+extern const char *ap_pcre_version(void);
551
--- orig/apache2/srclib/pcre/pcre.in
552
+++ mod/apache2/srclib/pcre/pcre.in
554
#define PCRE_ERROR_NOMEMORY (-6)
555
#define PCRE_ERROR_NOSUBSTRING (-7)
557
-/* Request types for pcre_fullinfo() */
558
+/* Request types for ap_pcre_fullinfo() */
560
#define PCRE_INFO_OPTIONS 0
561
#define PCRE_INFO_SIZE 1
563
functions if required. Some magic is required for Win32 DLL; it is null on
566
-PCRE_DL_IMPORT extern void *(*pcre_malloc)(size_t);
567
-PCRE_DL_IMPORT extern void (*pcre_free)(void *);
568
+PCRE_DL_IMPORT extern void *(*ap_pcre_malloc)(size_t);
569
+PCRE_DL_IMPORT extern void (*ap_pcre_free)(void *);
571
#undef PCRE_DL_IMPORT
575
-extern pcre *pcre_compile(const char *, int, const char **, int *,
576
+extern pcre *ap_pcre_compile(const char *, int, const char **, int *,
577
const unsigned char *);
578
-extern int pcre_copy_substring(const char *, int *, int, int, char *, int);
579
-extern int pcre_exec(const pcre *, const pcre_extra *, const char *,
580
+extern int ap_pcre_copy_substring(const char *, int *, int, int, char *, int);
581
+extern int ap_pcre_exec(const pcre *, const pcre_extra *, const char *,
582
int, int, int, int *, int);
583
-extern void pcre_free_substring(const char *);
584
-extern void pcre_free_substring_list(const char **);
585
-extern int pcre_get_substring(const char *, int *, int, int, const char **);
586
-extern int pcre_get_substring_list(const char *, int *, int, const char ***);
587
-extern int pcre_info(const pcre *, int *, int *);
588
-extern int pcre_fullinfo(const pcre *, const pcre_extra *, int, void *);
589
-extern const unsigned char *pcre_maketables(void);
590
-extern pcre_extra *pcre_study(const pcre *, int, const char **);
591
-extern const char *pcre_version(void);
592
+extern void ap_pcre_free_substring(const char *);
593
+extern void ap_pcre_free_substring_list(const char **);
594
+extern int ap_pcre_get_substring(const char *, int *, int, int, const char **);
595
+extern int ap_pcre_get_substring_list(const char *, int *, int, const char ***);
596
+extern int ap_pcre_info(const pcre *, int *, int *);
597
+extern int ap_pcre_fullinfo(const pcre *, const pcre_extra *, int, void *);
598
+extern const unsigned char *ap_pcre_maketables(void);
599
+extern pcre_extra *ap_pcre_study(const pcre *, int, const char **);
600
+extern const char *ap_pcre_version(void);
606
--- orig/apache2/srclib/pcre/pcredemo.c
607
+++ mod/apache2/srclib/pcre/pcredemo.c
610
/* Compile the regular expression in the first argument */
613
+re = ap_pcre_compile(
614
argv[1], /* the pattern */
615
0, /* default options */
616
&error, /* for error message */
619
/* Compilation succeeded: match the subject in the second argument */
623
re, /* the compiled pattern */
624
NULL, /* no extra data - we didn't study the pattern */
625
argv[2], /* the subject string */
628
--- orig/apache2/srclib/pcre/pcregrep.c
629
+++ mod/apache2/srclib/pcre/pcregrep.c
632
for (i = 0; !match && i < pattern_count; i++)
634
- match = pcre_exec(pattern_list[i], hints_list[i], buffer, length, 0, 0,
635
+ match = ap_pcre_exec(pattern_list[i], hints_list[i], buffer, length, 0, 0,
637
if (match && whole_lines && offsets[1] != length) match = FALSE;
642
fprintf(stderr, "pcregrep version %s using ", VERSION);
643
- fprintf(stderr, "PCRE version %s\n", pcre_version());
644
+ fprintf(stderr, "PCRE version %s\n", ap_pcre_version());
649
while (s > buffer && isspace((unsigned char)(s[-1]))) s--;
650
if (s == buffer) continue;
652
- pattern_list[pattern_count] = pcre_compile(buffer, options, &error,
653
+ pattern_list[pattern_count] = ap_pcre_compile(buffer, options, &error,
655
if (pattern_list[pattern_count++] == NULL)
660
if (i >= argc) return usage(0);
661
- pattern_list[0] = pcre_compile(argv[i++], options, &error, &errptr, NULL);
662
+ pattern_list[0] = ap_pcre_compile(argv[i++], options, &error, &errptr, NULL);
663
if (pattern_list[0] == NULL)
665
fprintf(stderr, "pcregrep: Error in regex at offset %d: %s\n", errptr,
668
for (j = 0; j < pattern_count; j++)
670
- hints_list[j] = pcre_study(pattern_list[j], 0, &error);
671
+ hints_list[j] = ap_pcre_study(pattern_list[j], 0, &error);
677
--- orig/apache2/srclib/pcre/pcreposix.c
678
+++ mod/apache2/srclib/pcre/pcreposix.c
680
*************************************************/
683
-regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
684
+ap_pcreposix_regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
686
const char *message, *addmessage;
687
size_t length, addlength;
689
*************************************************/
692
-regfree(regex_t *preg)
693
+ap_pcreposix_regfree(regex_t *preg)
695
-(pcre_free)(preg->re_pcre);
696
+(ap_pcre_free)(preg->re_pcre);
704
-regcomp(regex_t *preg, const char *pattern, int cflags)
705
+ap_pcreposix_regcomp(regex_t *preg, const char *pattern, int cflags)
707
const char *errorptr;
709
@@ -203,12 +203,12 @@
710
if ((cflags & REG_ICASE) != 0) options |= PCRE_CASELESS;
711
if ((cflags & REG_NEWLINE) != 0) options |= PCRE_MULTILINE;
713
-preg->re_pcre = pcre_compile(pattern, options, &errorptr, &erroffset, NULL);
714
+preg->re_pcre = ap_pcre_compile(pattern, options, &errorptr, &erroffset, NULL);
715
preg->re_erroffset = erroffset;
717
if (preg->re_pcre == NULL) return pcre_posix_error_code(errorptr);
719
-preg->re_nsub = pcre_info(preg->re_pcre, NULL, NULL);
720
+preg->re_nsub = ap_pcre_info(preg->re_pcre, NULL, NULL);
726
#define SMALL_NMATCH 5
728
-regexec(regex_t *preg, const char *string, size_t nmatch,
729
+ap_pcreposix_regexec(regex_t *preg, const char *string, size_t nmatch,
730
regmatch_t pmatch[], int eflags)
737
-rc = pcre_exec(preg->re_pcre, NULL, string, (int)strlen(string), 0, options,
738
+rc = ap_pcre_exec(preg->re_pcre, NULL, string, (int)strlen(string), 0, options,
739
ovector, nmatch * 3);
741
if (rc == 0) rc = nmatch; /* All captured slots were filled in */
744
--- orig/apache2/srclib/pcre/pcreposix.h
745
+++ mod/apache2/srclib/pcre/pcreposix.h
750
-extern int regcomp(regex_t *, const char *, int);
751
-extern int regexec(regex_t *, const char *, size_t, regmatch_t *, int);
752
-extern size_t regerror(int, const regex_t *, char *, size_t);
753
-extern void regfree(regex_t *);
754
+extern int ap_pcreposix_regcomp(regex_t *, const char *, int);
755
+extern int ap_pcreposix_regexec(regex_t *, const char *, size_t, regmatch_t *, int);
756
+extern size_t ap_pcreposix_regerror(int, const regex_t *, char *, size_t);
757
+extern void ap_pcreposix_regfree(regex_t *);
763
--- orig/apache2/srclib/pcre/pcretest.c
764
+++ mod/apache2/srclib/pcre/pcretest.c
769
-/* Use the internal info for displaying the results of pcre_study(). */
770
+/* Use the internal info for displaying the results of ap_pcre_study(). */
772
#include "internal.h"
774
@@ -409,13 +409,13 @@
778
-/* Get one piece of information from the pcre_fullinfo() function */
779
+/* Get one piece of information from the ap_pcre_fullinfo() function */
781
static void new_info(pcre *re, pcre_extra *study, int option, void *ptr)
784
-if ((rc = pcre_fullinfo(re, study, option, ptr)) < 0)
785
- fprintf(outfile, "Error %d from pcre_fullinfo(%d)\n", rc, option);
786
+if ((rc = ap_pcre_fullinfo(re, study, option, ptr)) < 0)
787
+ fprintf(outfile, "Error %d from ap_pcre_fullinfo(%d)\n", rc, option);
791
@@ -522,11 +522,11 @@
793
/* Set alternative malloc function */
795
-pcre_malloc = new_malloc;
796
+ap_pcre_malloc = new_malloc;
798
/* Heading line, then prompt for first regex if stdin */
800
-fprintf(outfile, "PCRE version %s\n\n", pcre_version());
801
+fprintf(outfile, "PCRE version %s\n\n", ap_pcre_version());
806
fprintf(outfile, "** Failed to set locale \"%s\"\n", pp);
809
- tables = pcre_maketables();
810
+ tables = ap_pcre_maketables();
814
@@ -674,14 +674,14 @@
816
if ((options & PCRE_CASELESS) != 0) cflags |= REG_ICASE;
817
if ((options & PCRE_MULTILINE) != 0) cflags |= REG_NEWLINE;
818
- rc = regcomp(&preg, (char *)p, cflags);
819
+ rc = ap_pcreposix_regcomp(&preg, (char *)p, cflags);
821
/* Compilation failed; go back for another re, skipping to blank line
822
if non-interactive. */
826
- (void)regerror(rc, &preg, (char *)buffer, sizeof(buffer));
827
+ (void)ap_pcreposix_regerror(rc, &preg, (char *)buffer, sizeof(buffer));
828
fprintf(outfile, "Failed: POSIX code %d: %s\n", rc, buffer);
832
clock_t start_time = clock();
833
for (i = 0; i < LOOPREPEAT; i++)
835
- re = pcre_compile((char *)p, options, &error, &erroroffset, tables);
836
+ re = ap_pcre_compile((char *)p, options, &error, &erroroffset, tables);
837
if (re != NULL) free(re);
839
time_taken = clock() - start_time;
841
((double)LOOPREPEAT * (double)CLOCKS_PER_SEC));
844
- re = pcre_compile((char *)p, options, &error, &erroroffset, tables);
845
+ re = ap_pcre_compile((char *)p, options, &error, &erroroffset, tables);
847
/* Compilation failed; go back for another re, skipping to blank line
848
if non-interactive. */
849
@@ -756,26 +756,26 @@
850
new_info(re, NULL, PCRE_INFO_FIRSTCHAR, &first_char);
851
new_info(re, NULL, PCRE_INFO_LASTLITERAL, &need_char);
853
- old_count = pcre_info(re, &old_options, &old_first_char);
854
+ old_count = ap_pcre_info(re, &old_options, &old_first_char);
855
if (count < 0) fprintf(outfile,
856
- "Error %d from pcre_info()\n", count);
857
+ "Error %d from ap_pcre_info()\n", count);
860
if (old_count != count) fprintf(outfile,
861
- "Count disagreement: pcre_fullinfo=%d pcre_info=%d\n", count,
862
+ "Count disagreement: ap_pcre_fullinfo=%d ap_pcre_info=%d\n", count,
865
if (old_first_char != first_char) fprintf(outfile,
866
- "First char disagreement: pcre_fullinfo=%d pcre_info=%d\n",
867
+ "First char disagreement: ap_pcre_fullinfo=%d ap_pcre_info=%d\n",
868
first_char, old_first_char);
870
if (old_options != (int)get_options) fprintf(outfile,
871
- "Options disagreement: pcre_fullinfo=%ld pcre_info=%d\n",
872
+ "Options disagreement: ap_pcre_fullinfo=%ld ap_pcre_info=%d\n",
873
get_options, old_options);
876
if (size != gotten_store) fprintf(outfile,
877
- "Size disagreement: pcre_fullinfo=%d call to malloc for %d\n",
878
+ "Size disagreement: ap_pcre_fullinfo=%d call to malloc for %d\n",
881
fprintf(outfile, "Capturing subpattern count = %d\n", count);
884
clock_t start_time = clock();
885
for (i = 0; i < LOOPREPEAT; i++)
886
- extra = pcre_study(re, study_options, &error);
887
+ extra = ap_pcre_study(re, study_options, &error);
888
time_taken = clock() - start_time;
889
if (extra != NULL) free(extra);
890
fprintf(outfile, " Study time %.3f milliseconds\n",
892
((double)LOOPREPEAT * (double)CLOCKS_PER_SEC));
895
- extra = pcre_study(re, study_options, &error);
896
+ extra = ap_pcre_study(re, study_options, &error);
898
fprintf(outfile, "Failed to study: %s\n", error);
899
else if (extra == NULL)
900
@@ -1047,11 +1047,11 @@
901
if ((options & PCRE_NOTBOL) != 0) eflags |= REG_NOTBOL;
902
if ((options & PCRE_NOTEOL) != 0) eflags |= REG_NOTEOL;
904
- rc = regexec(&preg, (const char *)bptr, use_size_offsets, pmatch, eflags);
905
+ rc = ap_pcreposix_regexec(&preg, (const char *)bptr, use_size_offsets, pmatch, eflags);
909
- (void)regerror(rc, &preg, (char *)buffer, sizeof(buffer));
910
+ (void)ap_pcreposix_regerror(rc, &preg, (char *)buffer, sizeof(buffer));
911
fprintf(outfile, "No match: POSIX code %d: %s\n", rc, buffer);
914
@@ -1090,7 +1090,7 @@
916
clock_t start_time = clock();
917
for (i = 0; i < LOOPREPEAT; i++)
918
- count = pcre_exec(re, extra, (char *)bptr, len,
919
+ count = ap_pcre_exec(re, extra, (char *)bptr, len,
920
start_offset, options | g_notempty, use_offsets, use_size_offsets);
921
time_taken = clock() - start_time;
922
fprintf(outfile, "Execute time %.3f milliseconds\n",
923
@@ -1098,7 +1098,7 @@
924
((double)LOOPREPEAT * (double)CLOCKS_PER_SEC));
927
- count = pcre_exec(re, extra, (char *)bptr, len,
928
+ count = ap_pcre_exec(re, extra, (char *)bptr, len,
929
start_offset, options | g_notempty, use_offsets, use_size_offsets);
932
@@ -1138,7 +1138,7 @@
933
if ((copystrings & (1 << i)) != 0)
936
- int rc = pcre_copy_substring((char *)bptr, use_offsets, count,
937
+ int rc = ap_pcre_copy_substring((char *)bptr, use_offsets, count,
938
i, copybuffer, sizeof(copybuffer));
940
fprintf(outfile, "copy substring %d failed %d\n", i, rc);
941
@@ -1152,7 +1152,7 @@
942
if ((getstrings & (1 << i)) != 0)
944
const char *substring;
945
- int rc = pcre_get_substring((char *)bptr, use_offsets, count,
946
+ int rc = ap_pcre_get_substring((char *)bptr, use_offsets, count,
949
fprintf(outfile, "get substring %d failed %d\n", i, rc);
950
@@ -1160,7 +1160,7 @@
952
fprintf(outfile, "%2dG %s (%d)\n", i, substring, rc);
953
/* free((void *)substring); */
954
- pcre_free_substring(substring);
955
+ ap_pcre_free_substring(substring);
959
@@ -1168,7 +1168,7 @@
962
const char **stringlist;
963
- int rc = pcre_get_substring_list((char *)bptr, use_offsets, count,
964
+ int rc = ap_pcre_get_substring_list((char *)bptr, use_offsets, count,
967
fprintf(outfile, "get substring list failed %d\n", rc);
968
@@ -1179,7 +1179,7 @@
969
if (stringlist[i] != NULL)
970
fprintf(outfile, "string list not terminated by NULL\n");
971
/* free((void *)stringlist); */
972
- pcre_free_substring_list(stringlist);
973
+ ap_pcre_free_substring_list(stringlist);
977
@@ -1243,7 +1243,7 @@
981
- if (posix || do_posix) regfree(&preg);
982
+ if (posix || do_posix) ap_pcreposix_regfree(&preg);
985
if (re != NULL) free(re);
988
--- orig/apache2/srclib/pcre/pgrep.c
989
+++ mod/apache2/srclib/pcre/pgrep.c
991
if (length > 0 && buffer[length-1] == '\n') buffer[--length] = 0;
994
- match = pcre_exec(pattern, hints, buffer, length, 0, 0, offsets, 99) >= 0;
995
+ match = ap_pcre_exec(pattern, hints, buffer, length, 0, 0, offsets, 99) >= 0;
996
if (match && whole_lines && offsets[1] != length) match = FALSE;
1000
case 'x': whole_lines = TRUE; options |= PCRE_ANCHORED; break;
1003
- fprintf(stderr, "PCRE version %s\n", pcre_version());
1004
+ fprintf(stderr, "PCRE version %s\n", ap_pcre_version());
1010
/* Compile the regular expression. */
1012
-pattern = pcre_compile(argv[i++], options, &error, &errptr, NULL);
1013
+pattern = ap_pcre_compile(argv[i++], options, &error, &errptr, NULL);
1014
if (pattern == NULL)
1016
fprintf(stderr, "pgrep: error in regex at offset %d: %s\n", errptr, error);
1019
/* Study the regular expression, as we will be running it may times */
1021
-hints = pcre_study(pattern, 0, &error);
1022
+hints = ap_pcre_study(pattern, 0, &error);
1025
fprintf(stderr, "pgrep: error while studing regex: %s\n", error);
1028
--- orig/apache2/srclib/pcre/study.c
1029
+++ mod/apache2/srclib/pcre/study.c
1032
/* This function is handed a compiled expression that it must study to produce
1033
information that will speed up the matching. It returns a pcre_extra block
1034
-which then gets handed back to pcre_exec().
1035
+which then gets handed back to ap_pcre_exec().
1038
re points to the compiled expression
1043
-pcre_study(const pcre *external_re, int options, const char **errorptr)
1044
+ap_pcre_study(const pcre *external_re, int options, const char **errorptr)
1046
uschar start_bits[32];
1047
real_pcre_extra *extra;
1050
/* Get an "extra" block and put the information therein. */
1052
-extra = (real_pcre_extra *)(pcre_malloc)(sizeof(real_pcre_extra));
1053
+extra = (real_pcre_extra *)(ap_pcre_malloc)(sizeof(real_pcre_extra));