#!/usr/bin/perl
# Check symbols exported by a library
# (c) 2014 Martin Mares <mj@ucw.cz>

use common::sense;

my $lib = $ARGV[0] or die "Usage: $0 <library>\n";
open my $f, '-|', 'nm', $lib or die;
while (<$f>) {
	chomp;
	next if /^\s/;
	my ($addr, $type, $sym) = split /\s+/;
	if ($sym =~ m{^(ucw|ucwlib)_}) {
		next
	}
	if ($type =~ m{[A-Z]}) {
		print "$sym ($type)\n";
	}
}
close $f or die;