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.

144 lines
2.4 KiB

  1. // htmprint.c
  2. //
  3. // Routines to print to either console or HTML formated console.
  4. //
  5. // controled by 'bHtmlStyle'. If TRUE, we will output HTML.
  6. //
  7. BOOL bHtmlStyle= FALSE;
  8. VOID TableHeader(VOID)
  9. {
  10. if( bHtmlStyle )
  11. {
  12. printf( "<TABLE BORDER CELLPADDING=\"0\">\n" );
  13. }
  14. }
  15. VOID TableTrailer(VOID)
  16. {
  17. if( bHtmlStyle )
  18. {
  19. printf( "</TABLE>\n" );
  20. }
  21. }
  22. VOID TableStart(VOID)
  23. {
  24. if( bHtmlStyle )
  25. {
  26. printf( "<TR>\n");
  27. }
  28. }
  29. VOID TableField( CHAR* pszFormat, CHAR* pszDatum )
  30. {
  31. if( bHtmlStyle )
  32. {
  33. printf("<TD VALIGN=TOP>&nbsp");
  34. }
  35. printf(pszFormat,pszDatum);
  36. if( bHtmlStyle )
  37. {
  38. printf("&nbsp</TD>\n");
  39. }
  40. }
  41. VOID TableNum( CHAR* pszFormat, INT Datum )
  42. {
  43. if( bHtmlStyle )
  44. {
  45. printf("<TD VALIGN=TOP>&nbsp");
  46. }
  47. printf(pszFormat,Datum);
  48. if( bHtmlStyle )
  49. {
  50. printf("&nbsp</TD>\n");
  51. }
  52. }
  53. // Print string making sure the string won't break (nbsp)
  54. VOID TableSS( CHAR* pszFormat, CHAR* pszDatum )
  55. {
  56. if( bHtmlStyle )
  57. {
  58. printf("<TD VALIGN=TOP>&nbsp");
  59. }
  60. if( bHtmlStyle )
  61. {
  62. INT i;
  63. for( i=0; (i<lstrlen(pszDatum)); i++ )
  64. {
  65. if( pszDatum[i] != ' ' )
  66. {
  67. printf("%c",pszDatum[i]);
  68. }
  69. else
  70. {
  71. printf("&nbsp");
  72. }
  73. }
  74. printf("&nbsp");
  75. }
  76. else
  77. {
  78. printf(pszFormat,pszDatum);
  79. }
  80. if( bHtmlStyle )
  81. {
  82. printf("</TD>\n");
  83. }
  84. }
  85. VOID TableEmail( CHAR* pszFormat, CHAR* pszDatum )
  86. {
  87. if( bHtmlStyle )
  88. {
  89. printf("<TD VALIGN=TOP>&nbsp");
  90. printf("<A href=\"mailto:%s\"> %s </a>",pszDatum, pszDatum );
  91. printf("&nbsp</TD>\n");
  92. }
  93. else
  94. {
  95. printf(pszFormat,pszDatum);
  96. }
  97. }
  98. VOID TableBugID( CHAR* pszFormat, CHAR* pszDatum )
  99. {
  100. if( bHtmlStyle )
  101. {
  102. printf("<TD VALIGN=TOP>&nbsp");
  103. printf("<A href=\"http://nitest/ntraid/raid_det.asp?BugID=%p\"> %p </a>",pszDatum, pszDatum );
  104. printf("&nbsp</TD>\n");
  105. }
  106. else
  107. {
  108. printf(pszFormat,pszDatum);
  109. }
  110. }
  111. VOID TableEnd(VOID)
  112. {
  113. if( bHtmlStyle )
  114. {
  115. printf( "</TR>\n");
  116. }
  117. printf("\n");
  118. }
  119.