summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-09-08 00:55:02 +0000
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1996-09-08 00:55:02 +0000
commit99069129ae4c94e216ce7ad2899e8f92ff47b10c (patch)
treee47e15693ed4f7a29df27e5521d19f774de09d2c
parent188ea221419ad1211dd551705e8d94114b6df1c5 (diff)
downloadperl-99069129ae4c94e216ce7ad2899e8f92ff47b10c.tar.gz
perl 5.003_05: mg.h
Replace the oft-repeated mg_ptr incantation with the simple MgPVKEY macro. Rename MgPVKEY to MgPV (to match with HePV elsewhere). Add additional parens around the "mg".
-rw-r--r--mg.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/mg.h b/mg.h
index ab24eb03ab..8fbda82ea1 100644
--- a/mg.h
+++ b/mg.h
@@ -34,3 +34,7 @@ struct magic {
#define MgTAINTEDDIR(mg) (mg->mg_flags & MGf_TAINTEDDIR)
#define MgTAINTEDDIR_on(mg) (mg->mg_flags |= MGf_TAINTEDDIR)
+
+#define MgPV(mg) ((mg)->mg_len == HEf_SVKEY) ? \
+ SvPV((SV*)((mg)->mg_ptr),na) : \
+ (mg)->mg_ptr