home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / Eudora 1.3.1 / source / Bits / ProcessStrings < prev    next >
Encoding:
Text File  |  1993-03-16  |  664 b   |  27 lines  |  [TEXT/????]

  1. Perl -x "{0}" {"parameters"} ; exit
  2. #!/usr/local/bin/perl
  3. open(SRC,"<" . $ARGV[0]) || die;
  4. open(DEFS,">" . $ARGV[1]) || die;
  5. open(RFIL,">" . $ARGV[2]) || die;
  6. open(DOC,">" . $ARGV[3]) || die;
  7. $str=5400;
  8. $gran=20;
  9. $elem=$gran+1;
  10.  
  11. while (<SRC>)
  12. {
  13.   if ($elem>=$gran)
  14.   {
  15.     if ($elem==$gran) {print RFIL '""}};' . "\n";}
  16.     $elem = 0;
  17.     $str += 200;
  18.     printf RFIL "resource 'STR#' (%d,purgeable) {{\n",$str;
  19.   }
  20.   chop;
  21.   split(/\t/);
  22.   printf DEFS "#define %s\t%d\n",$_[0],$str + ++$elem;
  23.   print RFIL '  "' . $_[1] . '",' . "\n";
  24.   if ($_[2] ne "") {printf DOC "%4d %s %s\n",$str+$elem,$_[0],$_[2];}
  25. }
  26.  
  27. if ($elem && $elem<=$gran) {print RFIL '""}};' . "\n";}