我的理解是函数 char *tparm(char *str, ...);
只是将给定的字符串 str
转换为扩展的参数化版本,它将是适合与 stdout 输出函数一起使用,例如 printf
或 cout
。但是 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 输出并忽略这些方法,因此我覆盖了该基础。
最佳答案
当然,您可以。但是一些功能字符串包括填充和时间延迟,tparm
假设将由 tputs
解释.
例如,flash
功能将使用时间延迟,它会传递给 tputs
(使用 terminfo(5)
手册页中描述的语法)。
关于c++ - 我可以在没有 tputs 或 putp 的情况下使用 tparm(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42800447/