summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2009-07-25 18:19:51 +0200
committerVincent Pit <perl@profvince.com>2009-07-25 23:26:07 +0200
commitaf097752b446f87855473ee776be3a2d7b735986 (patch)
tree93c17080295c2d221724ad333d1280f2fc1f698d /scope.c
parent75d34a09f38381e487470136b539a7fba0f02b44 (diff)
downloadperl-af097752b446f87855473ee776be3a2d7b735986.tar.gz
Introduce save_hdelete() and SAVEHDELETE()
save_hdelete() is just like save_delete() except that it takes an SV instead of char buffer.
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/scope.c b/scope.c
index 5aaf5def01..50798e47c7 100644
--- a/scope.c
+++ b/scope.c
@@ -514,6 +514,21 @@ Perl_save_delete(pTHX_ HV *hv, char *key, I32 klen)
}
void
+Perl_save_hdelete(pTHX_ HV *hv, SV *keysv)
+{
+ STRLEN len;
+ I32 klen;
+ const char *key;
+
+ PERL_ARGS_ASSERT_SAVE_HDELETE;
+
+ key = SvPV_const(keysv, len);
+ klen = SvUTF8(keysv) ? -(I32)len : (I32)len;
+ SvREFCNT_inc_simple_void_NN(hv);
+ save_pushptri32ptr(savepvn(key, len), klen, hv, SAVEt_DELETE);
+}
+
+void
Perl_save_adelete(pTHX_ AV *av, I32 key)
{
dVAR;