我可以在没有 tputs 或 putp 的情况下使用 tparm()

Can I use tparm() without tputs or putp

我的理解是函数 char *tparm(char *str, ...); 只是将给定的字符串 str 转换为扩展的参数化版本,可以很好地与 printf 或 [= 等标准输出输出函数一起使用13=]。但是 man page 提到 -

Parameterized strings should be passed through tparm to instantiate them. All terminfo strings [including the output of tparm] should be printed with tputs or putp.

那么我可以解析 terminfo 条目并在它们上使用 tparm() 传递适当的参数并使用 stdout 输出函数输出它们吗?此外,我正在检查非 tty 输出并忽略这些方法,因此我覆盖了该基础。

当然,你可以。但是一些功能字符串包括 paddingtime delays,其中 tparm assumes will be interpreted by tputs.

例如,flash 功能将使用时间延迟,它会传递给 tputs(使用 terminfo(5) 手册页中描述的语法)。