X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=mg.h;h=8f5644bff661bfb5f26eb7a3e781ae0611ab2be6;hb=0b6f4f5cb8bbeb6c5d1eb714dbf6cdf58c5516d7;hp=bbd675b98d8df2cbee380005913d7d55d28699fc;hpb=cb50f42d44feb5486b1014e87f10579f0b7cddbf;p=p5sagit%2Fp5-mst-13.2.git diff --git a/mg.h b/mg.h index bbd675b..8f5644b 100644 --- a/mg.h +++ b/mg.h @@ -1,6 +1,7 @@ /* mg.h * - * Copyright (c) 1991-2002, Larry Wall + * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, + * 2000, 2002, by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -24,7 +25,7 @@ struct mgvtbl { struct magic { MAGIC* mg_moremagic; - MGVTBL* mg_virtual; /* pointer to magic functions */ + const MGVTBL* mg_virtual; /* pointer to magic functions */ U16 mg_private; char mg_type; U8 mg_flags; @@ -47,6 +48,12 @@ struct magic { #define MgPV(mg,lp) ((((int)(lp = (mg)->mg_len)) == HEf_SVKEY) ? \ SvPV((SV*)((mg)->mg_ptr),lp) : \ (mg)->mg_ptr) +#define MgPV_const(mg,lp) ((((int)(lp = (mg)->mg_len)) == HEf_SVKEY) ? \ + SvPV_const((SV*)((mg)->mg_ptr),lp) : \ + (const char*)(mg)->mg_ptr) +#define MgPV_nolen_const(mg) (((((int)(mg)->mg_len)) == HEf_SVKEY) ? \ + SvPV_nolen_const((SV*)((mg)->mg_ptr)) : \ + (const char*)(mg)->mg_ptr) #define SvTIED_mg(sv,how) \ (SvRMAGICAL(sv) ? mg_find((sv),(how)) : Null(MAGIC*))