williamr/find_public_apis.pl
author William Roberts <williamr@symbian.org>
Wed, 03 Jun 2009 18:33:51 +0100
changeset 3 8b87ea768cb8
parent 2 a600c1a596f7
child 4 60053dab7e2a
permissions -rw-r--r--
Add a utility to convert raptor timestamps back into localtime. Lots of change to the find_public_apis.pl script, trying to get more insight Add filename globbing to the sbs_findstr.pl script, so you can scan *compile*
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
my $reason;
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    25
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
sub is_public_api($$)
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    27
  {
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
  my ($file,$name) = @_;
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
  
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
  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
    31
    {
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
    # /epoc32/include/platform files are "Platform by export"
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    33
    $reason = "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
    34
    return 0; # Not public
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
    }
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
  
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    37
  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
    38
    {
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    39
    # Not a file which contains APIs anyway
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    40
    $reason = "Wrong extension";
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    41
    return 0; # not public
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    42
    }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    43
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
  open FILE, "<$file" or print "ERROR: Cannot open $file: $!\n" and return 1; # assume Public
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
  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
    46
  close FILE;
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
  
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    48
  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
    49
  my @includefiles = ();
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    50
  foreach my $includeline (@includelines)
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    51
    {
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    52
    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
    53
      {
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    54
      my $filename = $1;
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    55
      my $extension = $2;
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
      # print "++ $filename ($extension)\n";
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    58
      if ($extension =~ /mbg|rsg|rls|ra/i)
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    59
        {
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    60
        # generated file referenced by #include
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    61
        push @includefiles, $filename; 
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    62
        print STDERR "** $file - $includeline";
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    63
        }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    64
      }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    65
    }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    66
  
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    67
  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
    68
  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
    69
    {
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    70
    # no API classification tags - must be "Public by export" 
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    71
    $reason = "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
    72
    }
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    73
  else
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    74
    {
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    75
    if ($debug)
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    76
      {
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    77
      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
    78
      }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    79
    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
    80
    if (scalar @publishedAll == 0)
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
      # the API classification tags are all @publishedPartner or @internal
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    83
      $reason = "Platform by tag";
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    84
      return 0; # not public
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    85
      }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    86
    # contains at least one @publishedAll element - must be "Public by tag"
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    87
    $reason = "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
    88
    }
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    89
  push @public_included, @includefiles;   # #included files are therefore also public
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    90
  return 1; # Public API
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    91
  }
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    92
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    93
my %classification;
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    94
my %origin;
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    95
my %ignoring_case;
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    96
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    97
sub scan_directory($$)
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    98
  {
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
    99
  my ($path, $name) = @_;
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   100
  
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   101
  opendir DIR, $path;
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   102
  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
   103
  closedir DIR;
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   104
  
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   105
  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
   106
    {
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   107
    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
   108
    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
   109
    
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   110
    if (-d $newpath)
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   111
      {
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   112
      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
   113
      next;
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
    
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   116
    if (is_public_api($newpath,$newname))
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   117
      {
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   118
      # print "PUBLIC\t$newname\t$reason\n";
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   119
      }
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   120
    else
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   121
      {
3
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   122
      # print "PARTNER\t$newname\t$reason\n";
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   123
      }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   124
    $classification{$newname} = $reason;
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   125
    $origin{$newname} = "Symbian^2";
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   126
    $ignoring_case{lc $newname} = $newname;
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   127
    }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   128
  }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   129
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   130
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
   131
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   132
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
   133
  {
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   134
  # 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
   135
  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
   136
  $newname = $ignoring_case{lc $newname};
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   137
  $classification{$newname} = "Public by Inclusion";
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   138
  }
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   139
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   140
# Read list of Symbian^1 files
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   141
my $line;
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   142
while ($line = <>)
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   143
  {
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   144
  chomp $line;
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   145
  $line =~ s/\\/\//g; # Unix separators please
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   146
  if ($line =~ /(epoc32\/include\/.*)\s*$/)
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   147
    {
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   148
    my $name = $1;
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   149
    $origin{$name} = "Symbian^1";
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   150
    if (!defined $ignoring_case{lc $name})
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
      $classification{$name} = "Deleted";
2
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   153
      }
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   154
    }
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
diff changeset
   155
  }
a600c1a596f7 Create "williamr" directory in utilities, and add an assortment of Perl scripts
William Roberts <williamr@symbian.org>
parents:
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
print "Filename\tClassification\tReason\tOrigin\n";
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   158
foreach my $file (sort keys %classification)
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   159
  {
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   160
  my $reason = $classification{$file};
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   161
  my $type = "Platform";
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   162
  $type = "Public" if ($reason =~ /Public/);
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   163
  print "$file\t$type\t$reason\t$origin{$file}\n";
8b87ea768cb8 Add a utility to convert raptor timestamps back into localtime.
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
   164
  }