[webkit-changes] cvs commit: JavaScriptCore/pcre get.c internal.h maketables.c pcre.c study.c AUTHORS COPYING LICENCE dftables.c pcre.h

Darin darin at opensource.apple.com
Fri Aug 12 15:18:10 PDT 2005


darin       05/08/12 15:18:10

  Modified:    pcre     AUTHORS COPYING LICENCE dftables.c pcre.h
  Added:       pcre     get.c internal.h maketables.c pcre.c study.c
  Log:
  oops; roll back, this was supposed to be on a branch
  
  Revision  Changes    Path
  1.3       +2 -19     JavaScriptCore/pcre/AUTHORS
  
  Index: AUTHORS
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/pcre/AUTHORS,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AUTHORS	12 Aug 2005 22:13:26 -0000	1.2
  +++ AUTHORS	12 Aug 2005 22:18:07 -0000	1.3
  @@ -1,23 +1,6 @@
  -THE MAIN PCRE LIBRARY
  ----------------------
  -
  -Written by:       Philip Hazel
  -Email local part: ph10
  -Email domain:     cam.ac.uk
  +Written by: Philip Hazel <ph10 at cam.ac.uk>
   
   University of Cambridge Computing Service,
   Cambridge, England. Phone: +44 1223 334714.
   
  -Copyright (c) 1997-2005 University of Cambridge
  -All rights reserved
  -
  -
  -THE C++ WRAPPER LIBRARY
  ------------------------
  -
  -Written by:       Google Inc.
  -
  -Copyright (c) 2005 Google Inc
  -All rights reserved
  -
  -####
  +Copyright (c) 1997-2001 University of Cambridge
  
  
  
  1.3       +28 -46    JavaScriptCore/pcre/COPYING
  
  Index: COPYING
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/pcre/COPYING,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- COPYING	12 Aug 2005 22:13:26 -0000	1.2
  +++ COPYING	12 Aug 2005 22:18:07 -0000	1.3
  @@ -4,65 +4,47 @@
   PCRE is a library of functions to support regular expressions whose syntax
   and semantics are as close as possible to those of the Perl 5 language.
   
  -Release 6 of PCRE is distributed under the terms of the "BSD" licence, as
  -specified below. The documentation for PCRE, supplied in the "doc"
  -directory, is distributed under the same terms as the software itself.
  -
  -The basic library functions are written in C and are freestanding. Also
  -included in the distribution is a set of C++ wrapper functions.
  -
  -
  -THE BASIC LIBRARY FUNCTIONS
  ----------------------------
  -
  -Written by:       Philip Hazel
  -Email local part: ph10
  -Email domain:     cam.ac.uk
  +Written by: Philip Hazel <ph10 at cam.ac.uk>
   
   University of Cambridge Computing Service,
   Cambridge, England. Phone: +44 1223 334714.
   
  -Copyright (c) 1997-2005 University of Cambridge
  -All rights reserved.
  -
  +Copyright (c) 1997-2001 University of Cambridge
   
  -THE C++ WRAPPER FUNCTIONS
  --------------------------
  +Permission is granted to anyone to use this software for any purpose on any
  +computer system, and to redistribute it freely, subject to the following
  +restrictions:
   
  -Contributed by:   Google Inc.
  +1. This software is distributed in the hope that it will be useful,
  +   but WITHOUT ANY WARRANTY; without even the implied warranty of
  +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   
  -Copyright (c) 2005, Google Inc.
  -All rights reserved.
  +2. The origin of this software must not be misrepresented, either by
  +   explicit claim or by omission. In practice, this means that if you use
  +   PCRE in software which you distribute to others, commercially or
  +   otherwise, you must put a sentence like this
   
  +     Regular expression support is provided by the PCRE library package,
  +     which is open source software, written by Philip Hazel, and copyright
  +     by the University of Cambridge, England.
   
  -THE "BSD" LICENCE
  ------------------
  +   somewhere reasonably visible in your documentation and in any relevant
  +   files or online help data or similar. A reference to the ftp site for
  +   the source, that is, to
   
  -Redistribution and use in source and binary forms, with or without
  -modification, are permitted provided that the following conditions are met:
  +     ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
   
  -    * Redistributions of source code must retain the above copyright notice,
  -      this list of conditions and the following disclaimer.
  +   should also be given in the documentation.
   
  -    * Redistributions in binary form must reproduce the above copyright
  -      notice, this list of conditions and the following disclaimer in the
  -      documentation and/or other materials provided with the distribution.
  +3. Altered versions must be plainly marked as such, and must not be
  +   misrepresented as being the original software.
   
  -    * Neither the name of the University of Cambridge nor the name of Google
  -      Inc. nor the names of their contributors may be used to endorse or
  -      promote products derived from this software without specific prior
  -      written permission.
  +4. If PCRE is embedded in any software that is released under the GNU
  +   General Purpose Licence (GPL), or Lesser General Purpose Licence (LGPL),
  +   then the terms of that licence shall supersede any condition above with
  +   which it is incompatible.
   
  -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  -POSSIBILITY OF SUCH DAMAGE.
  +The documentation for PCRE, supplied in the "doc" directory, is distributed
  +under the same terms as the software itself.
   
   End
  
  
  
  1.3       +28 -46    JavaScriptCore/pcre/LICENCE
  
  Index: LICENCE
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/pcre/LICENCE,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LICENCE	12 Aug 2005 22:13:26 -0000	1.2
  +++ LICENCE	12 Aug 2005 22:18:08 -0000	1.3
  @@ -4,65 +4,47 @@
   PCRE is a library of functions to support regular expressions whose syntax
   and semantics are as close as possible to those of the Perl 5 language.
   
  -Release 6 of PCRE is distributed under the terms of the "BSD" licence, as
  -specified below. The documentation for PCRE, supplied in the "doc"
  -directory, is distributed under the same terms as the software itself.
  -
  -The basic library functions are written in C and are freestanding. Also
  -included in the distribution is a set of C++ wrapper functions.
  -
  -
  -THE BASIC LIBRARY FUNCTIONS
  ----------------------------
  -
  -Written by:       Philip Hazel
  -Email local part: ph10
  -Email domain:     cam.ac.uk
  +Written by: Philip Hazel <ph10 at cam.ac.uk>
   
   University of Cambridge Computing Service,
   Cambridge, England. Phone: +44 1223 334714.
   
  -Copyright (c) 1997-2005 University of Cambridge
  -All rights reserved.
  -
  +Copyright (c) 1997-2001 University of Cambridge
   
  -THE C++ WRAPPER FUNCTIONS
  --------------------------
  +Permission is granted to anyone to use this software for any purpose on any
  +computer system, and to redistribute it freely, subject to the following
  +restrictions:
   
  -Contributed by:   Google Inc.
  +1. This software is distributed in the hope that it will be useful,
  +   but WITHOUT ANY WARRANTY; without even the implied warranty of
  +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   
  -Copyright (c) 2005, Google Inc.
  -All rights reserved.
  +2. The origin of this software must not be misrepresented, either by
  +   explicit claim or by omission. In practice, this means that if you use
  +   PCRE in software which you distribute to others, commercially or
  +   otherwise, you must put a sentence like this
   
  +     Regular expression support is provided by the PCRE library package,
  +     which is open source software, written by Philip Hazel, and copyright
  +     by the University of Cambridge, England.
   
  -THE "BSD" LICENCE
  ------------------
  +   somewhere reasonably visible in your documentation and in any relevant
  +   files or online help data or similar. A reference to the ftp site for
  +   the source, that is, to
   
  -Redistribution and use in source and binary forms, with or without
  -modification, are permitted provided that the following conditions are met:
  +     ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
   
  -    * Redistributions of source code must retain the above copyright notice,
  -      this list of conditions and the following disclaimer.
  +   should also be given in the documentation.
   
  -    * Redistributions in binary form must reproduce the above copyright
  -      notice, this list of conditions and the following disclaimer in the
  -      documentation and/or other materials provided with the distribution.
  +3. Altered versions must be plainly marked as such, and must not be
  +   misrepresented as being the original software.
   
  -    * Neither the name of the University of Cambridge nor the name of Google
  -      Inc. nor the names of their contributors may be used to endorse or
  -      promote products derived from this software without specific prior
  -      written permission.
  +4. If PCRE is embedded in any software that is released under the GNU
  +   General Purpose Licence (GPL), or Lesser General Purpose Licence (LGPL),
  +   then the terms of that licence shall supersede any condition above with
  +   which it is incompatible.
   
  -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  -POSSIBILITY OF SUCH DAMAGE.
  +The documentation for PCRE, supplied in the "doc" directory, is distributed
  +under the same terms as the software itself.
   
   End
  
  
  
  1.4       +78 -100   JavaScriptCore/pcre/dftables.c
  
  Index: dftables.c
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/pcre/dftables.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- dftables.c	12 Aug 2005 22:13:26 -0000	1.3
  +++ dftables.c	12 Aug 2005 22:18:08 -0000	1.4
  @@ -1,136 +1,116 @@
   /*************************************************
   *      Perl-Compatible Regular Expressions       *
  +*  extended to UTF-16 for use in JavaScriptCore  *
   *************************************************/
   
  -/* PCRE is a library of functions to support regular expressions whose syntax
  +/*
  +PCRE is a library of functions to support regular expressions whose syntax
   and semantics are as close as possible to those of the Perl 5 language.
   
  -                       Written by Philip Hazel
  -           Copyright (c) 1997-2005 University of Cambridge
  +Written by: Philip Hazel <ph10 at cam.ac.uk>
   
  ------------------------------------------------------------------------------
  -Redistribution and use in source and binary forms, with or without
  -modification, are permitted provided that the following conditions are met:
  -
  -    * Redistributions of source code must retain the above copyright notice,
  -      this list of conditions and the following disclaimer.
  +           Copyright (c) 1997-2001 University of Cambridge
  +           Copyright (C) 2004 Apple Computer, Inc.
   
  -    * Redistributions in binary form must reproduce the above copyright
  -      notice, this list of conditions and the following disclaimer in the
  -      documentation and/or other materials provided with the distribution.
  -
  -    * Neither the name of the University of Cambridge nor the names of its
  -      contributors may be used to endorse or promote products derived from
  -      this software without specific prior written permission.
  -
  -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  -POSSIBILITY OF SUCH DAMAGE.
   -----------------------------------------------------------------------------
  +Permission is granted to anyone to use this software for any purpose on any
  +computer system, and to redistribute it freely, subject to the following
  +restrictions:
  +
  +1. This software is distributed in the hope that it will be useful,
  +   but WITHOUT ANY WARRANTY; without even the implied warranty of
  +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  +
  +2. The origin of this software must not be misrepresented, either by
  +   explicit claim or by omission.
  +
  +3. Altered versions must be plainly marked as such, and must not be
  +   misrepresented as being the original software.
  +
  +4. If PCRE is embedded in any software that is released under the GNU
  +   General Purpose Licence (GPL), then the terms of that licence shall
  +   supersede any condition above with which it is incompatible.
  +-----------------------------------------------------------------------------
  +
  +See the file Tech.Notes for some information on the internals.
   */
   
   
  -/* This is a freestanding support program to generate a file containing default
  -character tables for PCRE. The tables are built according to the default C
  -locale. Now that pcre_maketables is a function visible to the outside world, we
  -make use of its code from here in order to be consistent. */
  +/* This is a support program to generate the file chartables.c, containing
  +character tables of various kinds. They are built according to the default C
  +locale and used as the default tables by PCRE. Now that pcre_maketables is
  +a function visible to the outside world, we make use of its code from here in
  +order to be consistent. */
   
   #include <ctype.h>
   #include <stdio.h>
   #include <string.h>
   
  -#include "pcre_internal.h"
  +#include "internal.h"
   
  -#define DFTABLES          /* pcre_maketables.c notices this */
  -#include "pcre_maketables.c"
  +#define DFTABLES          /* maketables.c notices this */
  +#include "maketables.c"
   
   
  -int main(int argc, char **argv)
  +int main(void)
   {
   int i;
  -FILE *f;
   const unsigned char *tables = pcre_maketables();
  -const unsigned char *base_of_tables = tables;
  -
  -if (argc != 2)
  -  {
  -  fprintf(stderr, "dftables: one filename argument is required\n");
  -  return 1;
  -  }
  -
  -f = fopen(argv[1], "w");
  -if (f == NULL)
  -  {
  -  fprintf(stderr, "dftables: failed to open %s for writing\n", argv[1]);
  -  return 1;
  -  }
  -
  -/* There are two fprintf() calls here, because gcc in pedantic mode complains
  -about the very long string otherwise. */
   
  -fprintf(f,
  +printf(
     "/*************************************************\n"
     "*      Perl-Compatible Regular Expressions       *\n"
     "*************************************************/\n\n"
     "/* This file is automatically written by the dftables auxiliary \n"
     "program. If you edit it by hand, you might like to edit the Makefile to \n"
  -  "prevent its ever being regenerated.\n\n");
  -fprintf(f,
  -  "This file contains the default tables for characters with codes less than\n"
  -  "128 (ASCII characters). These tables are used when no external tables are\n"
  -  "passed to PCRE. */\n\n"
  -  "const unsigned char _pcre_default_tables[] = {\n\n"
  +  "prevent its ever being regenerated.\n\n"
  +  "This file is #included in the compilation of pcre.c to build the default\n"
  +  "character tables which are used when no tables are passed to the compile\n"
  +  "function. */\n\n"
  +  "static const unsigned char pcre_default_tables[] = {\n\n"
     "/* This table is a lower casing table. */\n\n");
   
  -fprintf(f, "  ");
  -for (i = 0; i < 256; i++)
  +printf("  ");
  +for (i = 0; i < (int)ICHAR_MAP_SIZE; i++)
     {
  -  if ((i & 7) == 0 && i != 0) fprintf(f, "\n  ");
  -  fprintf(f, "%3d", *tables++);
  -  if (i != 255) fprintf(f, ",");
  +  if ((i & 7) == 0 && i != 0) printf("\n  ");
  +  printf("%3d", *tables++);
  +  if (i != ICHAR_MAP_SIZE - 1) printf(",");
     }
  -fprintf(f, ",\n\n");
  +printf(",\n\n");
   
  -fprintf(f, "/* This table is a case flipping table. */\n\n");
  +printf("/* This table is a case flipping table. */\n\n");
   
  -fprintf(f, "  ");
  -for (i = 0; i < 256; i++)
  +printf("  ");
  +for (i = 0; i < (int)ICHAR_MAP_SIZE; i++)
     {
  -  if ((i & 7) == 0 && i != 0) fprintf(f, "\n  ");
  -  fprintf(f, "%3d", *tables++);
  -  if (i != 255) fprintf(f, ",");
  +  if ((i & 7) == 0 && i != 0) printf("\n  ");
  +  printf("%3d", *tables++);
  +  if (i != ICHAR_MAP_SIZE - 1) printf(",");
     }
  -fprintf(f, ",\n\n");
  +printf(",\n\n");
   
  -fprintf(f,
  +printf(
     "/* This table contains bit maps for various character classes.\n"
     "Each map is 32 bytes long and the bits run from the least\n"
     "significant end of each byte. The classes that have their own\n"
     "maps are: space, xdigit, digit, upper, lower, word, graph\n"
     "print, punct, and cntrl. Other classes are built from combinations. */\n\n");
   
  -fprintf(f, "  ");
  +printf("  ");
   for (i = 0; i < cbit_length; i++)
     {
     if ((i & 7) == 0 && i != 0)
       {
  -    if ((i & 31) == 0) fprintf(f, "\n");
  -    fprintf(f, "\n  ");
  +    if ((i & 31) == 0) printf("\n");
  +    printf("\n  ");
       }
  -  fprintf(f, "0x%02x", *tables++);
  -  if (i != cbit_length - 1) fprintf(f, ",");
  +  printf("0x%02x", *tables++);
  +  if (i != cbit_length - 1) printf(",");
     }
  -fprintf(f, ",\n\n");
  +printf(",\n\n");
   
  -fprintf(f,
  +printf(
     "/* This table identifies various classes of character by individual bits:\n"
     "  0x%02x   white space character\n"
     "  0x%02x   letter\n"
  @@ -141,31 +121,29 @@
     ctype_space, ctype_letter, ctype_digit, ctype_xdigit, ctype_word,
     ctype_meta);
   
  -fprintf(f, "  ");
  -for (i = 0; i < 256; i++)
  +printf("  ");
  +for (i = 0; i < ICHAR_COUNT; i++)
     {
     if ((i & 7) == 0 && i != 0)
       {
  -    fprintf(f, " /* ");
  -    if (isprint(i-8)) fprintf(f, " %c -", i-8);
  -      else fprintf(f, "%3d-", i-8);
  -    if (isprint(i-1)) fprintf(f, " %c ", i-1);
  -      else fprintf(f, "%3d", i-1);
  -    fprintf(f, " */\n  ");
  +    printf(" /* ");
  +    if (isprint(i-8)) printf(" %c -", i-8);
  +      else printf("%3d-", i-8);
  +    if (isprint(i-1)) printf(" %c ", i-1);
  +      else printf("%3d", i-1);
  +    printf(" */\n  ");
       }
  -  fprintf(f, "0x%02x", *tables++);
  -  if (i != 255) fprintf(f, ",");
  +  printf("0x%02x", *tables++);
  +  if (i != ICHAR_COUNT - 1) printf(",");
     }
   
  -fprintf(f, "};/* ");
  -if (isprint(i-8)) fprintf(f, " %c -", i-8);
  -  else fprintf(f, "%3d-", i-8);
  -if (isprint(i-1)) fprintf(f, " %c ", i-1);
  -  else fprintf(f, "%3d", i-1);
  -fprintf(f, " */\n\n/* End of chartables.c */\n");
  +printf("};/* ");
  +if (isprint(i-8)) printf(" %c -", i-8);
  +  else printf("%3d-", i-8);
  +if (isprint(i-1)) printf(" %c ", i-1);
  +  else printf("%3d", i-1);
  +printf(" */\n\n/* End of chartables.c */\n");
   
  -fclose(f);
  -free((void *)base_of_tables);
   return 0;
   }
   
  
  
  
  1.5       +88 -222   JavaScriptCore/pcre/pcre.h
  
  Index: pcre.h
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/pcre/pcre.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- pcre.h	12 Aug 2005 22:13:26 -0000	1.4
  +++ pcre.h	12 Aug 2005 22:18:08 -0000	1.5
  @@ -1,74 +1,34 @@
   /*************************************************
   *       Perl-Compatible Regular Expressions      *
  +*  extended to UTF-16 for use in JavaScriptCore  *
   *************************************************/
   
  -/* In its original form, this is the .in file that is transformed by
  -"configure" into pcre.h.
  -
  -           Copyright (c) 1997-2005 University of Cambridge
  -
  ------------------------------------------------------------------------------
  -Redistribution and use in source and binary forms, with or without
  -modification, are permitted provided that the following conditions are met:
  -
  -    * Redistributions of source code must retain the above copyright notice,
  -      this list of conditions and the following disclaimer.
  -
  -    * Redistributions in binary form must reproduce the above copyright
  -      notice, this list of conditions and the following disclaimer in the
  -      documentation and/or other materials provided with the distribution.
  -
  -    * Neither the name of the University of Cambridge nor the names of its
  -      contributors may be used to endorse or promote products derived from
  -      this software without specific prior written permission.
  -
  -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  -POSSIBILITY OF SUCH DAMAGE.
  ------------------------------------------------------------------------------
  -*/
  +/* Copyright (c) 1997-2001 University of Cambridge */
  +/* Copyright (C) 2004 Apple Computer, Inc. */
   
   #ifndef _PCRE_H
   #define _PCRE_H
   
  -/* The file pcre.h is build by "configure". Do not edit it; instead
  -make changes to pcre.in. */
  -
  -#define PCRE_MAJOR          @PCRE_MAJOR@
  -#define PCRE_MINOR          @PCRE_MINOR@
  -#define PCRE_DATE           @PCRE_DATE@
  -
  -/* Win32 uses DLL by default; it needs special stuff for exported functions. */
  -
  -#ifdef _WIN32
  -#  ifdef PCRE_DEFINITION
  -#    ifdef DLL_EXPORT
  -#      define PCRE_DATA_SCOPE __declspec(dllexport)
  -#    endif
  -#  else
  -#    ifndef PCRE_STATIC
  -#      define PCRE_DATA_SCOPE extern __declspec(dllimport)
  -#    endif
  -#  endif
  -#endif
  -
  -/* For other operating systems, we use the standard "extern". */
  -
  -#ifndef PCRE_DATA_SCOPE
  -#  ifdef __cplusplus
  -#    define PCRE_DATA_SCOPE     extern "C"
  -#  else
  -#    define PCRE_DATA_SCOPE     extern
  -#  endif
  -#endif
  +#define pcre_compile kjs_pcre_compile
  +#define pcre_copy_substring kjs_pcre_copy_substring
  +#define pcre_exec kjs_pcre_exec
  +#define pcre_free kjs_pcre_free
  +#define pcre_free_substring kjs_pcre_free_substring
  +#define pcre_free_substring_list kjs_pcre_free_substring_list
  +#define pcre_fullinfo kjs_pcre_fullinfo
  +#define pcre_get_substring kjs_pcre_get_substring
  +#define pcre_get_substring_list kjs_pcre_get_substring_list
  +#define pcre_info kjs_pcre_info
  +#define pcre_maketables kjs_pcre_maketables
  +#define pcre_malloc kjs_pcre_malloc
  +#define pcre_study kjs_pcre_study
  +#define pcre_version kjs_pcre_version
  +
  +#define PCRE_MAJOR 3
  +#define PCRE_MINOR 9
  +#define PCRE_DATE 02-Jan-2002
  +#define PCRE_DL_IMPORT
  +#define PCRE_UTF16 1
   
   /* Have to include stdlib.h in order to ensure that size_t is defined;
   it is needed here for malloc. */
  @@ -83,173 +43,79 @@
   
   /* Options */
   
  -#define PCRE_CASELESS           0x00000001
  -#define PCRE_MULTILINE          0x00000002
  -#define PCRE_DOTALL             0x00000004
  -#define PCRE_EXTENDED           0x00000008
  -#define PCRE_ANCHORED           0x00000010
  -#define PCRE_DOLLAR_ENDONLY     0x00000020
  -#define PCRE_EXTRA              0x00000040
  -#define PCRE_NOTBOL             0x00000080
  -#define PCRE_NOTEOL             0x00000100
  -#define PCRE_UNGREEDY           0x00000200
  -#define PCRE_NOTEMPTY           0x00000400
  -#define PCRE_UTF8               0x00000800
  -#define PCRE_NO_AUTO_CAPTURE    0x00001000
  -#define PCRE_NO_UTF8_CHECK      0x00002000
  -#define PCRE_AUTO_CALLOUT       0x00004000
  -#define PCRE_PARTIAL            0x00008000
  -#define PCRE_DFA_SHORTEST       0x00010000
  -#define PCRE_DFA_RESTART        0x00020000
  -#define PCRE_FIRSTLINE          0x00040000
  -
  -/* Exec-time and get/set-time error codes */
  -
  -#define PCRE_ERROR_NOMATCH         (-1)
  -#define PCRE_ERROR_NULL            (-2)
  -#define PCRE_ERROR_BADOPTION       (-3)
  -#define PCRE_ERROR_BADMAGIC        (-4)
  -#define PCRE_ERROR_UNKNOWN_NODE    (-5)
  -#define PCRE_ERROR_NOMEMORY        (-6)
  -#define PCRE_ERROR_NOSUBSTRING     (-7)
  -#define PCRE_ERROR_MATCHLIMIT      (-8)
  -#define PCRE_ERROR_CALLOUT         (-9)  /* Never used by PCRE itself */
  -#define PCRE_ERROR_BADUTF8        (-10)
  -#define PCRE_ERROR_BADUTF8_OFFSET (-11)
  -#define PCRE_ERROR_PARTIAL        (-12)
  -#define PCRE_ERROR_BADPARTIAL     (-13)
  -#define PCRE_ERROR_INTERNAL       (-14)
  -#define PCRE_ERROR_BADCOUNT       (-15)
  -#define PCRE_ERROR_DFA_UITEM      (-16)
  -#define PCRE_ERROR_DFA_UCOND      (-17)
  -#define PCRE_ERROR_DFA_UMLIMIT    (-18)
  -#define PCRE_ERROR_DFA_WSSIZE     (-19)
  -#define PCRE_ERROR_DFA_RECURSE    (-20)
  +#define PCRE_CASELESS        0x0001
  +#define PCRE_MULTILINE       0x0002
  +#define PCRE_DOTALL          0x0004
  +#define PCRE_EXTENDED        0x0008
  +#define PCRE_ANCHORED        0x0010
  +#define PCRE_DOLLAR_ENDONLY  0x0020
  +#define PCRE_EXTRA           0x0040
  +#define PCRE_NOTBOL          0x0080
  +#define PCRE_NOTEOL          0x0100
  +#define PCRE_UNGREEDY        0x0200
  +#define PCRE_NOTEMPTY        0x0400
  +#define PCRE_UTF8            0x0800
  +
  +/* Exec-time and get-time error codes */
  +
  +#define PCRE_ERROR_NOMATCH        (-1)
  +#define PCRE_ERROR_NULL           (-2)
  +#define PCRE_ERROR_BADOPTION      (-3)
  +#define PCRE_ERROR_BADMAGIC       (-4)
  +#define PCRE_ERROR_UNKNOWN_NODE   (-5)
  +#define PCRE_ERROR_NOMEMORY       (-6)
  +#define PCRE_ERROR_NOSUBSTRING    (-7)
   
   /* Request types for pcre_fullinfo() */
   
  -#define PCRE_INFO_OPTIONS            0
  -#define PCRE_INFO_SIZE               1
  -#define PCRE_INFO_CAPTURECOUNT       2
  -#define PCRE_INFO_BACKREFMAX         3
  -#define PCRE_INFO_FIRSTBYTE          4
  -#define PCRE_INFO_FIRSTCHAR          4  /* For backwards compatibility */
  -#define PCRE_INFO_FIRSTTABLE         5
  -#define PCRE_INFO_LASTLITERAL        6
  -#define PCRE_INFO_NAMEENTRYSIZE      7
  -#define PCRE_INFO_NAMECOUNT          8
  -#define PCRE_INFO_NAMETABLE          9
  -#define PCRE_INFO_STUDYSIZE         10
  -#define PCRE_INFO_DEFAULT_TABLES    11
  -
  -/* Request types for pcre_config() */
  -
  -#define PCRE_CONFIG_UTF8                    0
  -#define PCRE_CONFIG_NEWLINE                 1
  -#define PCRE_CONFIG_LINK_SIZE               2
  -#define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD  3
  -#define PCRE_CONFIG_MATCH_LIMIT             4
  -#define PCRE_CONFIG_STACKRECURSE            5
  -#define PCRE_CONFIG_UNICODE_PROPERTIES      6
  -
  -/* Bit flags for the pcre_extra structure */
  -
  -#define PCRE_EXTRA_STUDY_DATA          0x0001
  -#define PCRE_EXTRA_MATCH_LIMIT         0x0002
  -#define PCRE_EXTRA_CALLOUT_DATA        0x0004
  -#define PCRE_EXTRA_TABLES              0x0008
  +#define PCRE_INFO_OPTIONS         0
  +#define PCRE_INFO_SIZE            1
  +#define PCRE_INFO_CAPTURECOUNT    2
  +#define PCRE_INFO_BACKREFMAX      3
  +#define PCRE_INFO_FIRSTCHAR       4
  +#define PCRE_INFO_FIRSTTABLE      5
  +#define PCRE_INFO_LASTLITERAL     6
   
   /* Types */
   
  -struct real_pcre;                 /* declaration; the definition is private  */
  +struct real_pcre;        /* declaration; the definition is private  */
  +struct real_pcre_extra;  /* declaration; the definition is private */
  +
   typedef struct real_pcre pcre;
  +typedef struct real_pcre_extra pcre_extra;
  +
  +#if PCRE_UTF16
  +#include <stdint.h>
  +typedef uint16_t pcre_char;
  +#else
  +typedef char pcre_char;
  +#endif
   
  -/* The structure for passing additional data to pcre_exec(). This is defined in
  -such as way as to be extensible. Always add new fields at the end, in order to
  -remain compatible. */
  -
  -typedef struct pcre_extra {
  -  unsigned long int flags;        /* Bits for which fields are set */
  -  void *study_data;               /* Opaque data from pcre_study() */
  -  unsigned long int match_limit;  /* Maximum number of calls to match() */
  -  void *callout_data;             /* Data passed back in callouts */
  -  const unsigned char *tables;    /* Pointer to character tables */
  -} pcre_extra;
  -
  -/* The structure for passing out data via the pcre_callout_function. We use a
  -structure so that new fields can be added on the end in future versions,
  -without changing the API of the function, thereby allowing old clients to work
  -without modification. */
  -
  -typedef struct pcre_callout_block {
  -  int          version;           /* Identifies version of block */
  -  /* ------------------------ Version 0 ------------------------------- */
  -  int          callout_number;    /* Number compiled into pattern */
  -  int         *offset_vector;     /* The offset vector */
  -  const char  *subject;           /* The subject being matched */
  -  int          subject_length;    /* The length of the subject */
  -  int          start_match;       /* Offset to start of this match attempt */
  -  int          current_position;  /* Where we currently are in the subject */
  -  int          capture_top;       /* Max current capture */
  -  int          capture_last;      /* Most recently closed capture */
  -  void        *callout_data;      /* Data passed in with the call */
  -  /* ------------------- Added for Version 1 -------------------------- */
  -  int          pattern_position;  /* Offset to next item in the pattern */
  -  int          next_item_length;  /* Length of next item in the pattern */
  -  /* ------------------------------------------------------------------ */
  -} pcre_callout_block;
  -
  -/* Indirection for store get and free functions. These can be set to
  -alternative malloc/free functions if required. Special ones are used in the
  -non-recursive case for "frames". There is also an optional callout function
  -that is triggered by the (?) regex item. For Virtual Pascal, these definitions
  -have to take another form. */
  -
  -#ifndef VPCOMPAT
  -PCRE_DATA_SCOPE void *(*pcre_malloc)(size_t);
  -PCRE_DATA_SCOPE void  (*pcre_free)(void *);
  -PCRE_DATA_SCOPE void *(*pcre_stack_malloc)(size_t);
  -PCRE_DATA_SCOPE void  (*pcre_stack_free)(void *);
  -PCRE_DATA_SCOPE int   (*pcre_callout)(pcre_callout_block *);
  -#else   /* VPCOMPAT */
  -PCRE_DATA_SCOPE void *pcre_malloc(size_t);
  -PCRE_DATA_SCOPE void  pcre_free(void *);
  -PCRE_DATA_SCOPE void *pcre_stack_malloc(size_t);
  -PCRE_DATA_SCOPE void  pcre_stack_free(void *);
  -PCRE_DATA_SCOPE int   pcre_callout(pcre_callout_block *);
  -#endif  /* VPCOMPAT */
  -
  -/* Exported PCRE functions */
  -
  -PCRE_DATA_SCOPE pcre *pcre_compile(const char *, int, const char **, int *,
  -                  const unsigned char *);
  -PCRE_DATA_SCOPE pcre *pcre_compile2(const char *, int, int *, const char **,
  -                  int *, const unsigned char *);
  -PCRE_DATA_SCOPE int  pcre_config(int, void *);
  -PCRE_DATA_SCOPE int  pcre_copy_named_substring(const pcre *, const char *,
  -                  int *, int, const char *, char *, int);
  -PCRE_DATA_SCOPE int  pcre_copy_substring(const char *, int *, int, int, char *,
  -                  int);
  -PCRE_DATA_SCOPE int  pcre_dfa_exec(const pcre *, const pcre_extra *,
  -                  const char *, int, int, int, int *, int , int *, int);
  -PCRE_DATA_SCOPE int  pcre_exec(const pcre *, const pcre_extra *, const char *,
  -                   int, int, int, int *, int);
  -PCRE_DATA_SCOPE void pcre_free_substring(const char *);
  -PCRE_DATA_SCOPE void pcre_free_substring_list(const char **);
  -PCRE_DATA_SCOPE int  pcre_fullinfo(const pcre *, const pcre_extra *, int,
  -                  void *);
  -PCRE_DATA_SCOPE int  pcre_get_named_substring(const pcre *, const char *,
  -                  int *, int, const char *, const char **);
  -PCRE_DATA_SCOPE int  pcre_get_stringnumber(const pcre *, const char *);
  -PCRE_DATA_SCOPE int  pcre_get_substring(const char *, int *, int, int,
  -                  const char **);
  -PCRE_DATA_SCOPE int  pcre_get_substring_list(const char *, int *, int,
  -                  const char ***);
  -PCRE_DATA_SCOPE int  pcre_info(const pcre *, int *, int *);
  -PCRE_DATA_SCOPE const unsigned char *pcre_maketables(void);
  -PCRE_DATA_SCOPE int  pcre_refcount(pcre *, int);
  -PCRE_DATA_SCOPE pcre_extra *pcre_study(const pcre *, int, const char **);
  -PCRE_DATA_SCOPE const char *pcre_version(void);
  +/* Store get and free functions. These can be set to alternative malloc/free
  +functions if required. Some magic is required for Win32 DLL; it is null on
  +other OS. */
  +
  +PCRE_DL_IMPORT extern void *(*pcre_malloc)(size_t);
  +PCRE_DL_IMPORT extern void  (*pcre_free)(void *);
  +
  +#undef PCRE_DL_IMPORT
  +
  +/* Functions */
  +
  +extern pcre *pcre_compile(const pcre_char *, int, const char **, int *,
  +              const unsigned char *);
  +extern int  pcre_copy_substring(const pcre_char *, int *, int, int, pcre_char *, int);
  +extern int  pcre_exec(const pcre *, const pcre_extra *, const pcre_char *,
  +              int, int, int, int *, int);
  +extern void pcre_free_substring(const pcre_char *);
  +extern void pcre_free_substring_list(const pcre_char **);
  +extern int  pcre_get_substring(const pcre_char *, int *, int, int, const pcre_char **);
  +extern int  pcre_get_substring_list(const pcre_char *, int *, int, const pcre_char ***);
  +extern int  pcre_info(const pcre *, int *, int *);
  +extern int  pcre_fullinfo(const pcre *, const pcre_extra *, int, void *);
  +extern const unsigned char *pcre_maketables(void);
  +extern pcre_extra *pcre_study(const pcre *, int, const char **);
  +extern const char *pcre_version(void);
   
   #ifdef __cplusplus
   }  /* extern "C" */
  
  
  
  1.5       +0 -0      JavaScriptCore/pcre/get.c
  
  
  
  
  1.5       +0 -0      JavaScriptCore/pcre/internal.h
  
  
  
  
  1.5       +0 -0      JavaScriptCore/pcre/maketables.c
  
  
  
  
  1.7       +0 -0      JavaScriptCore/pcre/pcre.c
  
  
  
  
  1.4       +0 -0      JavaScriptCore/pcre/study.c
  
  
  
  



More information about the webkit-changes mailing list