/[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 1151 by chpe, Sun Oct 21 16:53:46 2012 UTC revision 1199 by chpe, Sat Nov 3 19:21:37 2012 UTC
# Line 221  stdint.h is available, include it; it ma Line 221  stdint.h is available, include it; it ma
221  have stdint.h (e.g. Solaris) may have inttypes.h. The macro int64_t may be set  have stdint.h (e.g. Solaris) may have inttypes.h. The macro int64_t may be set
222  by "configure". */  by "configure". */
223    
224  #if HAVE_STDINT_H  #if defined HAVE_STDINT_H
225  #include <stdint.h>  #include <stdint.h>
226  #elif HAVE_INTTYPES_H  #elif defined HAVE_INTTYPES_H
227  #include <inttypes.h>  #include <inttypes.h>
228  #endif  #endif
229    
# Line 279  typedef pcre_uint32 pcre_uchar; Line 279  typedef pcre_uint32 pcre_uchar;
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    
 /* Assert that pcre_uchar32 is a 32-bit type */  
 typedef int __assert_pcre_uchar32_size[sizeof(pcre_uchar) == 4 ? 1 : -1];  
   
282  #else  #else
283  #error Unsupported compiling mode  #error Unsupported compiling mode
284  #endif /* COMPILE_PCRE[8|16|32] */  #endif /* COMPILE_PCRE[8|16|32] */
# Line 351  values. */ Line 348  values. */
348  #include "pcre.h"  #include "pcre.h"
349  #include "ucp.h"  #include "ucp.h"
350    
351    #ifdef COMPILE_PCRE32
352    /* Assert that the public PCRE_UCHAR32 is a 32-bit type */
353    typedef int __assert_pcre_uchar32_size[sizeof(PCRE_UCHAR32) == 4 ? 1 : -1];
354    #endif
355    
356  /* When compiling for use with the Virtual Pascal compiler, these functions  /* When compiling for use with the Virtual Pascal compiler, these functions
357  need to have their names changed. PCRE must be compiled with the -DVPCOMPAT  need to have their names changed. PCRE must be compiled with the -DVPCOMPAT
358  option on the command line. */  option on the command line. */
# Line 776  we know we are in UTF mode. */ Line 778  we know we are in UTF mode. */
778  we know we are in UTF mode. */  we know we are in UTF mode. */
779    
780  #define RAWUCHARINC(eptr) \  #define RAWUCHARINC(eptr) \
781    (*(eptr)++)    (*((eptr)++))
782    
783  /* Returns the next uchar, testing for UTF mode, and not advancing the  /* Returns the next uchar, testing for UTF mode, and not advancing the
784  pointer. */  pointer. */
# Line 788  pointer. */ Line 790  pointer. */
790  pointer. */  pointer. */
791    
792  #define RAWUCHARINCTEST(eptr) \  #define RAWUCHARINCTEST(eptr) \
793    (*(eptr)++)    (*((eptr)++))
794    
795  /* If the pointer is not at the start of a character, move it back until  /* If the pointer is not at the start of a character, move it back until
796  it is. This is called only in UTF-8 mode - we don't put a test within the macro  it is. This is called only in UTF-8 mode - we don't put a test within the macro
# Line 895  we know we are in UTF mode. */ Line 897  we know we are in UTF mode. */
897  we know we are in UTF mode. */  we know we are in UTF mode. */
898    
899  #define RAWUCHARINC(eptr) \  #define RAWUCHARINC(eptr) \
900    (*(eptr)++)    (*((eptr)++))
901    
902  /* Returns the next uchar, testing for UTF mode, and not advancing the  /* Returns the next uchar, testing for UTF mode, and not advancing the
903  pointer. */  pointer. */
# Line 907  pointer. */ Line 909  pointer. */
909  pointer. */  pointer. */
910    
911  #define RAWUCHARINCTEST(eptr) \  #define RAWUCHARINCTEST(eptr) \
912    (*(eptr)++)    (*((eptr)++))
913    
914  /* If the pointer is not at the start of a character, move it back until  /* If the pointer is not at the start of a character, move it back until
915  it is. This is called only in UTF-16 mode - we don't put a test within the  it is. This is called only in UTF-16 mode - we don't put a test within the
# Line 934  into one pcre_uchar unit. */ Line 936  into one pcre_uchar unit. */
936    
937  #define UTF32_MASK (0x1fffffu)  #define UTF32_MASK (0x1fffffu)
938    
939    /* Base macro to pick up an UTF-32 character out of a uint32 */
940    
941    #define MASKHIGHBITS(c) ((c) & UTF32_MASK)
942    
943    /* Base macro to pick up an UTF-32 character, not advancing the pointer */
944    
945    #define GETUTF32(eptr) (MASKHIGHBITS(*(eptr)))
946    
947    /* Base macro to pick up an UTF-32 character, advancing the pointer */
948    
949    #define GETUTF32INC(eptr) (MASKHIGHBITS(*((eptr)++)))
950    
951  /* Get the next UTF-32 character, not advancing the pointer. This is called when  /* Get the next UTF-32 character, not advancing the pointer. This is called when
952  we know we are in UTF-32 mode. */  we know we are in UTF-32 mode. */
953    
954  #define GETCHAR(c, eptr) \  #define GETCHAR(c, eptr) \
955    c = (*eptr) & UTF32_MASK;    c = GETUTF32(eptr);
956    
957  /* Get the next UTF-32 character, testing for UTF-32 mode, and not advancing the  /* Get the next UTF-32 character, testing for UTF-32 mode, and not advancing the
958  pointer. */  pointer. */
959    
960  #define GETCHARTEST(c, eptr) \  #define GETCHARTEST(c, eptr) \
961    c = *eptr; \    c = (utf ? GETUTF32(eptr) : *(eptr));
   if (utf) c &= UTF32_MASK;  
962    
963  /* Get the next UTF-32 character, advancing the pointer. This is called when we  /* Get the next UTF-32 character, advancing the pointer. This is called when we
964  know we are in UTF-32 mode. */  know we are in UTF-32 mode. */
965    
966  #define GETCHARINC(c, eptr) \  #define GETCHARINC(c, eptr) \
967    c = (*eptr++) & UTF32_MASK;    c = GETUTF32INC(eptr);
968    
969  /* Get the next character, testing for UTF-32 mode, and advancing the pointer.  /* Get the next character, testing for UTF-32 mode, and advancing the pointer.
970  This is called when we don't know if we are in UTF-32 mode. */  This is called when we don't know if we are in UTF-32 mode. */
971    
972  #define GETCHARINCTEST(c, eptr) \  #define GETCHARINCTEST(c, eptr) \
973    c = *eptr++; \    c = (utf ? GETUTF32INC(eptr) : *((eptr)++));
   if (utf) c &= UTF32_MASK;  
974    
975  /* Get the next UTF-32 character, not advancing the pointer, not incrementing  /* Get the next UTF-32 character, not advancing the pointer, not incrementing
976  length (since all UTF-32 is of length 1). This is called when we know we are in  length (since all UTF-32 is of length 1). This is called when we know we are in
# Line 978  This is called when we do not know if we Line 990  This is called when we do not know if we
990  we know we are in UTF mode. */  we know we are in UTF mode. */
991    
992  #define RAWUCHAR(eptr) \  #define RAWUCHAR(eptr) \
993    (*(eptr) & UTF32_MASK)    (MASKHIGHBITS(*(eptr)))
994    
995  /* Returns the next uchar, advancing the pointer. This is called when  /* Returns the next uchar, advancing the pointer. This is called when
996  we know we are in UTF mode. */  we know we are in UTF mode. */
997    
998  #define RAWUCHARINC(eptr) \  #define RAWUCHARINC(eptr) \
999    (*(eptr)++ & UTF32_MASK)    (MASKHIGHBITS(*((eptr)++)))
1000    
1001  /* Returns the next uchar, testing for UTF mode, and not advancing the  /* Returns the next uchar, testing for UTF mode, and not advancing the
1002  pointer. */  pointer. */
1003    
1004  #define RAWUCHARTEST(eptr) \  #define RAWUCHARTEST(eptr) \
1005    (utf ? (*(eptr) & UTF32_MASK) : *(eptr))    (utf ? (MASKHIGHBITS(*(eptr))) : *(eptr))
1006    
1007  /* Returns the next uchar, testing for UTF mode, advancing the  /* Returns the next uchar, testing for UTF mode, advancing the
1008  pointer. */  pointer. */
1009    
1010  #define RAWUCHARINCTEST(eptr) \  #define RAWUCHARINCTEST(eptr) \
1011    (utf ? (*(eptr)++ & UTF32_MASK) : *(eptr)++)    (utf ? (MASKHIGHBITS(*((eptr)++))) : *((eptr)++))
1012    
1013  /* If the pointer is not at the start of a character, move it back until  /* If the pointer is not at the start of a character, move it back until
1014  it is. This is called only in UTF-32 mode - we don't put a test within the  it is. This is called only in UTF-32 mode - we don't put a test within the
# Line 1183  time, run time, or study time, respectiv Line 1195  time, run time, or study time, respectiv
1195     (PCRE_STUDY_JIT_COMPILE|PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE| \     (PCRE_STUDY_JIT_COMPILE|PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE| \
1196      PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE|PCRE_STUDY_EXTRA_NEEDED)      PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE|PCRE_STUDY_EXTRA_NEEDED)
1197    
1198    #define PUBLIC_JIT_EXEC_OPTIONS \
1199       (PCRE_NO_UTF8_CHECK|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY|\
1200        PCRE_NOTEMPTY_ATSTART|PCRE_PARTIAL_SOFT|PCRE_PARTIAL_HARD)
1201    
1202  /* Magic number to provide a small check against being handed junk. */  /* Magic number to provide a small check against being handed junk. */
1203    
1204  #define MAGIC_NUMBER  0x50435245UL   /* 'PCRE' */  #define MAGIC_NUMBER  0x50435245UL   /* 'PCRE' */
# Line 1286  a positive value. */ Line 1302  a positive value. */
1302    
1303  /* The remaining definitions work in both environments. */  /* The remaining definitions work in both environments. */
1304    
1305    #define CHAR_NULL                   '\0'
1306  #define CHAR_HT                     '\t'  #define CHAR_HT                     '\t'
1307  #define CHAR_VT                     '\v'  #define CHAR_VT                     '\v'
1308  #define CHAR_FF                     '\f'  #define CHAR_FF                     '\f'
# Line 1555  only. */ Line 1572  only. */
1572  #define CHAR_ESC                    '\033'  #define CHAR_ESC                    '\033'
1573  #define CHAR_DEL                    '\177'  #define CHAR_DEL                    '\177'
1574    
1575    #define CHAR_NULL                   '\0'
1576  #define CHAR_SPACE                  '\040'  #define CHAR_SPACE                  '\040'
1577  #define CHAR_EXCLAMATION_MARK       '\041'  #define CHAR_EXCLAMATION_MARK       '\041'
1578  #define CHAR_QUOTATION_MARK         '\042'  #define CHAR_QUOTATION_MARK         '\042'
# Line 2701  extern BOOL              PRIV(xclass)(pc Line 2719  extern BOOL              PRIV(xclass)(pc
2719  #ifdef SUPPORT_JIT  #ifdef SUPPORT_JIT
2720  extern void              PRIV(jit_compile)(const REAL_PCRE *,  extern void              PRIV(jit_compile)(const REAL_PCRE *,
2721                             PUBL(extra) *, int);                             PUBL(extra) *, int);
2722  extern int               PRIV(jit_exec)(const REAL_PCRE *, const PUBL(extra) *,  extern int               PRIV(jit_exec)(const PUBL(extra) *,
2723                             const pcre_uchar *, int, int, int, int *, int);                             const pcre_uchar *, int, int, int, int *, int);
2724  extern void              PRIV(jit_free)(void *);  extern void              PRIV(jit_free)(void *);
2725  extern int               PRIV(jit_get_size)(void *);  extern int               PRIV(jit_get_size)(void *);

Legend:
Removed from v.1151  
changed lines
  Added in v.1199

  ViewVC Help
Powered by ViewVC 1.1.5