summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-02-13 18:51:34 -0700
committerKarl Williamson <public@khwilliamson.com>2012-02-15 18:02:35 -0700
commit25093c956d0b9bf18415f717ee7eafa550809b89 (patch)
tree7fdcafe5dffc437d461ed6e28338a51b0fbb2c4c /handy.h
parent9a022f3a9e4bafe265086ebafcf8f6990108aa57 (diff)
downloadperl-25093c956d0b9bf18415f717ee7eafa550809b89.tar.gz
handy.h: New macro for quotemeta
This tests if a Latin1 character should be quoted.
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/handy.h b/handy.h
index 7a443df16d..af0eddea09 100644
--- a/handy.h
+++ b/handy.h
@@ -626,8 +626,8 @@ patched there. The file as of this writing is cpan/Devel-PPPort/parts/inc/misc
# define _CC_WORDCHAR_L1 (1<<28)
# define _CC_XDIGIT_A (1<<29)
# define _CC_NONLATIN1_FOLD (1<<30)
-/* Unused
- * (1<<31)
+# define _CC_QUOTEMETA (1<<31)
+/* Unused: None
* If more are needed, can give up some of the above. The first ones to go
* would be those that require just two tests to verify, either there are two
* code points, like BLANK_A, or occupy a single range like OCTAL_A, DIGIT_A,
@@ -662,6 +662,7 @@ EXTCONST U32 PL_charclass[];
/* Either participates in a fold with a character above 255, or is a
* multi-char fold */
# define _HAS_NONLATIN1_FOLD_CLOSURE_ONLY_FOR_USE_BY_REGCOMP_DOT_C_AND_REGEXEC_DOT_C(c) ((! cBOOL(FITS_IN_8_BITS(c))) || (PL_charclass[(U8) NATIVE_TO_UNI(c)] & _CC_NONLATIN1_FOLD))
+# define _isQUOTEMETA(c) cBOOL(FITS_IN_8_BITS(c) && (PL_charclass[(U8) NATIVE_TO_UNI(c)] & _CC_QUOTEMETA))
#else /* No perl.h. */
# define isOCTAL_A(c) ((c) <= '7' && (c) >= '0')
# ifdef EBCDIC