alecf%netscape.com 0eda784b7f autogenerate preference-name headers for unix
autoconf makefile on the way.


git-svn-id: svn://10.0.0.236/trunk@12752 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-13 23:38:27 +00:00

23 lines
502 B
Perl

#!/usr/local/bin/perl
# usually you just run $(PERL) this file though
while (<ARGV>) {
if (/(config|pref|localDefPref)\s*\(\"([^\"]*)\"/) {
# $2 now contains the pref name
$define = $pref_name = $2;
$define =~ tr/a-z/A-Z/;
$define =~ s/\./_/g;
# uniqify the list by dumping everything into a hash
$preftable{"PREF_$define"} = "\"$pref_name\""
}
}
# print out the final table
foreach $pref (sort keys %preftable) {
print "#define $pref $preftable{$pref}\n";
}