X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/29cb021025fb453de886003f71f6de6be0d69405..4289720c9250bd29d4fa8a9df4cd35eacd290541:/dist/Devel-PPPort/parts/inc/inctools diff --git a/dist/Devel-PPPort/parts/inc/inctools b/dist/Devel-PPPort/parts/inc/inctools index 7ac26bd..c78246f 100644 --- a/dist/Devel-PPPort/parts/inc/inctools +++ b/dist/Devel-PPPort/parts/inc/inctools @@ -88,4 +88,14 @@ sub dictionary_order($$) # Sort caselessly, ignoring punct or $valid_a cmp $valid_b); } +sub sort_api_lines # Sort lines of the form flags|return|name|args... + # by 'name' +{ + $a =~ / ^ [^|]* \| [^|]* \| (\w+) /x; # 3rd field '|' is sep + my $a_name = $1; + $b =~ / ^ [^|]* \| [^|]* \| (\w+) /x; + my $b_name = $1; + return dictionary_order($a_name, $b_name); +} + 1;