Function tinf::tputs [] [src]

pub fn tputs(
    output: &mut Write,
    input: &[u8],
    pad_factor: u32,
    baud: usize,
    pad_char: Option<u8>
) -> Result<(), CapError>

Print a string capability, applying padding.

pad_factor should be either 1, or the number of lines affected by executing the capability, for capabilities with proportional padding; baud should be the baud rate of the terminal; for a terminal description desc, pad_char should be:

  • Some(0) if !desc[npc] and &desc[pad_char].is_empty()
  • Some(x) if ![desc[npc] and &desc[pad_char] == [x]
  • None if desc[npc]

If a capability does not use padding, then tputs(w, cap, ...) is equivalent to w.write_all(cap). For modern terminal emulators, the only capability that requires padding is flash (i.e., visual bell).

Errors

tputs will only return an error if an I/O error occurs while writing to output. There is no such thing as "invalid padding"; anything in a capability that is not a complete and correct padding specification is printed as-is.