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 | |
parent | 077e4a84c69999ec24ed099cabf973ea74febd54 (diff) | |
download | perl-d4192ed96f792bc52e5c3779b4dfdfcf987cb6bf.tar.gz |
perlapi: Document save_[ah]elem(_flags)?
-rw-r--r-- | embed.fnc | 8 | ||||
-rw-r--r-- | scope.c | 44 |
2 files changed, 48 insertions, 4 deletions
@@ -1687,8 +1687,8 @@ Apda |char* |savesharedsvpv |NN SV *sv Apda |char* |savesvpv |NN SV* sv Cp |void |savestack_grow Cp |void |savestack_grow_cnt |I32 need -Am |void |save_aelem |NN AV* av|SSize_t idx|NN SV **sptr -Ap |void |save_aelem_flags|NN AV* av|SSize_t idx|NN SV **sptr \ +Amd |void |save_aelem |NN AV* av|SSize_t idx|NN SV **sptr +Apd |void |save_aelem_flags|NN AV* av|SSize_t idx|NN SV **sptr \ |const U32 flags Cpd |I32 |save_alloc |I32 size|I32 pad Apdh |void |save_aptr |NN AV** aptr @@ -1710,8 +1710,8 @@ Cpd |void |save_shared_pvref|NN char** str Adp |void |save_gp |NN GV* gv|I32 empty Apdh |HV* |save_hash |NN GV* gv Cpd |void |save_hints -Am |void |save_helem |NN HV *hv|NN SV *key|NN SV **sptr -Ap |void |save_helem_flags|NN HV *hv|NN SV *key|NN SV **sptr|const U32 flags +Amd |void |save_helem |NN HV *hv|NN SV *key|NN SV **sptr +Apd |void |save_helem_flags|NN HV *hv|NN SV *key|NN SV **sptr|const U32 flags Apdh |void |save_hptr |NN HV** hptr Cp |void |save_I16 |NN I16* intp Cp |void |save_I32 |NN I32* intp @@ -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) { |