Core agent is now working on NetWare
[public/netxms.git] / tools / nwmkimp.pl
1 #!c:/apps/perl/bin/pelr -w
2
3 ###############################################################################
4 #
5 # Create import file for NLM based on i586-netware-nm.exe output
6 #
7 ###############################################################################
8
9 use strict;
10
11 my $inFile = shift || die "Usage : nxmkimp.pl <input_file> <output_file>";
12 my $outFile = shift || die "Usage : nxmkimp.pl <input_file> <output_file>";
13
14 my $i;
15 my $j;
16
17 open(OUT, ">$outFile") || die "out: $!";
18
19 my @sym_list = `i586-netware-nm $inFile | grep -e " [BGTRD] " | cut -d" " -f3`;
20 my @exp_list;
21
22 for ($i = 0, $j = 0; $i <= $#sym_list; $i++)
23 {
24 chomp $sym_list[$i];
25 if ($sym_list[$i] =~ /^main$|^_init$|^_fini$|^__EH_FRAME.*|^g_.*|^I_.*/)
26 {
27 }
28 else
29 {
30 $exp_list[$j++] = $sym_list[$i];
31 }
32 }
33
34 for ($i = 0; $i < $#exp_list; $i++)
35 {
36 print OUT " $exp_list[$i],\n";
37 }
38 print OUT " $exp_list[$i]\n";
39
40 close OUT;
41 exit 0;