Ignore:
Timestamp:
Oct 16, 2007, 10:38:39 PM (18 years ago)
Author:
darin
Message:

Reviewed by Geoff.

  • merged PCRE changes between 6.4 and 6.5
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj: Removed pcre_config.c, pcre_globals.c, pcre_info.c, pcre_maketables.c, pcre_printint.src, pcre_refcount.c, pcre_study.c, pcre_try_flipped.c, pcre_ucp_findchar.c, pcre_version.c, and ucptable.c. Added pcre_ucp_searchfuncs.c.
  • pcre/AUTHORS:
  • pcre/LICENCE:
  • pcre/MERGING:
  • pcre/dftables.c:
  • pcre/pcre-config.h:
  • pcre/pcre.h:
  • pcre/pcre.pri:
  • pcre/pcre_compile.c:
  • pcre/pcre_exec.c:
  • pcre/pcre_fullinfo.c:
  • pcre/pcre_get.c:
  • pcre/pcre_internal.h:
  • pcre/pcre_maketables.c:
  • pcre/pcre_ord2utf8.c:
  • pcre/pcre_tables.c:
  • pcre/pcre_ucp_searchfuncs.c: Copied from pcre/pcre_ucp_findchar.c.
  • pcre/pcre_xclass.c:
  • pcre/ucp.h:
  • pcre/ucpinternal.h:
  • pcre/ucptable.c: Updated with new versions from the PCRE 6.5 release, merged with changes.
  • pcre/pcre_config.c: Removed.
  • pcre/pcre_globals.c: Removed.
  • pcre/pcre_info.c: Removed.
  • pcre/pcre_printint.src: Removed.
  • pcre/pcre_refcount.c: Removed.
  • pcre/pcre_study.c: Removed.
  • pcre/pcre_try_flipped.c: Removed.
  • pcre/pcre_ucp_findchar.c: Removed.
  • pcre/pcre_version.c: Removed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/pcre/pcre_internal.h

    r24453 r26697  
    88
    99                       Written by Philip Hazel
    10            Copyright (c) 1997-2005 University of Cambridge
     10           Copyright (c) 1997-2006 University of Cambridge
    1111           Copyright (c) 2004, 2005 Apple Computer, Inc.
    1212
     
    4848
    4949#include "Assertions.h"
    50 
    51 /* Added to prevent 64-to-32 shortening warnings when compiling for 64-bit
    52   <rdar://problem/4712064> PCRE generates many warnings with -Wshorten-64-to-32 */
    53 #if defined(__GNUC__) && defined(__LP64__)
    54 #define INT_CAST(i) (int)(i); ASSERT((i) <= INT_MAX)
    55 #else
    56 #define INT_CAST(i) (i)
    57 #endif
    5850
    5951#if COMPILER(MSVC)
     
    138130#endif
    139131
    140 /* Include the public PCRE header and the definitions of UCP character property
    141 values. */
    142 
    143 #include "pcre.h"
    144 #include "ucp.h"
    145 
    146132/* All character handling must be done as unsigned characters. Otherwise there
    147133are problems with top-bit-set characters and functions such as isspace().
     
    153139typedef unsigned char uschar;
    154140
    155 /* Use pcre_uchar for always-unsigned version of pcre_char. */
     141/* When PCRE is compiled as a C++ library, the subject pointer can be replaced
     142with a custom type. This makes it possible, for example, to allow pcre_exec()
     143to process subject strings that are discontinuous by using a smart pointer
     144class. It must always be possible to inspect all of the subject string in
     145pcre_exec() because of the way it backtracks. Two macros are required in the
     146normal case, for sign-unspecified and unsigned char pointers. The former is
     147used for the external interface and appears in pcre.h, which is why its name
     148must begin with PCRE_. */
     149
     150#ifdef CUSTOM_SUBJECT_PTR
     151#define PCRE_SPTR CUSTOM_SUBJECT_PTR
     152#define USPTR CUSTOM_SUBJECT_PTR
     153#else
     154#define USPTR const pcre_uchar *
     155#endif
     156
     157/* Include the public PCRE header and the definitions of UCP character property
     158values. */
     159
     160#include "pcre.h"
     161#include "ucp.h"
     162
     163/* Unsigned version of pcre_char. */
    156164#if PCRE_UTF16
    157165typedef pcre_char pcre_uchar;
     
    186194pcre_memmove(unsigned char *dest, const unsigned char *src, size_t n)
    187195{
    188 int i;
     196size_t i;
    189197dest += n;
    190198src += n;
    191199for (i = 0; i < n; ++i) *(--dest) =  *(--src);
     200return dest;
    192201}
    193202#define memmove(a, b, c) pcre_memmove(a, b, c)
     
    408417know we are in UTF-8 mode. */
    409418
    410 #define GETCHARINC GETUTF8CHARINC
     419#define GETCHARINC(c, eptr) GETUTF8CHARINC(c, eptr)
    411420
    412421/* Get the next character, testing for UTF-8 mode, and advancing the pointer */
     
    546555#endif
    547556
     557/* Codes for different types of Unicode property */
     558
     559#define PT_ANY        0    /* Any property - matches all chars */
     560#define PT_LAMP       1    /* L& - the union of Lu, Ll, Lt */
     561#define PT_GC         2    /* General characteristic (e.g. L) */
     562#define PT_PC         3    /* Particular characteristic (e.g. Lu) */
     563#define PT_SC         4    /* Script (e.g. Han) */
     564
     565/* Flag bits and data types for the extended class (OP_XCLASS) for classes that
     566contain UTF-8 characters with values greater than 255. */
     567
     568#define XCL_NOT    0x01    /* Flag: this is a negative class */
     569#define XCL_MAP    0x02    /* Flag: a 32-byte map is present */
     570
     571#define XCL_END       0    /* Marks end of individual items */
     572#define XCL_SINGLE    1    /* Single item (one multibyte char) follows */
     573#define XCL_RANGE     2    /* A range (two multibyte chars) follows */
     574#define XCL_PROP      3    /* Unicode property (2-byte property code follows) */
     575#define XCL_NOTPROP   4    /* Unicode inverted property (ditto) */
     576
    548577/* These are escaped items that aren't just an encoding of a particular data
    549578value such as \n. They must have non-zero values, as check_escape() returns
     
    560589       ESC_w, ESC_dum1, ESC_C, ESC_P, ESC_p, ESC_X, ESC_Z, ESC_z, ESC_E,
    561590       ESC_Q, ESC_REF };
    562 
    563 /* Flag bits and data types for the extended class (OP_XCLASS) for classes that
    564 contain UTF-8 characters with values greater than 255. */
    565 
    566 #define XCL_NOT    0x01    /* Flag: this is a negative class */
    567 #define XCL_MAP    0x02    /* Flag: a 32-byte map is present */
    568 
    569 #define XCL_END       0    /* Marks end of individual items */
    570 #define XCL_SINGLE    1    /* Single item (one multibyte char) follows */
    571 #define XCL_RANGE     2    /* A range (two multibyte chars) follows */
    572 #define XCL_PROP      3    /* Unicode property (one property code) follows */
    573 #define XCL_NOTPROP   4    /* Unicode inverted property (ditto) */
    574 
    575591
    576592/* Opcode table: OP_BRA must be last, as all values >= it are used for brackets
     
    737753  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  /* \A, \G, \B, \B, \D, \d, \S, \s, \W, \w */ \
    738754  1, 1,                          /* Any, Anybyte                           */ \
    739   2, 2, 1,                       /* NOTPROP, PROP, EXTUNI                  */ \
     755  3, 3, 1,                       /* NOTPROP, PROP, EXTUNI                  */ \
    740756  1, 1, 2, 1, 1,                 /* \Z, \z, Opt, ^, $                      */ \
    741757  2,                             /* Char  - the minimum length             */ \
     
    869885  int group_num;                /* Number of group that was called */
    870886  const uschar *after_call;     /* "Return value": points after the call in the expr */
    871   const pcre_uchar *save_start;     /* Old value of md->start_match */
     887  USPTR save_start;             /* Old value of md->start_match */
    872888  int *offset_save;             /* Pointer to start of saved offsets */
    873889  int saved_max;                /* Number of saved offsets */
     
    888904
    889905typedef struct match_data {
    890   unsigned long int match_call_count; /* As it says */
    891   unsigned long int match_limit;/* As it says */
     906  unsigned long int match_call_count;      /* As it says */
     907  unsigned long int match_limit;           /* As it says */
     908  unsigned long int match_limit_recursion; /* As it says */
    892909  int   *offset_vector;         /* Offset vector */
    893910  int    offset_end;            /* One past the end */
     
    904921  BOOL   hitend;                /* Hit the end of the subject at some point */
    905922  const uschar *start_code;     /* For use when recursing */
    906   const pcre_uchar *start_subject;   /* Start of the subject string */
    907   const pcre_uchar *end_subject;     /* End of the subject string */
    908   const pcre_uchar *start_match;     /* Start of this match attempt */
    909   const pcre_uchar *end_match_ptr;   /* Subject position at end match */
     923  USPTR  start_subject;         /* Start of the subject string */
     924  USPTR  end_subject;           /* End of the subject string */
     925  USPTR  start_match;           /* Start of this match attempt */
     926  USPTR  end_match_ptr;         /* Subject position at end match */
    910927  int    end_offset_top;        /* Highwater mark at end of match */
    911928  int    capture_last;          /* Most recent capture number */
     
    962979#define tables_length (ctypes_offset + 256)
    963980
    964 /* Layout of the UCP type table that translates property names into codes for
    965 _pcre_ucp_findchar(). */
     981/* Layout of the UCP type table that translates property names into types and
     982codes. */
    966983
    967984typedef struct {
    968985  const char *name;
    969   int value;
     986  pcre_uint16 type;
     987  pcre_uint16 value;
    970988} ucp_type_table;
    971989
     
    9901008extern const uschar _pcre_OP_lengths[];
    9911009
     1010
    9921011/* Internal shared functions. These are functions that are used by more than
    9931012one of the exported public functions. They have to be "external" in the C
     
    9971016extern real_pcre * _pcre_try_flipped(const real_pcre *, real_pcre *,
    9981017                     const pcre_study_data *, pcre_study_data *);
    999 extern int         _pcre_ucp_findchar(const int, int *, int *);
     1018extern int         _pcre_ucp_findprop(const int, int *, int *);
     1019extern int         _pcre_ucp_othercase(const int);
    10001020extern int         _pcre_valid_utf8(const uschar *, int);
    10011021extern BOOL        _pcre_xclass(int, const uschar *);
Note: See TracChangeset for help on using the changeset viewer.