File: m_t.pl

package info (click to toggle)
moxftp 2.2-18.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 4,160 kB
  • ctags: 3,837
  • sloc: ansic: 43,420; makefile: 353; perl: 262; sh: 192
file content (24 lines) | stat: -rwxr-xr-x 415 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
open(output,">tran_table.c");
print output "#include <stdio.h>\n";
print output "char *tran_table[] = {\n";
open(input, "dotxftp");
while (<input>) {
	chop;
	if (/^translation/) {
	    $tran = 1;
	} 
 	if ($tran) {
	    print output "\"",do fix($_),"\",\n";
	}
        if (/^end/) {
	    $tran = 0;
	}
}

sub fix {
    local($string) = @_[0];
    $string =~ s/\\/\\\\/g;
    $string;
}

print output "NULL,\n};\n";