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.

44 lines
868 B

  1. #
  2. # dirclass_verify.pl
  3. #
  4. # [email protected]
  5. # 31 Jul 1998
  6. #
  7. # Checks the validity of the directional classifications file generated by
  8. # dirclass_extract.pl.
  9. #
  10. %dirlist = ();
  11. $last = -1;
  12. while (<>)
  13. {
  14. /^([0-9a-fA-F]{4}) (\w\w\w)/;
  15. $char = hex($1);
  16. $dir = $2;
  17. if ($char != $last + 1)
  18. {
  19. $error = sprintf("List out of order at character %d\n", $char);
  20. die($error);
  21. }
  22. if (!($dir =~ /^(UNK|LTR|RTL|ARA|WSP|NEU|SEG|BLK|ANM|ENM|ETM|ESP|CSP|FMT|CBN)$/))
  23. {
  24. $error = sprintf("Unknown classification '%s' for character %d\n", $dir, $char);
  25. die($error);
  26. }
  27. $dirlist{$dir}++;
  28. $last++;
  29. }
  30. $cchTotal = 0;
  31. while (($dir, $cch) = each(%dirlist))
  32. {
  33. printf("%s\t%s\n", $dir, $cch);
  34. $cchTotal += $cch;
  35. }
  36. printf("\n%d total characters\n", $cchTotal);