⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cntcostfn.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
字号:
#ifdef lintstatic char *sccsid = "@(#)cntcostfn.c	4.1	(ULTRIX)	7/2/90";#endif lint#include "curses.ext"static counter = 0;/* ARGSUSED */_countchar(ch)char ch;{	counter++;}/* * Figure out the _cost in characters to print this string. * Due to padding, we can't just use strlen, so instead we * feed it through tputs and trap the results. * Even if the terminal uses xon/xoff handshaking, count the * pad chars here since they estimate the real time to do the * operation, useful in calculating costs. */_cost_fn(str, affcnt)char *str;{	int save_xflag = xon_xoff;	if (str == NULL)		return INFINITY;	counter = 0;	xon_xoff = 0;	tputs(str, affcnt, _countchar);	xon_xoff = save_xflag;	return counter;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -