4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-19 12:59:21 +08:00
Corinna Vinschen 007e23d639 Cygwin: Reorganize cygwin source dir
Create subdirs and move files accordingly:

- DevDocs:  doc files
- fhandler: fhandler sources, split fhandler.cc into base.cc and null.cc
- local_includes: local include files
- scripts:  scripts called during build
- sec:      security sources

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-05 12:02:11 +02:00

36 lines
581 B
Perl
Executable File

#!/usr/bin/perl
my %data = ();
my %code = ();
my @out = ();
my $fn = $ARGV[0];
while (<>) {
push(@out, $_);
/^\s*exports/i and last;
}
while (<>) {
my $key;
$arr = /\sDATA\s*$/o ? \%data : \%code;
$_ =~ s/^\s+//;
my $key = (split(' ', $_))[0];
substr($key, 0, 1) = '' while $key =~ /^_/o;
chomp $key;
$arr->{$key}->{$_} = 1;
}
for my $k (sort keys %data) {
push(@out, sort {$b cmp $a} keys %{$data{$k}});
}
for my $k (sort keys %code) {
push(@out, sort {$b cmp $a} keys %{$code{$k}});
}
open(R, '>', $fn);
print R @out;
close R;