From d4192ed96f792bc52e5c3779b4dfdfcf987cb6bf Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 19 May 2022 19:57:59 -0600 Subject: perlapi: Document save_[ah]elem(_flags)? --- scope.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'scope.c') diff --git a/scope.c b/scope.c index 74033d182e..70026df5e3 100644 --- a/scope.c +++ b/scope.c @@ -845,6 +845,28 @@ S_save_pushptri32ptr(pTHX_ void *const ptr1, const I32 i, void *const ptr2, SS_ADD_END(4); } +/* +=for apidoc_section $callback +=for apidoc save_aelem +=for apidoc_item save_aelem_flags + +These each arrange for the value of the array element C to be restored +at the end of the enclosing I. + +In C, the SV at C**sptr> will be replaced by a new C +scalar. That scalar will inherit any magic from the original C<**sptr>, +and any 'set' magic will be processed. + +In C, C being set in C causes +the function to forgo all that: the scalar at C<**sptr> is untouched. +If C is not set, the SV at C**sptr> will be replaced by a +new C scalar. That scalar will inherit any magic from the original +C<**sptr>. Any 'set' magic will be processed if and only if C +is set in in C. + +=cut +*/ + void Perl_save_aelem_flags(pTHX_ AV *av, SSize_t idx, SV **sptr, const U32 flags) @@ -876,6 +898,28 @@ Perl_save_aelem_flags(pTHX_ AV *av, SSize_t idx, SV **sptr, sv_2mortal(sv); } +/* +=for apidoc_section $callback +=for apidoc save_helem +=for apidoc_item save_helem_flags + +These each arrange for the value of the hash element (in Perlish terms) +C<$hv{key}]> to be restored at the end of the enclosing I. + +In C, the SV at C**sptr> will be replaced by a new C +scalar. That scalar will inherit any magic from the original C<**sptr>, +and any 'set' magic will be processed. + +In C, C being set in C causes +the function to forgo all that: the scalar at C<**sptr> is untouched. +If C is not set, the SV at C**sptr> will be replaced by a +new C scalar. That scalar will inherit any magic from the original +C<**sptr>. Any 'set' magic will be processed if and only if C +is set in in C. + +=cut +*/ + void Perl_save_helem_flags(pTHX_ HV *hv, SV *key, SV **sptr, const U32 flags) { -- cgit v1.2.1