HTML_Generator/RB_HTML_Generate_Char [ Functions ]

NAME

RB_HTML_Generate_Char -- generate a single character for an item.

SYNOPSIS

void RB_HTML_Generate_Char(
    FILE *dest_doc,
    int c )

FUNCTION

This function is called for every character that goes into an item's body. This escapes all the reserved HTML characters such as '&', '<', '>', '"'.

SOURCE

{
    switch ( c )
    {
    case '\n':
        assert( 0 );
        break;
    case '\t':
        assert( 0 );
        break;
    case '<':
        fprintf( dest_doc, "&lt;" );
        break;
    case '>':
        fprintf( dest_doc, "&gt;" );
        break;
    case '&':
        fprintf( dest_doc, "&amp;" );
        break;
    default:
        // All others are printed literally
        fputc( c, dest_doc );
    }
}