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.

59 lines
1.8 KiB

  1. # convert .mc files to Comet .md files
  2. # .md files contains on-line help information per error message in addition
  3. # to the regular .mc content
  4. #
  5. # this script should be used once to convert the existing .mc files to the
  6. # new format
  7. function UpCase(str) {
  8. up = ""
  9. for (i=1; i <= length(str) ; i++) {
  10. c = substr(str, i, 1)
  11. if ( c >= "a" && c <= "z") {
  12. c = substr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", index("abcdefghijklmnopqrstuvwxyz", c), 1)
  13. }
  14. up = up c
  15. }
  16. return up
  17. }
  18. BEGIN {
  19. _Pref = "#"
  20. print "|========= Notice! ============"
  21. print "|Lines starting with '|' are discarded by the preprocessor"
  22. print "|Lines starting with " _Pref " contains code and should not be modified by UA"
  23. print "|Lines between --> and --> are for online documentation"
  24. print "|Developer: when adding a new message:"
  25. print "| 1. preserve the format"
  26. print "| 2. specify Owner=your-email Status= NoReview"
  27. print "| 3. add preliminary on-line information"
  28. print "\n\n\n"
  29. }
  30. {
  31. Fld1 = UpCase($1);
  32. if ( _InText ) {
  33. if ( $1 == "." ) {
  34. print _Pref $0
  35. _InText = 0;
  36. print "--> " _Header " OnLine help text"
  37. print "-->"
  38. } else if (Fld1 ~ "SEVERITY=" || Fld1 ~ "SYMBOLICNAME=" || Fld1 ~ "FACILITY=" || Fld1 ~ "LANGUAGE=") {
  39. print _Pref $0
  40. } else {
  41. print $0
  42. }
  43. } else if ( Fld1 ~ "MESSAGEID=" ) {
  44. _InText = 1;
  45. _Header = $1
  46. print "| Owner= "
  47. print "| Status= NoReview"
  48. print _Pref $0
  49. } else {
  50. print _Pref $0
  51. }
  52. }