mirror of https://github.com/tongzx/nt5src
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.
145 lines
2.2 KiB
145 lines
2.2 KiB
// htmprint.c
|
|
//
|
|
// Routines to print to either console or HTML formated console.
|
|
//
|
|
// controled by 'bHtmlStyle'. If TRUE, we will output HTML.
|
|
//
|
|
|
|
BOOL bHtmlStyle= FALSE;
|
|
|
|
|
|
VOID TableHeader(VOID)
|
|
{
|
|
|
|
if( bHtmlStyle )
|
|
{
|
|
printf( "<TABLE BORDER CELLPADDING=\"0\">\n" );
|
|
}
|
|
}
|
|
|
|
VOID TableTrailer(VOID)
|
|
{
|
|
|
|
if( bHtmlStyle )
|
|
{
|
|
printf( "</TABLE>\n" );
|
|
}
|
|
}
|
|
|
|
|
|
VOID TableStart(VOID)
|
|
{
|
|
if( bHtmlStyle )
|
|
{
|
|
printf( "<TR>\n");
|
|
}
|
|
}
|
|
|
|
VOID TableField( CHAR* pszFormat, CHAR* pszDatum )
|
|
{
|
|
if( bHtmlStyle )
|
|
{
|
|
printf("<TD VALIGN=TOP> ");
|
|
}
|
|
|
|
printf(pszFormat,pszDatum);
|
|
|
|
if( bHtmlStyle )
|
|
{
|
|
printf(" </TD>\n");
|
|
}
|
|
}
|
|
|
|
VOID TableNum( CHAR* pszFormat, INT Datum )
|
|
{
|
|
if( bHtmlStyle )
|
|
{
|
|
printf("<TD VALIGN=TOP> ");
|
|
}
|
|
|
|
printf(pszFormat,Datum);
|
|
|
|
if( bHtmlStyle )
|
|
{
|
|
printf(" </TD>\n");
|
|
}
|
|
}
|
|
|
|
|
|
// Print string making sure the string won't break (nbsp)
|
|
|
|
VOID TableSS( CHAR* pszFormat, CHAR* pszDatum )
|
|
{
|
|
if( bHtmlStyle )
|
|
{
|
|
printf("<TD VALIGN=TOP> ");
|
|
}
|
|
|
|
if( bHtmlStyle )
|
|
{
|
|
INT i;
|
|
|
|
for( i=0; (i<lstrlen(pszDatum)); i++ )
|
|
{
|
|
if( pszDatum[i] != ' ' )
|
|
{
|
|
printf("%c",pszDatum[i]);
|
|
}
|
|
else
|
|
{
|
|
printf(" ");
|
|
}
|
|
}
|
|
printf(" ");
|
|
}
|
|
else
|
|
{
|
|
printf(pszFormat,pszDatum);
|
|
}
|
|
|
|
if( bHtmlStyle )
|
|
{
|
|
printf("</TD>\n");
|
|
}
|
|
|
|
}
|
|
|
|
VOID TableEmail( CHAR* pszFormat, CHAR* pszDatum )
|
|
{
|
|
if( bHtmlStyle )
|
|
{
|
|
printf("<TD VALIGN=TOP> ");
|
|
printf("<A href=\"mailto:%s\"> %s </a>",pszDatum, pszDatum );
|
|
printf(" </TD>\n");
|
|
}
|
|
else
|
|
{
|
|
printf(pszFormat,pszDatum);
|
|
}
|
|
|
|
}
|
|
|
|
VOID TableBugID( CHAR* pszFormat, CHAR* pszDatum )
|
|
{
|
|
if( bHtmlStyle )
|
|
{
|
|
printf("<TD VALIGN=TOP> ");
|
|
printf("<A href=\"http://nitest/ntraid/raid_det.asp?BugID=%p\"> %p </a>",pszDatum, pszDatum );
|
|
printf(" </TD>\n");
|
|
}
|
|
else
|
|
{
|
|
printf(pszFormat,pszDatum);
|
|
}
|
|
|
|
}
|
|
|
|
VOID TableEnd(VOID)
|
|
{
|
|
if( bHtmlStyle )
|
|
{
|
|
printf( "</TR>\n");
|
|
}
|
|
printf("\n");
|
|
}
|
|
|