annotate tools/incpri.pl @ 560:d6ff45d719a5 string-shared

string sharing
author kono
date Sat, 07 Jan 2006 18:11:53 +0900
parents a379da780856
children e055df7c1082
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
466
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
1 #!/usr/bin/perl
491
a379da780856 cond signed/unsigned
kono
parents: 466
diff changeset
2
a379da780856 cond signed/unsigned
kono
parents: 466
diff changeset
3 for(@ARGV) {
a379da780856 cond signed/unsigned
kono
parents: 466
diff changeset
4 my $filename = $_;
a379da780856 cond signed/unsigned
kono
parents: 466
diff changeset
5 rename($filename,$filename.".bak");
a379da780856 cond signed/unsigned
kono
parents: 466
diff changeset
6 open(IN,"<$filename.bak");
a379da780856 cond signed/unsigned
kono
parents: 466
diff changeset
7 open(OUT,">$filename");
a379da780856 cond signed/unsigned
kono
parents: 466
diff changeset
8 $d = "0000";
a379da780856 cond signed/unsigned
kono
parents: 466
diff changeset
9 while(<IN>) {
a379da780856 cond signed/unsigned
kono
parents: 466
diff changeset
10 s/printf\(\"\#\d+\:/printf\(\"\#$d\:/;
a379da780856 cond signed/unsigned
kono
parents: 466
diff changeset
11 s/printf\(\"([^#])/printf\(\"\#$d\:$1/;
a379da780856 cond signed/unsigned
kono
parents: 466
diff changeset
12 $d++;
a379da780856 cond signed/unsigned
kono
parents: 466
diff changeset
13 print OUT;
a379da780856 cond signed/unsigned
kono
parents: 466
diff changeset
14 }
466
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
15 }