頭檔案
#include<term.h>
函式原型
int tigetnum(char *capname);
說明
失敗時(例如某個功能標誌不存在),tigetnum函式將返回-2
範例
#include <stdio.h>
#include <term.h>
#include <ncurses.h>
#include<stdlib.h>
int main()
{
int nrows,ncolumns;
setupterm(NULL,fileno(stdout), (int *)0);
nrows =tigetnum("lines");
ncolumns =tigetnum("cols");
printf("This terminal has %d columns and %d rows\n", ncolumns,nrows);
exit(0);
}
# gcc -o sizeterm sizeterm.c -lncurses
[root@localhost chapter05]# ./sizeterm
This terminal has 125 columns and 40 rows