Export new ABIs. Doc fixes for new APIs.
[gnutls.git] / doc / scripts / sort2.pl
bloba4c71ef05ee46e313d4f8a2261247ed7b0a9fad5
1 #!/usr/bin/perl
3 sub key_of_record {
4 local($record) = @_;
6 # Split record into lines:
7 my @lines = split /\n/, $record;
9 my ($i) = 1;
10 my ($key) = $lines[$i];
12 while( !($key =~ /^\@deftypefun/) && ($i < 5)) { $i=$i+1; $key = $lines[$i]; }
14 $key = $1 if $key =~ /^\@deftypefun {.*} {(.*)}/;
16 # print STDERR "key $1\n";
18 return $key;
21 $/="@end deftypefun"; # Records are separated by blank lines.
22 @records = <>; # Read in whole file, one record per array element.
24 @records = sort { key_of_record($a) cmp key_of_record($b) } @records;
25 print @records;