2 # Search for symbols which might need renaming
3 # (c) 2014 Martin Mares <mj@ucw.cz>
10 open my $f, '<', $file or die;
13 # Find things which look like top-level declarations
22 /^-/ and next; # Magic for ucw/getopt.h
23 /^\w+:/ and next; # Labels in inline functions
24 /^typedef\s/ and next;
26 /^(struct|union|enum)(\s+\w+)?(;|\s*{)/ and next;
30 # Try to parse the declaration
31 s{\[[^\]]*\]}{}g; # Delete array sizes
32 if (m{^extern [^,]*(\s+\**\w+(,\s+\**\w+)*);}) {
35 print join("\n", grep { !/^$/ } split /\s+/, $x), "\n";
36 } elsif (m{( |\*)(\w+)\(}) {
46 my %blacklist = map { $_ => 1 } qw(
59 charset/charconv-gen.h
70 for my $f (<ucw/*.h>, <ucw/sorter/common.h>, <charset/*.h>, <images/*.h>) {
71 next if $blacklist{$f};