home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tkisrc04.zip / tk / os2 / rc / fixrc.pl < prev    next >
Encoding:
Text File  |  1998-08-07  |  700 b   |  40 lines

  1. while (<>) {
  2.   if (/^VS_VERSION_INFO/) {
  3.     while (<>) {
  4.       $_ = <>, last if /^END/;
  5.     }
  6.   }
  7.   $icons{$1}++ if /^(\w+)\s+(CURSOR|ICON)\s+DISCARDABLE\s+\"[\w.]+\"\s*$/;
  8.   s/^icon\b/xicon/;
  9.   print;
  10.   print <<EOI if /\#include\s+<patchlevel\.h>/;
  11. #include "tkwin.HHH"
  12. EOI
  13. }
  14.  
  15. open H, ">cursors.h" or die "Cannot open cursors.h: $!";
  16. print H <<EOP;
  17.  
  18. #include "rc/tkwin.HHH"
  19.  
  20. typedef struct {
  21.   char* name;
  22.   int   id;
  23. } myCursor;
  24.  
  25. static myCursor cursors[] = {
  26. EOP
  27.  
  28. for (sort keys %icons) {
  29.   $name = $_;
  30.   $name = 'xicon' if $name eq 'icon';
  31.   print H "  {\"$_\", $name},\n"
  32. }
  33.  
  34. print H <<EOP;
  35.   {NULL, 0}
  36. };
  37.  
  38. EOP
  39. close H or die "Cannot close cursors.h: $!";
  40.