Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perlapi: Show prototypes for all elements #22305

Merged
merged 1 commit into from
Jun 22, 2024

Conversation

khwilliamson
Copy link
Contributor

Some functions/macros are grouped together in a single entry where those items are just variants of each other. This makes it is easier for the reader to choose the variant that is best for their current purpose.

Prior to this commit if the return type and parameters to all variants in the group were the same, only the first item's prototype gets displayed. This was to save space. But I have found myself searching in vain for a prototype that was squashed, and it's not a whole lot of space that gets saved. This commit displays the signatures of all elements of a group. It doesn't change that trivial signatures are omitted. These are when just the name itself of the macro or typedef would be displayed, with no adornment. Displaying these actually is confusing, because there is no context for the name.

Some functions/macros are grouped together in a single entry where those
items are just variants of each other.  This makes it is easier for the
reader to choose the variant that is best for their current purpose.

Prior to this commit if the return type and parameters to all variants
in the group were the same, only the first item's prototype gets
displayed.  This was to save space.  But I have found myself searching
in vain for a prototype that was squashed, and it's not a whole lot of
space that gets saved.  This commit displays the signatures of all
elements of a group.  It doesn't change that trivial signatures are
omitted.  These are when just the name itself of the macro or typedef
would be displayed, with no adornment.  Displaying these actually is
confusing, because there is no context for the name.
@jkeenan
Copy link
Contributor

jkeenan commented Jun 20, 2024

This is what I get as a diff -w between the generated pod/perlapi.pod in blead and that in your branch. Is this what you were expecting?

$ diff -w 21017bd9c1.blead.perlapi.pod 94b0cc147e.branch.perlapi.pod > blead.branch.perlapi.pod.diff

$ cat blead.branch.perlapi.pod.diff 
30,33c30
< single entry.  But if all have the same signature (arguments and return type)
< except for their names, only the usage for the base form is shown.  If any
< one of the forms has a different signature (such as returning C<const> or
< not) every function's signature is explicitly displayed.
---
> single entry.
2621a2619,2621
>  bool  isALNUM_A       (UV ch)
>  bool  isALNUM_LC      (UV ch)
>  bool  isALNUM_LC_uvchr(UV ch)
2652a2653,2656
>  bool  isALNUMC_A       (UV ch)
>  bool  isALNUMC_LC      (UV ch)
>  bool  isALNUMC_LC_uvchr(UV ch)
>  bool  isALNUMC_L1      (UV ch)
3149a3154,3155
>  bool  isOCTAL_A (UV ch)
>  bool  isOCTAL_L1(UV ch)
11424a11431,11433
>  GV *  gv_HVadd(GV *gv)
>  GV *  gv_IOadd(GV *gv)
>  GV *  gv_SVadd(GV *gv)
23883a23893,23894
>  void  rpp_replace_1_1_NN  (SV *sv)
>  void  rpp_replace_1_IMM_NN(SV *sv)
23917a23929,23930
>  void  rpp_replace_2_1_NN  (SV *sv)
>  void  rpp_replace_2_IMM_NN(SV *sv)
23969a23983
>  bool  rpp_try_AMAGIC_2(int method, int flags)
29034a29049
>  SV *  newRV_inc(SV * const sv)
30577a30593
>  void  sv_dec_nomg(SV * const sv)
31083a31100
>  void  sv_inc_nomg(SV * const sv)
31446a31464,31465
>  IV  SvIV_nomg(SV *sv)
>  IV  SvIVx    (SV *sv)
31586a31606
>  STRLEN  sv_len_utf8_nomg(SV * const sv)
32039a32060,32061
>  NV  SvNV_nomg(SV *sv)
>  NV  SvNVx    (SV *sv)
33410a33433
>  void  sv_setbool_mg(SV *sv, bool b)
33535a33559,33561
>  void  SvSetMagicSV_nosteal(SV* dsv, SV* ssv)
>  void  SvSetSV             (SV* dsv, SV* ssv)
>  void  SvSetSV_nosteal     (SV* dsv, SV* ssv)
33558a33585
>  void  sv_setnv_mg(SV * const sv, const NV num)
33865a33893
>  void  sv_setrv_inc_mg(SV * const sv, SV * const ref)
33890a33919
>  void  sv_setrv_noinc_mg(SV * const sv, SV * const ref)
34172a34202,34205
>  bool  SvTRUE_NN     (SV *sv)
>  bool  SvTRUE_nomg   (SV *sv)
>  bool  SvTRUE_nomg_NN(SV *sv)
>  bool  SvTRUEx       (SV *sv)
34625a34659,34660
>  UV  SvUV_nomg(SV *sv)
>  UV  SvUVx    (SV *sv)
34752a34788,34789
>  void  sv_vsetpvf_mg(SV * const sv, const char * const pat,
>                      va_list * const args)
38926a38964,38973
>  bool  PERL_VERSION_GE(const U8 major, const U8 minor,
>                        const U8 patch)
>  bool  PERL_VERSION_GT(const U8 major, const U8 minor,
>                        const U8 patch)
>  bool  PERL_VERSION_LE(const U8 major, const U8 minor,
>                        const U8 patch)
>  bool  PERL_VERSION_LT(const U8 major, const U8 minor,
>                        const U8 patch)
>  bool  PERL_VERSION_NE(const U8 major, const U8 minor,
>                        const U8 patch)
39246a39294
>  void  Perl_ck_warner_d(pTHX_ U32 err, const char *pat, ...)

@khwilliamson
Copy link
Contributor Author

Yes

@khwilliamson khwilliamson merged commit 19e4fcd into Perl:blead Jun 22, 2024
29 checks passed
@khwilliamson khwilliamson deleted the perlapi_gt_1 branch June 22, 2024 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants