HTML_Generator/RB_HTML_Generate_Label [ Functions ]

FUNCTION

Generate a label (name) that can be refered too. A label should consist of only alphanumeric characters so all 'odd' characters are replaced with their ASCII code in hex format.

SYNOPSIS

void RB_HTML_Generate_Label(
    FILE *dest_doc,
    char *name )

INPUTS

SOURCE

{
    int                 i;
    int                 l = strlen( name );
    unsigned char       c;

    fprintf( dest_doc, "<a name=\"" );
    for ( i = 0; i < l; ++i )
    {
        c = name[i];
        if ( utf8_isalnum( c ) )
        {
            RB_HTML_Generate_Char( dest_doc, c );
        }
        else
        {
            char                buf[4];

            sprintf( buf, "%02x", c );
            RB_HTML_Generate_Char( dest_doc, buf[0] );
            RB_HTML_Generate_Char( dest_doc, buf[1] );
        }
    }
    fprintf( dest_doc, "\"></a>\n" );
}