summaryrefslogtreecommitdiff
path: root/mg.h
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>1999-09-10 20:44:22 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>1999-09-10 20:44:22 +0000
commit53e9df65959190f4cd34a02fe359bc5e6d2553f6 (patch)
tree0808e1620b6ecdcd9f64c6db1b8f70966efe542e /mg.h
parenta0ed51b321531af4b47cce24205ab9656f043f0f (diff)
parent8a7fc0dc3015c8254ce4e866be71508e3379d45d (diff)
downloadperl-53e9df65959190f4cd34a02fe359bc5e6d2553f6.tar.gz
Get resolve -at mainline
p4raw-id: //depot/utfperl@4126
Diffstat (limited to 'mg.h')
-rw-r--r--mg.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/mg.h b/mg.h
index 16efdb5d7a..6a8afdc13b 100644
--- a/mg.h
+++ b/mg.h
@@ -1,6 +1,6 @@
/* mg.h
*
- * Copyright (c) 1991-1997, Larry Wall
+ * Copyright (c) 1991-1999, Larry Wall
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
@@ -11,11 +11,11 @@
STRUCT_MGVTBL_DEFINITION;
#else
struct mgvtbl {
- int (CPERLscope(*svt_get)) _((SV *sv, MAGIC* mg));
- int (CPERLscope(*svt_set)) _((SV *sv, MAGIC* mg));
- U32 (CPERLscope(*svt_len)) _((SV *sv, MAGIC* mg));
- int (CPERLscope(*svt_clear)) _((SV *sv, MAGIC* mg));
- int (CPERLscope(*svt_free)) _((SV *sv, MAGIC* mg));
+ int (CPERLscope(*svt_get)) (pTHX_ SV *sv, MAGIC* mg);
+ int (CPERLscope(*svt_set)) (pTHX_ SV *sv, MAGIC* mg);
+ U32 (CPERLscope(*svt_len)) (pTHX_ SV *sv, MAGIC* mg);
+ int (CPERLscope(*svt_clear))(pTHX_ SV *sv, MAGIC* mg);
+ int (CPERLscope(*svt_free)) (pTHX_ SV *sv, MAGIC* mg);
};
#endif
@@ -43,3 +43,8 @@ struct magic {
#define MgPV(mg,lp) (((lp = (mg)->mg_len) == HEf_SVKEY) ? \
SvPV((SV*)((mg)->mg_ptr),lp) : \
(mg)->mg_ptr)
+
+#define SvTIED_mg(sv,how) \
+ (SvRMAGICAL(sv) ? mg_find((sv),(how)) : Null(MAGIC*))
+#define SvTIED_obj(sv,mg) \
+ ((mg)->mg_obj ? (mg)->mg_obj : sv_2mortal(newRV(sv)))