OSSP CVS Repository

ossp - Check-in [1090]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1090
Date: 2001-Oct-06 16:30:42 (local)
2001-Oct-06 14:30:42 (UTC)
User:rse
Branch:
Comment: Upgrade to latest sripped down version of PCRE 3.5. This time we use the new PCRE_PREFIX feature to hide PCRE inside the l2_util_ namespace prefix.
Tickets:
Inspections:
Files:
ossp-pkg/l2/l2_ut_pcre.c      1.2 -> 1.3     15 inserted, 15 deleted
ossp-pkg/l2/l2_ut_pcre.h      1.2 -> 1.3     30 inserted, 4 deleted

ossp-pkg/l2/l2_ut_pcre.c 1.2 -> 1.3

--- l2_ut_pcre.c 2001/09/15 16:03:37     1.2
+++ l2_ut_pcre.c 2001/10/06 14:30:42     1.3
@@ -239,7 +239,7 @@
 
 typedef unsigned char uschar;
 
-typedef struct real_pcre {
+typedef struct pcre_st {
         unsigned long int magic_number;
         size_t size;
         const unsigned char *tables;
@@ -249,12 +249,12 @@
         uschar first_char;
         uschar req_char;
         uschar code[1];
-} real_pcre;
+} pcre_st;
 
-typedef struct real_pcre_extra {
+typedef struct pcre_extra_st {
         uschar options;
         uschar start_bits[32];
-} real_pcre_extra;
+} pcre_extra_st;
 
 typedef struct compile_data {
         const uschar *lcc;
@@ -465,7 +465,7 @@
 
 int pcre_info(const pcre * external_re, int *optptr, int *first_char)
 {
-        const real_pcre *re = (const real_pcre *)external_re;
+        const pcre_st *re = (const pcre_st *)external_re;
         if (re == NULL)
                 return PCRE_ERROR_NULL;
         if (re->magic_number != MAGIC_NUMBER)
@@ -482,8 +482,8 @@
 pcre_fullinfo(const pcre * external_re, const pcre_extra * study_data,
                           int what, void *where)
 {
-        const real_pcre *re = (const real_pcre *)external_re;
-        const real_pcre_extra *study = (const real_pcre_extra *)study_data;
+        const pcre_st *re = (const pcre_st *)external_re;
+        const pcre_extra_st *study = (const pcre_extra_st *)study_data;
 
         if (re == NULL || where == NULL)
                 return PCRE_ERROR_NULL;
@@ -1883,7 +1883,7 @@
 pcre *pcre_compile(const char *pattern, int options, const char **errorptr,
                                    int *erroroffset, const unsigned char *tables)
 {
-        real_pcre *re;
+        pcre_st *re;
         int length = 3;
         int runlength;
         int c, reqchar, countlits;
@@ -2337,8 +2337,8 @@
                 return NULL;
         }
 
-        size = length + offsetof(real_pcre, code[0]);
-        re = (real_pcre *) (pcre_malloc) (size);
+        size = length + offsetof(pcre_st, code[0]);
+        re = (pcre_st *) (pcre_malloc) (size);
 
         if (re == NULL) {
                 *errorptr = ERR21;
@@ -3585,8 +3585,8 @@
         const uschar *start_match = (const uschar *)subject + start_offset;
         const uschar *end_subject;
         const uschar *req_char_ptr = start_match - 1;
-        const real_pcre *re = (const real_pcre *)external_re;
-        const real_pcre_extra *extra = (const real_pcre_extra *)external_extra;
+        const pcre_st *re = (const pcre_st *)external_re;
+        const pcre_extra_st *extra = (const pcre_extra_st *)external_extra;
         BOOL using_temporary_offsets = FALSE;
         BOOL anchored;
         BOOL startline;
@@ -3998,8 +3998,8 @@
                                            const char **errorptr)
 {
         uschar start_bits[32];
-        real_pcre_extra *extra;
-        const real_pcre *re = (const real_pcre *)external_re;
+        pcre_extra_st *extra;
+        const pcre_st *re = (const pcre_st *)external_re;
         compile_data compile_block;
 
         *errorptr = NULL;
@@ -4027,7 +4027,7 @@
                 (re->code, start_bits, (re->options & PCRE_CASELESS) != 0,
                  &compile_block)) return NULL;
 
-        extra = (real_pcre_extra *) (pcre_malloc) (sizeof (real_pcre_extra));
+        extra = (pcre_extra_st *) (pcre_malloc) (sizeof (pcre_extra_st));
 
         if (extra == NULL) {
                 *errorptr = "failed to get memory";


ossp-pkg/l2/l2_ut_pcre.h 1.2 -> 1.3

--- l2_ut_pcre.h 2001/09/15 16:03:37     1.2
+++ l2_ut_pcre.h 2001/10/06 14:30:42     1.3
@@ -45,10 +45,36 @@
 #ifndef __L2_UT_PCRE_H__
 #define __L2_UT_PCRE_H__
 
+#define PCRE_PREFIX l2_util_
+
 #define PCRE_MAJOR          3
 #define PCRE_MINOR          5
 #define PCRE_DATE           15-Aug-2001
 
+#ifdef PCRE_PREFIX
+#if defined(__STDC__) || defined(__cplusplus)
+#define __PCRE_CONCAT(x,y) x ## y
+#define PCRE_CONCAT(x,y) __PCRE_CONCAT(x,y)
+#else
+#define __PCRE_CONCAT(x) x
+#define PCRE_CONCAT(x,y) __PCRE_CONCAT(x)y
+#endif
+#define pcre_malloc PCRE_CONCAT(PCRE_PREFIX,pcre_malloc)
+#define pcre_free PCRE_CONCAT(PCRE_PREFIX,pcre_free)
+#define pcre_compile PCRE_CONCAT(PCRE_PREFIX,pcre_compile)
+#define pcre_copy_substring PCRE_CONCAT(PCRE_PREFIX,pcre_copy_substring)
+#define pcre_exec PCRE_CONCAT(PCRE_PREFIX,pcre_exec)
+#define pcre_free_substring PCRE_CONCAT(PCRE_PREFIX,pcre_free_substring)
+#define pcre_free_substring_list PCRE_CONCAT(PCRE_PREFIX,pcre_free_substring_list)
+#define pcre_get_substring PCRE_CONCAT(PCRE_PREFIX,pcre_get_substring)
+#define pcre_get_substring_list PCRE_CONCAT(PCRE_PREFIX,pcre_get_substring_list)
+#define pcre_info PCRE_CONCAT(PCRE_PREFIX,pcre_info)
+#define pcre_fullinfo PCRE_CONCAT(PCRE_PREFIX,pcre_fullinfo)
+#define pcre_maketables PCRE_CONCAT(PCRE_PREFIX,pcre_maketables)
+#define pcre_study PCRE_CONCAT(PCRE_PREFIX,pcre_study)
+#define pcre_version PCRE_CONCAT(PCRE_PREFIX,pcre_version)
+#endif
+
 #include <stdlib.h>
 
 #ifdef __cplusplus
@@ -84,11 +110,11 @@
 #define PCRE_INFO_FIRSTTABLE      5
 #define PCRE_INFO_LASTLITERAL     6
 
-struct real_pcre;
-struct real_pcre_extra;
+struct pcre_st;
+struct pcre_extra_st;
 
-typedef struct real_pcre pcre;
-typedef struct real_pcre_extra pcre_extra;
+typedef struct pcre_st pcre;
+typedef struct pcre_extra_st pcre_extra;
 
 extern void *(*pcre_malloc)(size_t);
 extern void  (*pcre_free)(void *);

CVSTrac 2.0.1