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

Diff of /code/trunk/maketables.c

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

revision 53 by nigel, Sat Feb 24 21:39:42 2007 UTC revision 63 by nigel, Sat Feb 24 21:40:03 2007 UTC
# Line 8  and semantics are as close as possible t Line 8  and semantics are as close as possible t
8    
9  Written by: Philip Hazel <ph10@cam.ac.uk>  Written by: Philip Hazel <ph10@cam.ac.uk>
10    
11             Copyright (c) 1997-2001 University of Cambridge             Copyright (c) 1997-2003 University of Cambridge
12    
13  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
14  Permission is granted to anyone to use this software for any purpose on any  Permission is granted to anyone to use this software for any purpose on any
# Line 82  for (i = 0; i < 256; i++) *p++ = tolower Line 82  for (i = 0; i < 256; i++) *p++ = tolower
82  for (i = 0; i < 256; i++) *p++ = islower(i)? toupper(i) : tolower(i);  for (i = 0; i < 256; i++) *p++ = islower(i)? toupper(i) : tolower(i);
83    
84  /* Then the character class tables. Don't try to be clever and save effort  /* Then the character class tables. Don't try to be clever and save effort
85  on exclusive ones - in some locales things may be different. */  on exclusive ones - in some locales things may be different. Note that the
86    table for "space" includes everything "isspace" gives, including VT in the
87    default locale. This makes it work for the POSIX class [:space:]. */
88    
89  memset(p, 0, cbit_length);  memset(p, 0, cbit_length);
90  for (i = 0; i < 256; i++)  for (i = 0; i < 256; i++)
# Line 112  for (i = 0; i < 256; i++) Line 114  for (i = 0; i < 256; i++)
114    }    }
115  p += cbit_length;  p += cbit_length;
116    
117  /* Finally, the character type table */  /* Finally, the character type table. In this, we exclude VT from the white
118    space chars, because Perl doesn't recognize it as such for \s and for comments
119    within regexes. */
120    
121  for (i = 0; i < 256; i++)  for (i = 0; i < 256; i++)
122    {    {
123    int x = 0;    int x = 0;
124    if (isspace(i)) x += ctype_space;    if (i != 0x0b && isspace(i)) x += ctype_space;
125    if (isalpha(i)) x += ctype_letter;    if (isalpha(i)) x += ctype_letter;
126    if (isdigit(i)) x += ctype_digit;    if (isdigit(i)) x += ctype_digit;
127    if (isxdigit(i)) x += ctype_xdigit;    if (isxdigit(i)) x += ctype_xdigit;

Legend:
Removed from v.53  
changed lines
  Added in v.63

  ViewVC Help
Powered by ViewVC 1.1.5