Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.9 KiB

  1. #!/usr/bin/perl
  2. #
  3. # unicodepartition_makeheader.pl
  4. #
  5. # [email protected]
  6. # June 16, 1998
  7. #
  8. # Make a header file for the Unicode partition table mapping. This table
  9. # provides mapping for wchar_t to partition ID.
  10. #
  11. $num = 0;
  12. open OUTFILE, ">unipart.hxx" ;
  13. printf OUTFILE "//+---------------------------------------------------------------------------\n";
  14. printf OUTFILE "//\n";
  15. printf OUTFILE "// Microsoft Trident\n";
  16. printf OUTFILE "// Copyright (C) Microsoft Corporation, 1998 - 2000.\n";
  17. printf OUTFILE "//\n";
  18. printf OUTFILE "// File: unipart.hxx\n";
  19. printf OUTFILE "//\n";
  20. printf OUTFILE "// This is a generated file. Do not modify by hand.\n";
  21. printf OUTFILE "//\n";
  22. printf OUTFILE "// Generating script: %s\n", __FILE__;
  23. printf OUTFILE "// Generated on %s\n", scalar localtime;
  24. printf OUTFILE "//\n";
  25. printf OUTFILE "//----------------------------------------------------------------------------\n";
  26. printf OUTFILE "\n";
  27. print OUTFILE "#ifndef I_UNIPART_HXX_\n";
  28. print OUTFILE "#define I_UNIPART_HXX_\n";
  29. print OUTFILE "#pragma INCMSG(\"--- Beg 'unipart.hxx'\")\n";
  30. print OUTFILE "typedef BYTE CHAR_CLASS;\n\n";
  31. while (<>)
  32. {
  33. next unless /^<h3>\d+./;
  34. ($catnum,$names,$description) = /<h3>(\d+). +(.*) - ([^<]*)/;
  35. for $name (split /, +/, $names)
  36. {
  37. @nametbl[$num] = $name;
  38. printf OUTFILE ("#define %s %-3d // %3d - %s\n", $name, $num, $catnum, $description);
  39. $num++;
  40. }
  41. }
  42. print OUTFILE "\n#define CHAR_CLASS_MAX $num\n\n";
  43. for $name (@nametbl)
  44. {
  45. print OUTFILE "#define __$name (CHAR_CLASS *)$name\n";
  46. }
  47. print OUTFILE "\n";
  48. print OUTFILE "extern const CHAR_CLASS acc_00[256];\n";
  49. print OUTFILE "\n";
  50. print OUTFILE "#pragma INCMSG(\"--- End 'unipart.hxx'\")\n";
  51. print OUTFILE "#else\n";
  52. print OUTFILE "#pragma INCMSG(\"*** Dup 'unipart.hxx'\")\n";
  53. print OUTFILE "#endif\n";
  54. close OUTFILE;