tcout.c
来自「linux网络编程实例程序 socket程序 适合初学者。」· C语言 代码 · 共 39 行
C
39 行
/* tcout.c - tcout */#ifdef BSD#include <newcurses.h>#else#include <curses.h>#endif#include <stdlib.h>#include <stdio.h>#define TBUFSIZE 2048int xfputs(char *str, FILE *fp);/*------------------------------------------------------------------------ * tcout - print the indicated terminal capability on the given stream *------------------------------------------------------------------------ */inttcout(char *cap, FILE *tfp){ static init; static char *term; static char tbuf[TBUFSIZE], buf[TBUFSIZE], *bp = buf; char *sv; if (!init) { init = 1; term = getenv("TERM"); } if (term == 0 || tgetent(&tbuf[0], term) != 1) return 0; if (sv = tgetstr(cap, &bp)) { xfputs(sv, tfp); return 1; } return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?