1 line
1.2 KiB
Plaintext
Executable File
1 line
1.2 KiB
Plaintext
Executable File
open(REZ,">$ARGV[0].strn") || die "$rez";
|
|
open(H,">:include:$ARGV[0].h") || die "$h";
|
|
open(DOC,">$ARGV[0].doc") || die "$doc";
|
|
|
|
print H "#ifndef STRNDEFS_H\n#define STRNDEFS_H\n\n";
|
|
while (<>)
|
|
{
|
|
if (/^#/) {print REZ; print H; next;}
|
|
chop;
|
|
if (/^$/) {next;}
|
|
if (/^R\t/)
|
|
{
|
|
if ($resName ne "") {&finish;}
|
|
($r,$resName,$id,$comment) = split("\t");
|
|
#
|
|
# resource declaration
|
|
#
|
|
print REZ "resource 'STR#' ($id,purgeable) {{\n";
|
|
#
|
|
# include file
|
|
#
|
|
print H "#define $resName"."Strn $id\n";
|
|
print H "typedef enum {\n";
|
|
#
|
|
# doc file
|
|
#
|
|
if ($comment ne "") {print DOC "$id - $comment\n";}
|
|
#
|
|
# we've got a definition going
|
|
#
|
|
$num = 1;
|
|
}
|
|
else
|
|
{
|
|
($name,$value,$comment) = split("\t");
|
|
#
|
|
# resource declaration
|
|
#
|
|
print REZ qq?\t"$value",\n?;
|
|
#
|
|
# include file
|
|
#
|
|
if ($name ne "")
|
|
{
|
|
print H "\t$name";
|
|
if ($num==1) {print H "=1";}
|
|
print H ",";
|
|
if ($num>1) {print H " /*$num*/ ";}
|
|
if ($comment ne "") {print H "/* $comment */";}
|
|
print H "\n";
|
|
}
|
|
#
|
|
# doc file
|
|
#
|
|
if ($comment ne "")
|
|
{
|
|
printf DOC "%5d - %s\n",$comment;
|
|
}
|
|
$num++;
|
|
}
|
|
}
|
|
&finish;
|
|
print H "\n#endif\n";
|
|
|
|
sub finish
|
|
{
|
|
print REZ "}};\n";
|
|
print H "\t$resName"."Limit,\n\t$resName"."MakeLong=-1000000\n} $resName"."Enum;\n";
|
|
} |