/[pcre]/code/branches/pcre16/pcre_internal.h
ViewVC logotype

Diff of /code/branches/pcre16/pcre_internal.h

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

revision 793 by zherczeg, Wed Dec 7 14:36:26 2011 UTC revision 794 by zherczeg, Thu Dec 8 07:36:41 2011 UTC
# Line 57  the PRIV macro. */ Line 57  the PRIV macro. */
57  #define COMPILE_PCRE8  #define COMPILE_PCRE8
58  #endif  #endif
59    
60  /* We do not support both EBCDIC and UTF-8/16 at the same time. The "configure"  /* If SUPPORT_UCP is defined, SUPPORT_UTF must also be defined. The
61  script prevents both being selected, but not everybody uses "configure". */  "configure" script ensures this, but not everybody uses "configure". */
62    
63  #if defined EBCDIC && (defined SUPPORT_UTF8 || defined SUPPORT_UTF16)  #if defined SUPPORT_UCP && !(defined SUPPORT_UTF)
64  #error The use of both EBCDIC and SUPPORT_UTF8/16 is not supported.  #define SUPPORT_UTF 1
65  #endif  #endif
66    
67  /* If SUPPORT_UCP is defined, SUPPORT_UTF8 must also be defined. The  /* We define SUPPORT_UTF if SUPPORT_UTF8 is enabled for compatibility
68  "configure" script ensures this, but not everybody uses "configure". */  reasons with existing code. */
69    
70  #if defined SUPPORT_UCP && !defined SUPPORT_UTF8  #if defined SUPPORT_UTF8 && !(defined SUPPORT_UTF)
71  #define SUPPORT_UTF8 1  #define SUPPORT_UTF 1
72  #endif  #endif
73    
74  /* If SUPPORT_UCP is defined, SUPPORT_UTF16 must also be defined. The  /* Fixme: SUPPORT_UTF8 should be eventually disappear from the code.
75  "configure" script ensures this, but not everybody uses "configure". */  Until then we define it if SUPPORT_UTF is defined. */
76    
77  #if defined SUPPORT_UCP && defined COMPILE_PCRE16 && !defined SUPPORT_UTF16  #if defined SUPPORT_UTF && !(defined SUPPORT_UTF8)
78  #define SUPPORT_UTF16 1  #define SUPPORT_UTF8 1
79  #endif  #endif
80    
81  /* This macro is defined if either UTF-8 or UTF-16 support or both are  /* We do not support both EBCDIC and UTF-8/16 at the same time. The "configure"
82  enabled. */  script prevents both being selected, but not everybody uses "configure". */
83    
84  #if defined SUPPORT_UTF8 || defined SUPPORT_UTF16  #if defined EBCDIC && defined SUPPORT_UTF
85  /* Unicode Transformation Format is enabled. */  #error The use of both EBCDIC and SUPPORT_UTF8/16 is not supported.
 #define SUPPORT_UTF 1  
86  #endif  #endif
87    
88  /* Use a macro for debugging printing, 'cause that eliminates the use of #ifdef  /* Use a macro for debugging printing, 'cause that eliminates the use of #ifdef
# Line 524  capturing parenthesis numbers in back re Line 523  capturing parenthesis numbers in back re
523    
524  #define PUT2INC(a,n,d)  PUT2(a,n,d), a += IMM2_SIZE  #define PUT2INC(a,n,d)  PUT2(a,n,d), a += IMM2_SIZE
525    
526  /* When UTF-8 encoding is being used, a character is no longer just a single  /* When UTF encoding is being used, a character is no longer just a single
527  byte. The macros for character handling generate simple sequences when used in  character. The macros for character handling generate simple sequences when
528  byte-mode, and more complicated ones for UTF-8 characters. GETCHARLENTEST is  used in character-mode, and more complicated ones for UTF characters.
529  not used when UTF-8 is not supported, so it is not defined, and BACKCHAR should  GETCHARLENTEST and other macros are not used when UTF is not supported,
530  never be called in byte mode. To make sure they can never even appear when  so they are not defined. To make sure they can never even appear when
531  UTF-8 support is omitted, we don't even define them. */  UTF support is omitted, we don't even define them. */
532    
533    #ifndef SUPPORT_UTF
534    
535  /* #define HAS_EXTRALEN(c) */  /* #define HAS_EXTRALEN(c) */
536  /* #define GET_EXTRALEN(c) */  /* #define GET_EXTRALEN(c) */
537  #ifndef SUPPORT_UTF  /* #define NOT_FIRSTCHAR(c) */
538  #define GETCHAR(c, eptr) c = *eptr;  #define GETCHAR(c, eptr) c = *eptr;
539  #define GETCHARTEST(c, eptr) c = *eptr;  #define GETCHARTEST(c, eptr) c = *eptr;
540  #define GETCHARINC(c, eptr) c = *eptr++;  #define GETCHARINC(c, eptr) c = *eptr++;
# Line 562  Otherwise it has an undefined behaviour. Line 563  Otherwise it has an undefined behaviour.
563    
564  #define GET_EXTRALEN(c) (PRIV(utf8_table4)[(c) & 0x3f])  #define GET_EXTRALEN(c) (PRIV(utf8_table4)[(c) & 0x3f])
565    
566    /* Returns TRUE, if the given character is not the first character
567    of a UTF sequence. */
568    
569    #define NOT_FIRSTCHAR(c) (((c) & 0xc0) == 0x80)
570    
571  /* Base macro to pick up the remaining bytes of a UTF-8 character, not  /* Base macro to pick up the remaining bytes of a UTF-8 character, not
572  advancing the pointer. */  advancing the pointer. */
573    
# Line 724  Otherwise it has an undefined behaviour. Line 730  Otherwise it has an undefined behaviour.
730    
731  #define GET_EXTRALEN(c) 1  #define GET_EXTRALEN(c) 1
732    
733    /* Returns TRUE, if the given character is not the first character
734    of a UTF sequence. */
735    
736    #define NOT_FIRSTCHAR(c) (((c) & 0xfc00) == 0xdc00)
737    
738  /* Base macro to pick up the low surrogate of a UTF-16 character, not  /* Base macro to pick up the low surrogate of a UTF-16 character, not
739  advancing the pointer. */  advancing the pointer. */
740    

Legend:
Removed from v.793  
changed lines
  Added in v.794

  ViewVC Help
Powered by ViewVC 1.1.5