tputs Subroutine

Purpose

Outputs a string with padding information.

Library

Curses Library (libcurses.a)

Syntax

#include <curses.h>
#include <term.h>  

tputs( String,  LinesAffected,  PutcLikeSub)
char *String;
int LinesAffected;
int (*PutcLikeSub) ();

Description

The tputs subroutine outputs a string with padding information applied. String must be a terminfo string variable or the return value from tparm, tgetstr, tigetstr, or tgoto subroutines.

Parameters

Item Description
LinesAffected Specifies the number of lines affected, or specifies 1 if not applicable.
PutcLikeSub Specifies a putchar-like subroutine through which the characters are passed one at a time.
String Specifies the string to which to add padding information.

Examples

  1. To output the clear screen sequence using the user-defined putchar-like subroutine my_putchar, enter:
    int_my_putchar();
    tputs(clear_screen, 1 ,my_putchar); 
  2. To output the escape sequence used to move the cursor to the coordinates x=40, y=18 through the user-defined putchar-like subroutine my_putchar, enter:
    int_my_putchar();
    tputs(tparm(cursor_address, 18, 40), 1, my_putchar);