File: insert_links.pl

package info (click to toggle)
vpb-driver 4.2.52-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,508 kB
  • ctags: 5,880
  • sloc: cpp: 26,240; ansic: 19,045; sh: 3,027; perl: 1,132; makefile: 756; asm: 182
file content (30 lines) | stat: -rwxr-xr-x 635 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl -w
# David Rowe 16/1/03
# used to modify first pass sgml files to include hyperlinks to ref doc

($file_in,$file_out)=@ARGV;

print "input: $file_in output: $file_out\n";

open(FIN, $file_in) || die "Couldn't open $file_in: $!\n";
@text_in = <FIN>;
close(FIN);

foreach $s (@text_in) {
    if ($s=~ /<function>(vpb_.*)\(\)<\/function>/){
	$foo=$1;
	$foo =~ s/_/-/g;
	$s=~ s/<function>(vpb_.*)\(\)<\/function>/<function><link linkend=\"$foo\">$1\(\)<\/link><\/function>/;
    }

    @text_out = (@text_out, $s);
}

open(FOUT, ">$file_out") || die "Couldn't open $file_out: $!\n";
print FOUT @text_out;
close(FOUT);