summaryrefslogtreecommitdiff
path: root/src/dox-comments.pl
blob: 2850928c08673d11bdcb416029b056eafb9f4f15 (plain)
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
31
32
33
34
35
36
#!/usr/bin/perl

for $file (@ARGV)
{
    print "$file\n";

    if (!open(FILE, $file))
    {
        print "Cannot open $file: $!\n";
        next;
    }
    
    if (-e "$file.$$")
    {
        print "$file.$$ already exists, I will not klobber.\n";
        next;
    }
    
    if (!open(OUT, ">$file.$$"))
    {
        print "Cannot open $file.$$: $!\n";
        next;
    }

    while (<FILE>)
    {
        s#^/\*\+\+#/\*\*#g;
        s#^\-\-\*/#\*\*/#g;
        print OUT;
    }
    close(FILE);
    close(OUT);
    print "processed $file\n";

    system "/bin/mv -f $file.$$ $file";
}