williamr/find_public_apis.pl
author William Roberts <williamr@symbian.org>
Mon, 08 Jun 2009 12:52:52 +0100
changeset 4 60053dab7e2a
parent 3 8b87ea768cb8
child 9 b40f95834f85
permissions -rw-r--r--
Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things More wrestling with find_public_apis.pl
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
#!/usr/bin/perl
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
# Copyright (c) 2009 Symbian Foundation Ltd
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
# This component and the accompanying materials are made available
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
# which accompanies this distribution, and is available
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
#
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
# Initial Contributors:
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
# Symbian Foundation Ltd - initial contribution.
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
# 
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
# Contributors:
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
#
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
# Description:
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
# Identify "Public APIs" - defined as
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
# 1. Files in epoc32\include which are not in epoc32\include\platform, 
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
# 2. And contain either no Symbian API classification doxygen tags (Public by export)
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
# 3. Or contain @publishedAll (Public by tag - now deprecated)
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    19
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
use strict;
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    21
my $debug = 0;
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    22
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    23
my @public_included = ();
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    24
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    25
sub analyse_api($$$)
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
  {
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    27
  my ($file,$name,$includelistref) = @_;
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
  
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
  if ($name =~ /^epoc32\/include\/platform\//)
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
    {
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
    # /epoc32/include/platform files are "Platform by export"
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    32
    return "Platform by export";
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
    }
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
  
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    35
  if ($name =~ /\./ && $name !~ /\.(h|rh|hrh|inl|c|hpp)$/i)
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    36
    {
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    37
    # Not a file which contains APIs anyway
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    38
    return "Non-API extension";
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    39
    }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    40
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    41
  open FILE, "<$file" or print "ERROR: Cannot open $file: $!\n" and return "Cannot open";
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
  my @lines = <FILE>; # they are all of a modest size
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
  close FILE;
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
  
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    45
  my @includelines = grep /^\s*#include\s+/, @lines;
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    46
  my @includefiles = ();
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    47
  foreach my $includeline (@includelines)
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    48
    {
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    49
    if ($includeline =~ /^\s*#include\s+["<](.*\.([^.]+))[">]/)
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    50
      {
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    51
      my $filename = $1;
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    52
      my $extension = $2;
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    53
      
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    54
      # print "++ $filename ($extension)\n";
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    55
      if ($extension =~ /mbg|rsg/i)
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    56
        {
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    57
        # generated file referenced by #include
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    58
        push @{$includelistref}, $filename; 
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    59
        print STDERR "** $file - $includeline";
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    60
        }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    61
      }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    62
    }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    63
  
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    64
  my @apitaglines = grep /\@published|\@internal/, @lines;
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    65
  if (scalar @apitaglines == 0)
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    66
    {
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    67
    # no API classification tags - must be "Public by export" 
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    68
    return "Public by export";
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    69
    }
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    70
  else
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    71
    {
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    72
    if ($debug)
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    73
      {
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    74
      print join("\n\t", $file, @apitaglines), "\n";
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    75
      }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    76
    my @publishedAll = grep /\@publishedAll/, @apitaglines;
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    77
    if (scalar @publishedAll == 0)
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    78
      {
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    79
      # the API classification tags are all @publishedPartner or @internal
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    80
      return "Platform by tag";
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    81
      }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    82
    # contains at least one @publishedAll element - must be "Public by tag"
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    83
    return "Public by tag";
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    84
    }
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    85
  }
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    86
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    87
my %location_by_filename;
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    88
my %precedent;
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    89
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    90
# Read list of Symbian^1 files
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    91
my $line;
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    92
while ($line = <>)
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    93
  {
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    94
  chomp $line;
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    95
  $line =~ s/\\/\//g; # Unix separators please
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    96
  if ($line =~ /(epoc32\/include\/(.*\/)?([^\/]+))\s*$/)
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    97
    {
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    98
    my $fullname = $1;
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
    99
    my $filename = $3;
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   100
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   101
    $precedent{lc $fullname} = $fullname;
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   102
    }
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   103
  }
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   104
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   105
# Process epoc32\include tree
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   106
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   107
my %rationale;
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   108
my %origin;
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   109
my %ignoring_case;
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   110
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   111
sub scan_directory($$)
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   112
  {
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   113
  my ($path, $name) = @_;
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   114
  
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   115
  opendir DIR, $path;
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   116
  my @files = grep !/^\.\.?$/, readdir DIR;
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   117
  closedir DIR;
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   118
  
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   119
  foreach my $file (@files)
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   120
    {
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   121
    my $newpath = "$path/$file";
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   122
    my $newname = "$name/$file";
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   123
    
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   124
    if (-d $newpath)
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   125
      {
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   126
      scan_directory($newpath, $newname);
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   127
      next;
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   128
      }
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   129
    
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   130
    $origin{$newname} = "Symbian^2";
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   131
    $ignoring_case{lc $newname} = $newname;
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   132
    
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   133
    my @includefiles = ();
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   134
    my $reason = analyse_api($newpath,$newname, \@includefiles);
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   135
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   136
    if (defined $precedent{lc $newname})
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   137
      {
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   138
      $origin{$newname} = "Symbian^1";  # present in Symbian^1 list of Public apis
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   139
      if ($reason !~ /Public/)
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   140
        {
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   141
        $reason = "Public by precedent";    # was made public in Symbian^1
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   142
        }
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   143
      }
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   144
    $rationale{$newname} = $reason;
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   145
 
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   146
    if ($reason =~ /Public/)
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   147
      {
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   148
      push @public_included, @includefiles;   # #included files are therefore also public
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   149
      }
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   150
    }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   151
  }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   152
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   153
scan_directory("/epoc32/include", "epoc32/include");
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   154
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   155
# Add the generated files which are included in public API files
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   156
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   157
foreach my $file (@public_included)
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   158
  {
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   159
  # print "PUBLIC\tepoc32/include/$file\tIncluded\n";
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   160
  my $newname = "epoc32/include/$file";
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   161
  $newname = $ignoring_case{lc $newname};
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   162
  $rationale{$newname} = "Public by Inclusion";
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   163
  }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   164
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   165
# Look for Symbian^1 files which have moved or simply been deleted
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   166
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   167
foreach my $file (values %precedent)
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   168
  {
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   169
  if (!defined $origin{$file})
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   170
    {
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   171
    $rationale{$file} = "Deleted";
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   172
    $origin{$file} = "Symbian^1";
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   173
    }
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   174
  }
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   175
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   176
print "Filename\tClassification\tReason\tOrigin\n";
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   177
foreach my $file (sort keys %rationale)
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   178
  {
4
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   179
  my $reason = $rationale{$file};
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   180
  my $classification = "Platform";
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   181
  $classification = "Public" if ($reason =~ /Public/);
60053dab7e2a Update scan_antlogs.pl to use "No rule to make" lines to infer more missing things
William Roberts <williamr@symbian.org>
parents: 3
diff changeset
   182
  print "$file\t$classification\t$reason\t$origin{$file}\n";
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   183
  }