diff options
author | Karl Williamson <khw@cpan.org> | 2022-05-19 19:57:59 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-05-27 21:24:39 -0600 |
commit | d4192ed96f792bc52e5c3779b4dfdfcf987cb6bf (patch) | |
tree | f674e17696a312515543bef8e36d8c4034a29096 /scope.c | |
parent | 077e4a84c69999ec24ed099cabf973ea74febd54 (diff) | |
download | perl-d4192ed96f792bc52e5c3779b4dfdfcf987cb6bf.tar.gz |
perlapi: Document save_[ah]elem(_flags)?
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 44 |
1 files changed, 44 insertions, 0 deletions
@@ -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<av[idx]> to be restored +at the end of the enclosing I<pseudo-block>. + +In C<save_aelem>, the SV at C**sptr> will be replaced by a new C<undef> +scalar. That scalar will inherit any magic from the original C<**sptr>, +and any 'set' magic will be processed. + +In C<save_aelem_flags>, C<SAVEf_KEEPOLDELEM> being set in C<flags> causes +the function to forgo all that: the scalar at C<**sptr> is untouched. +If C<SAVEf_KEEPOLDELEM> is not set, the SV at C**sptr> will be replaced by a +new C<undef> scalar. That scalar will inherit any magic from the original +C<**sptr>. Any 'set' magic will be processed if and only if C<SAVEf_SETMAGIC> +is set in in C<flags>. + +=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<pseudo-block>. + +In C<save_helem>, the SV at C**sptr> will be replaced by a new C<undef> +scalar. That scalar will inherit any magic from the original C<**sptr>, +and any 'set' magic will be processed. + +In C<save_helem_flags>, C<SAVEf_KEEPOLDELEM> being set in C<flags> causes +the function to forgo all that: the scalar at C<**sptr> is untouched. +If C<SAVEf_KEEPOLDELEM> is not set, the SV at C**sptr> will be replaced by a +new C<undef> scalar. That scalar will inherit any magic from the original +C<**sptr>. Any 'set' magic will be processed if and only if C<SAVEf_SETMAGIC> +is set in in C<flags>. + +=cut +*/ + void Perl_save_helem_flags(pTHX_ HV *hv, SV *key, SV **sptr, const U32 flags) { |