/[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 1022 by ph10, Tue Aug 28 12:28:15 2012 UTC revision 1028 by ph10, Thu Sep 6 16:55:38 2012 UTC
# Line 945  macros to give the functions distinct na Line 945  macros to give the functions distinct na
945  #ifndef SUPPORT_UTF  #ifndef SUPPORT_UTF
946    
947  /* UTF-8 support is not enabled; use the platform-dependent character literals  /* UTF-8 support is not enabled; use the platform-dependent character literals
948  so that PCRE works on both ASCII and EBCDIC platforms, in non-UTF-mode only. */  so that PCRE works in both ASCII and EBCDIC environments, but only in non-UTF
949    mode. Newline characters are problematic in EBCDIC. Though it has CR and LF
950    characters, a common practice has been to use its NL (0x15) character as the
951    line terminator in C-like processing environments. However, sometimes the LF
952    (0x25) character is used instead, according to this Unicode document:
953    
954    http://unicode.org/standard/reports/tr13/tr13-5.html
955    
956    PCRE defaults EBCDIC NL to 0x15, but has a build-time option to select 0x25
957    instead. Whichever is *not* chosen is defined as NEL.
958    
959    In both ASCII and EBCDIC environments, CHAR_NL and CHAR_LF are synonyms for the
960    same code point. */
961    
962    #ifdef EBCDIC
963    
964    #ifndef EBCDIC_NL25
965    #define CHAR_NL                     '\x15'
966    #define CHAR_NEL                    '\x25'
967    #define STR_NL                      "\x15"
968    #define STR_NEL                     "\x25"
969    #else
970    #define CHAR_NL                     '\x25'
971    #define CHAR_NEL                    '\x15'
972    #define STR_NL                      "\x25"
973    #define STR_NEL                     "\x15"
974    #endif
975    
976    #define CHAR_LF                     CHAR_NL
977    #define STR_LF                      STR_NL
978    
979    #define CHAR_ESC                    '\047'
980    #define CHAR_DEL                    '\007'
981    #define STR_ESC                     "\047"
982    #define STR_DEL                     "\007"
983    
984    #else  /* Not EBCDIC */
985    
986    /* In ASCII/Unicode, linefeed is '\n' and we equate this to NL for
987    compatibility. NEL is the Unicode newline character. */
988    
989    #define CHAR_LF                     '\n'
990    #define CHAR_NL                     CHAR_LF
991    #define CHAR_NEL                    '\x85'
992    #define CHAR_ESC                    '\033'
993    #define CHAR_DEL                    '\177'
994    
995    #define STR_LF                      "\n"
996    #define STR_NL                      STR_LF
997    #define STR_NEL                     "\x85"
998    #define STR_ESC                     "\033"
999    #define STR_DEL                     "\177"
1000    
1001    #endif  /* EBCDIC */
1002    
1003    /* The remaining definitions work in both environments. */
1004    
1005  #define CHAR_HT                     '\t'  #define CHAR_HT                     '\t'
1006  #define CHAR_VT                     '\v'  #define CHAR_VT                     '\v'
1007  #define CHAR_FF                     '\f'  #define CHAR_FF                     '\f'
1008  #define CHAR_CR                     '\r'  #define CHAR_CR                     '\r'
 #define CHAR_NL                     '\n'  
1009  #define CHAR_BS                     '\b'  #define CHAR_BS                     '\b'
1010  #define CHAR_BEL                    '\a'  #define CHAR_BEL                    '\a'
 #ifdef EBCDIC  
 #define CHAR_ESC                    '\047'  
 #define CHAR_DEL                    '\007'  
 #else  
 #define CHAR_ESC                    '\033'  
 #define CHAR_DEL                    '\177'  
 #endif  
1011    
1012  #define CHAR_SPACE                  ' '  #define CHAR_SPACE                  ' '
1013  #define CHAR_EXCLAMATION_MARK       '!'  #define CHAR_EXCLAMATION_MARK       '!'
# Line 1062  so that PCRE works on both ASCII and EBC Line 1109  so that PCRE works on both ASCII and EBC
1109  #define STR_VT                      "\v"  #define STR_VT                      "\v"
1110  #define STR_FF                      "\f"  #define STR_FF                      "\f"
1111  #define STR_CR                      "\r"  #define STR_CR                      "\r"
 #define STR_NL                      "\n"  
1112  #define STR_BS                      "\b"  #define STR_BS                      "\b"
1113  #define STR_BEL                     "\a"  #define STR_BEL                     "\a"
 #ifdef EBCDIC  
 #define STR_ESC                     "\047"  
 #define STR_DEL                     "\007"  
 #else  
 #define STR_ESC                     "\033"  
 #define STR_DEL                     "\177"  
 #endif  
1114    
1115  #define STR_SPACE                   " "  #define STR_SPACE                   " "
1116  #define STR_EXCLAMATION_MARK        "!"  #define STR_EXCLAMATION_MARK        "!"
# Line 1221  only. */ Line 1260  only. */
1260  #define CHAR_VT                     '\013'  #define CHAR_VT                     '\013'
1261  #define CHAR_FF                     '\014'  #define CHAR_FF                     '\014'
1262  #define CHAR_CR                     '\015'  #define CHAR_CR                     '\015'
1263  #define CHAR_NL                     '\012'  #define CHAR_LF                     '\012'
1264    #define CHAR_NL                     CHAR_LF
1265    #define CHAR_NEL                    '\x85'
1266  #define CHAR_BS                     '\010'  #define CHAR_BS                     '\010'
1267  #define CHAR_BEL                    '\007'  #define CHAR_BEL                    '\007'
1268  #define CHAR_ESC                    '\033'  #define CHAR_ESC                    '\033'
# Line 1484  only. */ Line 1525  only. */
1525  #endif  #endif
1526    
1527  #ifndef ESC_n  #ifndef ESC_n
1528  #define ESC_n CHAR_NL  #define ESC_n CHAR_LF
1529  #endif  #endif
1530    
1531  #ifndef ESC_r  #ifndef ESC_r

Legend:
Removed from v.1022  
changed lines
  Added in v.1028

  ViewVC Help
Powered by ViewVC 1.1.5