cvsuser 04/11/09 09:46:58
Modified: tools/dev parrot_api.pl
Log:
Use also the include/parrot/extend.h.
Revision Changes Path
1.4 +22 -18 parrot/tools/dev/parrot_api.pl
Index: parrot_api.pl
===================================================================
RCS file: /cvs/public/parrot/tools/dev/parrot_api.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- parrot_api.pl 8 Nov 2004 07:27:06 -0000 1.3
+++ parrot_api.pl 9 Nov 2004 17:46:58 -0000 1.4
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
# Copyright: 2004 The Perl Foundation. All Rights Reserved.
-# $Id: parrot_api.pl,v 1.3 2004/11/08 07:27:06 jhi Exp $
+# $Id: parrot_api.pl,v 1.4 2004/11/09 17:46:58 jhi Exp $
=head1 NAME
@@ -14,18 +14,19 @@
Displays the API (the visible symbols, code or data) of the Parrot lib.
-First lists the Parrot public embedding API as described in the
-F<include/parrot/embed.h> (using pattern C</^\w+\s+(Parrot_\w+)\(/>),
-then finds out the visible symbols in the Parrot lib (by default
+First lists the Parrot public embedding API as described in the public
+headers F<include/parrot/embed.h> and F<include/parrot/extend.h> (the
+API is detected using pattern C</^\w+\s+(Parrot_\w+)\(/>), then finds
+out the visible symbols in the Parrot lib (by default
F<blib/lib/libparrot.a>), and then cross-references the dubious API
-symbols according to the below categories. Each symbol is listed
-with the object file it was found in.
+symbols according to the below categories. Each symbol is listed with
+the object file it was found in.
=over 4
=item Missing Parrot API
-API listed in F<include/parrot/embed.h> but not defined in the Parrot lib.
+API listed in the public headers or but not defined in the Parrot lib.
Either the API listing is wrong or the implementation is missing.
@@ -42,7 +43,7 @@
=item No Parrot API
-API implemented in the lib but not defined in F<inlucde/parrot/embed.h>.
+API implemented in the lib but not defined in the public headers.
If code, consider making the API private (local) or splitting
it off to a Parrot-private library.
@@ -90,23 +91,26 @@
$| = 1;
-my $H = "include/parrot/embed.h";
-if (open(H, $H)) {
- while (<H>) {
- if (/^\w+\s+(Parrot_\w+)\(/) {
- $ParrotAPI{$1}++;
+my @H = qw(include/parrot/embed.h include/parrot/extend.h);
+
+for my $h (@H) {
+ if (open(H, $h)) {
+ while (<H>) {
+ if (/^\w+\s+(Parrot_\w+)\(/) {
+ $ParrotAPI{$1}++;
+ }
}
+ close(H);
+ } else {
+ die "$0: Header '$h': $!\n";
}
- close(H);
-} else {
- die "$0: Header '$H': $!\n";
}
my @ParrotAPI = sort keys %ParrotAPI;
-die "$0: No API found in '$H'\n" unless @ParrotAPI;
+die "$0: No API found in @H\n" unless @ParrotAPI;
-printf "=== $H: %d interfaces ===\n", scalar @ParrotAPI;
+printf "=== @H: %d interfaces ===\n", scalar @ParrotAPI;
my %Code;
my %DataB;