/[pcre]/code/trunk/pcre_internal.h
ViewVC logotype

Diff of /code/trunk/pcre_internal.h

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

revision 1523 by ph10, Sun Feb 8 18:00:45 2015 UTC revision 1688 by ph10, Fri Feb 24 17:30:30 2017 UTC
# Line 7  Line 7 
7  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.
8    
9                         Written by Philip Hazel                         Written by Philip Hazel
10             Copyright (c) 1997-2014 University of Cambridge             Copyright (c) 1997-2016 University of Cambridge
11    
12  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
13  Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
# Line 275  pcre.h(.in) and disable (comment out) th Line 275  pcre.h(.in) and disable (comment out) th
275    
276  typedef pcre_uint16 pcre_uchar;  typedef pcre_uint16 pcre_uchar;
277  #define UCHAR_SHIFT (1)  #define UCHAR_SHIFT (1)
278  #define IN_UCHARS(x) ((x) << UCHAR_SHIFT)  #define IN_UCHARS(x) ((x) * 2)
279  #define MAX_255(c) ((c) <= 255u)  #define MAX_255(c) ((c) <= 255u)
280  #define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default))  #define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default))
281    
# Line 283  typedef pcre_uint16 pcre_uchar; Line 283  typedef pcre_uint16 pcre_uchar;
283    
284  typedef pcre_uint32 pcre_uchar;  typedef pcre_uint32 pcre_uchar;
285  #define UCHAR_SHIFT (2)  #define UCHAR_SHIFT (2)
286  #define IN_UCHARS(x) ((x) << UCHAR_SHIFT)  #define IN_UCHARS(x) ((x) * 4)
287  #define MAX_255(c) ((c) <= 255u)  #define MAX_255(c) ((c) <= 255u)
288  #define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default))  #define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default))
289    
# Line 984  other. NOTE: The values also appear in p Line 984  other. NOTE: The values also appear in p
984  #ifndef EBCDIC  #ifndef EBCDIC
985    
986  #define HSPACE_LIST \  #define HSPACE_LIST \
987    CHAR_HT, CHAR_SPACE, 0xa0, \    CHAR_HT, CHAR_SPACE, CHAR_NBSP, \
988    0x1680, 0x180e, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, \    0x1680, 0x180e, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, \
989    0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202f, 0x205f, 0x3000, \    0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202f, 0x205f, 0x3000, \
990    NOTACHAR    NOTACHAR
# Line 1010  other. NOTE: The values also appear in p Line 1010  other. NOTE: The values also appear in p
1010  #define HSPACE_BYTE_CASES \  #define HSPACE_BYTE_CASES \
1011    case CHAR_HT: \    case CHAR_HT: \
1012    case CHAR_SPACE: \    case CHAR_SPACE: \
1013    case 0xa0     /* NBSP */    case CHAR_NBSP
1014    
1015  #define HSPACE_CASES \  #define HSPACE_CASES \
1016    HSPACE_BYTE_CASES: \    HSPACE_BYTE_CASES: \
# Line 1037  other. NOTE: The values also appear in p Line 1037  other. NOTE: The values also appear in p
1037  /* ------ EBCDIC environments ------ */  /* ------ EBCDIC environments ------ */
1038    
1039  #else  #else
1040  #define HSPACE_LIST CHAR_HT, CHAR_SPACE  #define HSPACE_LIST CHAR_HT, CHAR_SPACE, CHAR_NBSP, NOTACHAR
1041    
1042  #define HSPACE_BYTE_CASES \  #define HSPACE_BYTE_CASES \
1043    case CHAR_HT: \    case CHAR_HT: \
1044    case CHAR_SPACE    case CHAR_SPACE: \
1045      case CHAR_NBSP
1046    
1047  #define HSPACE_CASES HSPACE_BYTE_CASES  #define HSPACE_CASES HSPACE_BYTE_CASES
1048    
# Line 1215  same code point. */ Line 1216  same code point. */
1216    
1217  #define CHAR_ESC                    '\047'  #define CHAR_ESC                    '\047'
1218  #define CHAR_DEL                    '\007'  #define CHAR_DEL                    '\007'
1219    #define CHAR_NBSP                   '\x41'
1220  #define STR_ESC                     "\047"  #define STR_ESC                     "\047"
1221  #define STR_DEL                     "\007"  #define STR_DEL                     "\007"
1222    
# Line 1229  a positive value. */ Line 1231  a positive value. */
1231  #define CHAR_NEL                    ((unsigned char)'\x85')  #define CHAR_NEL                    ((unsigned char)'\x85')
1232  #define CHAR_ESC                    '\033'  #define CHAR_ESC                    '\033'
1233  #define CHAR_DEL                    '\177'  #define CHAR_DEL                    '\177'
1234    #define CHAR_NBSP                   ((unsigned char)'\xa0')
1235    
1236  #define STR_LF                      "\n"  #define STR_LF                      "\n"
1237  #define STR_NL                      STR_LF  #define STR_NL                      STR_LF
# Line 1606  only. */ Line 1609  only. */
1609  #define CHAR_VERTICAL_LINE          '\174'  #define CHAR_VERTICAL_LINE          '\174'
1610  #define CHAR_RIGHT_CURLY_BRACKET    '\175'  #define CHAR_RIGHT_CURLY_BRACKET    '\175'
1611  #define CHAR_TILDE                  '\176'  #define CHAR_TILDE                  '\176'
1612    #define CHAR_NBSP                   ((unsigned char)'\xa0')
1613    
1614  #define STR_HT                      "\011"  #define STR_HT                      "\011"
1615  #define STR_VT                      "\013"  #define STR_VT                      "\013"
# Line 1762  only. */ Line 1766  only. */
1766    
1767  /* Escape items that are just an encoding of a particular data value. */  /* Escape items that are just an encoding of a particular data value. */
1768    
1769    #ifndef ESC_a
1770    #define ESC_a CHAR_BEL
1771    #endif
1772    
1773  #ifndef ESC_e  #ifndef ESC_e
1774  #define ESC_e CHAR_ESC  #define ESC_e CHAR_ESC
1775  #endif  #endif
# Line 2281  enum { ERR0,  ERR1,  ERR2,  ERR3,  ERR4, Line 2289  enum { ERR0,  ERR1,  ERR2,  ERR3,  ERR4,
2289         ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,         ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,
2290         ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69,         ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69,
2291         ERR70, ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERR78, ERR79,         ERR70, ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERR78, ERR79,
2292         ERR80, ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERRCOUNT };         ERR80, ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERR87, ERRCOUNT };
2293    
2294  /* JIT compiling modes. The function list is indexed by them. */  /* JIT compiling modes. The function list is indexed by them. */
2295    
# Line 2446  typedef struct compile_data { Line 2454  typedef struct compile_data {
2454    BOOL had_pruneorskip;             /* (*PRUNE) or (*SKIP) encountered */    BOOL had_pruneorskip;             /* (*PRUNE) or (*SKIP) encountered */
2455    BOOL check_lookbehind;            /* Lookbehinds need later checking */    BOOL check_lookbehind;            /* Lookbehinds need later checking */
2456    BOOL dupnames;                    /* Duplicate names exist */    BOOL dupnames;                    /* Duplicate names exist */
2457    BOOL iscondassert;                /* Next assert is a condition */    BOOL dupgroups;                   /* Duplicate groups exist: (?| found */
2458      BOOL iscondassert;                /* Next assert is a condition */
2459    int  nltype;                      /* Newline type */    int  nltype;                      /* Newline type */
2460    int  nllen;                       /* Newline string length */    int  nllen;                       /* Newline string length */
2461    pcre_uchar nl[4];                 /* Newline string when fixed length */    pcre_uchar nl[4];                 /* Newline string when fixed length */
# Line 2460  typedef struct branch_chain { Line 2469  typedef struct branch_chain {
2469    pcre_uchar *current_branch;    pcre_uchar *current_branch;
2470  } branch_chain;  } branch_chain;
2471    
2472    /* Structure for mutual recursion detection. */
2473    
2474    typedef struct recurse_check {
2475      struct recurse_check *prev;
2476      const pcre_uchar *group;
2477    } recurse_check;
2478    
2479  /* Structure for items in a linked list that represents an explicit recursive  /* Structure for items in a linked list that represents an explicit recursive
2480  call within the pattern; used by pcre_exec(). */  call within the pattern; used by pcre_exec(). */
2481    
# Line 2756  extern const pcre_uint8  PRIV(ucd_stage1 Line 2772  extern const pcre_uint8  PRIV(ucd_stage1
2772  extern const pcre_uint16 PRIV(ucd_stage2)[];  extern const pcre_uint16 PRIV(ucd_stage2)[];
2773  extern const pcre_uint32 PRIV(ucp_gentype)[];  extern const pcre_uint32 PRIV(ucp_gentype)[];
2774  extern const pcre_uint32 PRIV(ucp_gbtable)[];  extern const pcre_uint32 PRIV(ucp_gbtable)[];
2775    #ifdef COMPILE_PCRE32
2776    extern const ucd_record  PRIV(dummy_ucd_record)[];
2777    #endif
2778  #ifdef SUPPORT_JIT  #ifdef SUPPORT_JIT
2779  extern const int         PRIV(ucp_typerange)[];  extern const int         PRIV(ucp_typerange)[];
2780  #endif  #endif
# Line 2764  extern const int         PRIV(ucp_typera Line 2783  extern const int         PRIV(ucp_typera
2783  /* UCD access macros */  /* UCD access macros */
2784    
2785  #define UCD_BLOCK_SIZE 128  #define UCD_BLOCK_SIZE 128
2786  #define GET_UCD(ch) (PRIV(ucd_records) + \  #define REAL_GET_UCD(ch) (PRIV(ucd_records) + \
2787          PRIV(ucd_stage2)[PRIV(ucd_stage1)[(int)(ch) / UCD_BLOCK_SIZE] * \          PRIV(ucd_stage2)[PRIV(ucd_stage1)[(int)(ch) / UCD_BLOCK_SIZE] * \
2788          UCD_BLOCK_SIZE + (int)(ch) % UCD_BLOCK_SIZE])          UCD_BLOCK_SIZE + (int)(ch) % UCD_BLOCK_SIZE])
2789    
2790    #ifdef COMPILE_PCRE32
2791    #define GET_UCD(ch) ((ch > 0x10ffff)? PRIV(dummy_ucd_record) : REAL_GET_UCD(ch))
2792    #else
2793    #define GET_UCD(ch) REAL_GET_UCD(ch)
2794    #endif
2795    
2796  #define UCD_CHARTYPE(ch)    GET_UCD(ch)->chartype  #define UCD_CHARTYPE(ch)    GET_UCD(ch)->chartype
2797  #define UCD_SCRIPT(ch)      GET_UCD(ch)->script  #define UCD_SCRIPT(ch)      GET_UCD(ch)->script

Legend:
Removed from v.1523  
changed lines
  Added in v.1688

  ViewVC Help
Powered by ViewVC 1.1.5