Exemplo n.º 1
0
/* Repeat character c, n times. "a" indicates alternate character set.
 * x is the first column that we should be printing on. (used for a little
 * optimization)
 */
static void TI_REPEAT_CHAR( char c, int n, int a, ORD x )
/*******************************************************/
{
    bool        blank;
    int         len;
    char        *cparm_right;

    if(n==0)return;

    blank= OptimizeTerminfo && (TI_FillColourSet) && c==' ' && !a;

    if( blank
        && x==(UIData->width-n)
        && _capable_of( clr_eol )
        && (len=strlen(clr_eol))>0
        && n>len ){
            __putp( clr_eol );
    } else if( blank
        && x==0
        && _capable_of( clr_bol )
        && _capable_of( parm_right_cursor )
        && n>(len=(strlen( cparm_right=UNIX_TPARM2( parm_right_cursor, n ))+strlen(clr_bol)))
        && len>0 ){
            __putp( cparm_right );
            __putp( clr_bol );
    } else {
        if(a){
            TI_ACS_ON();
        }

        if( n>=TI_repeat_cutoff && _capable_of( repeat_char ) ) {
            __putp( UNIX_TPARM3( repeat_char, c, n ) );
        } else {
            for(; n>0; n--){
                fputc( c, UIConFile );
            }
        }

        if(a){
            TI_ACS_OFF();
        }
    }
}
Exemplo n.º 2
0
/* Repeat character c, n times. "a" indicates alternate character set.
 * x is the first column that we should be printing on. (used for a little
 * optimization)
 */
static void TI_REPEAT_CHAR( char c, int n, bool a, ORD x )
{
    bool        blank;
    int         len;
    char        *cparm_right;

    if( n == 0 )
        return;

    blank = OptimizeTerminfo && ( TI_FillColourSet ) && c == ' ' && !a;
    if( blank
      && x == ( UIData->width - n )
      && (len = strlen( clr_eol )) > 0
      && n > len ) {
        putp( clr_eol );
    } else if( blank
      && x == 0
      && clr_bol[0] != '\0'
      && n > (len = (strlen( cparm_right = tparm( parm_right_cursor, n )) + strlen( clr_bol ) ))
      && len > 0 ) {
        putp( cparm_right );
        putp( clr_bol );
    } else {
        if( a ) {
            TI_ACS_ON();
        }

        if( n >= TI_repeat_cutoff ) {
            putp( tparm( repeat_char, c, n ) );
        } else {
            for( ; n > 0; n-- ) {
                __putchar( c );
            }
        }

        if( a ) {
            TI_ACS_OFF();
        }
    }
}