/[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 1199 by chpe, Sat Nov 3 19:21:37 2012 UTC revision 1200 by chpe, Sat Nov 3 19:21:41 2012 UTC
# Line 934  into one pcre_uchar unit. */ Line 934  into one pcre_uchar unit. */
934  #define GET_EXTRALEN(c) (0)  #define GET_EXTRALEN(c) (0)
935  #define NOT_FIRSTCHAR(c) (0)  #define NOT_FIRSTCHAR(c) (0)
936    
 #define UTF32_MASK (0x1fffffu)  
   
 /* Base macro to pick up an UTF-32 character out of a uint32 */  
   
 #define MASKHIGHBITS(c) ((c) & UTF32_MASK)  
   
 /* Base macro to pick up an UTF-32 character, not advancing the pointer */  
   
 #define GETUTF32(eptr) (MASKHIGHBITS(*(eptr)))  
   
 /* Base macro to pick up an UTF-32 character, advancing the pointer */  
   
 #define GETUTF32INC(eptr) (MASKHIGHBITS(*((eptr)++)))  
   
937  /* 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
938  we know we are in UTF-32 mode. */  we know we are in UTF-32 mode. */
939    
940  #define GETCHAR(c, eptr) \  #define GETCHAR(c, eptr) \
941    c = GETUTF32(eptr);    c = *(eptr);
942    
943  /* 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
944  pointer. */  pointer. */
945    
946  #define GETCHARTEST(c, eptr) \  #define GETCHARTEST(c, eptr) \
947    c = (utf ? GETUTF32(eptr) : *(eptr));    c = *(eptr);
948    
949  /* 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
950  know we are in UTF-32 mode. */  know we are in UTF-32 mode. */
951    
952  #define GETCHARINC(c, eptr) \  #define GETCHARINC(c, eptr) \
953    c = GETUTF32INC(eptr);    c = *((eptr)++);
954    
955  /* 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.
956  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. */
957    
958  #define GETCHARINCTEST(c, eptr) \  #define GETCHARINCTEST(c, eptr) \
959    c = (utf ? GETUTF32INC(eptr) : *((eptr)++));    c = *((eptr)++);
960    
961  /* Get the next UTF-32 character, not advancing the pointer, not incrementing  /* Get the next UTF-32 character, not advancing the pointer, not incrementing
962  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 990  This is called when we do not know if we Line 976  This is called when we do not know if we
976  we know we are in UTF mode. */  we know we are in UTF mode. */
977    
978  #define RAWUCHAR(eptr) \  #define RAWUCHAR(eptr) \
979    (MASKHIGHBITS(*(eptr)))    (*(eptr))
980    
981  /* Returns the next uchar, advancing the pointer. This is called when  /* Returns the next uchar, advancing the pointer. This is called when
982  we know we are in UTF mode. */  we know we are in UTF mode. */
983    
984  #define RAWUCHARINC(eptr) \  #define RAWUCHARINC(eptr) \
985    (MASKHIGHBITS(*((eptr)++)))    (*((eptr)++))
986    
987  /* Returns the next uchar, testing for UTF mode, and not advancing the  /* Returns the next uchar, testing for UTF mode, and not advancing the
988  pointer. */  pointer. */
989    
990  #define RAWUCHARTEST(eptr) \  #define RAWUCHARTEST(eptr) \
991    (utf ? (MASKHIGHBITS(*(eptr))) : *(eptr))    (*(eptr))
992    
993  /* Returns the next uchar, testing for UTF mode, advancing the  /* Returns the next uchar, testing for UTF mode, advancing the
994  pointer. */  pointer. */
995    
996  #define RAWUCHARINCTEST(eptr) \  #define RAWUCHARINCTEST(eptr) \
997    (utf ? (MASKHIGHBITS(*((eptr)++))) : *((eptr)++))    (*((eptr)++))
998    
999  /* 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
1000  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

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

  ViewVC Help
Powered by ViewVC 1.1.5