/[pcre]/code/trunk/pcre_maketables.c
ViewVC logotype

Diff of /code/trunk/pcre_maketables.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 117 by ph10, Fri Mar 9 15:59:06 2007 UTC revision 1055 by chpe, Tue Oct 16 15:53:30 2012 UTC
# Line 6  Line 6 
6  and semantics are as close as possible to those of the Perl 5 language.  and semantics are as close as possible to those of the Perl 5 language.
7    
8                         Written by Philip Hazel                         Written by Philip Hazel
9             Copyright (c) 1997-2007 University of Cambridge             Copyright (c) 1997-2012 University of Cambridge
10    
11  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
12  Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
# Line 45  compilation of dftables.c, in which case Line 45  compilation of dftables.c, in which case
45    
46    
47  #ifndef DFTABLES  #ifndef DFTABLES
48  #include "pcre_internal.h"  #  ifdef HAVE_CONFIG_H
49    #  include "config.h"
50    #  endif
51    #  include "pcre_internal.h"
52  #endif  #endif
53    
54    
# Line 56  compilation of dftables.c, in which case Line 59  compilation of dftables.c, in which case
59  /* This function builds a set of character tables for use by PCRE and returns  /* This function builds a set of character tables for use by PCRE and returns
60  a pointer to them. They are build using the ctype functions, and consequently  a pointer to them. They are build using the ctype functions, and consequently
61  their contents will depend upon the current locale setting. When compiled as  their contents will depend upon the current locale setting. When compiled as
62  part of the library, the store is obtained via pcre_malloc(), but when compiled  part of the library, the store is obtained via PUBL(malloc)(), but when
63  inside dftables, use malloc().  compiled inside dftables, use malloc().
64    
65  Arguments:   none  Arguments:   none
66  Returns:     pointer to the contiguous block of data  Returns:     pointer to the contiguous block of data
67  */  */
68    
69    #if defined COMPILE_PCRE8
70  const unsigned char *  const unsigned char *
71  pcre_maketables(void)  pcre_maketables(void)
72    #elif defined COMPILE_PCRE16
73    const unsigned char *
74    pcre16_maketables(void)
75    #elif defined COMPILE_PCRE32
76    const unsigned char *
77    pcre32_maketables(void)
78    #endif
79  {  {
80  unsigned char *yield, *p;  unsigned char *yield, *p;
81  int i;  int i;
82    
83  #ifndef DFTABLES  #ifndef DFTABLES
84  yield = (unsigned char*)(pcre_malloc)(tables_length);  yield = (unsigned char*)(PUBL(malloc))(tables_length);
85  #else  #else
86  yield = (unsigned char*)malloc(tables_length);  yield = (unsigned char*)malloc(tables_length);
87  #endif  #endif
# Line 119  within regexes. */ Line 130  within regexes. */
130  for (i = 0; i < 256; i++)  for (i = 0; i < 256; i++)
131    {    {
132    int x = 0;    int x = 0;
133    if (i != 0x0b && isspace(i)) x += ctype_space;    if (i != CHAR_VT && isspace(i)) x += ctype_space;
134    if (isalpha(i)) x += ctype_letter;    if (isalpha(i)) x += ctype_letter;
135    if (isdigit(i)) x += ctype_digit;    if (isdigit(i)) x += ctype_digit;
136    if (isxdigit(i)) x += ctype_xdigit;    if (isxdigit(i)) x += ctype_xdigit;

Legend:
Removed from v.117  
changed lines
  Added in v.1055

  ViewVC Help
Powered by ViewVC 1.1.5