summaryrefslogtreecommitdiffstats
path: root/lib/libmytinfo/tiget.c
blob: e312422dc8de8e57b274d7a6c74b735097df1e84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * tiget.c
 *
 * By Ross Ridge
 * Public Domain
 * 92/02/01 07:30:34
 *
 * The various tiget terminfo functions.
 */

#include "defs.h"
#include <term.h>

#ifdef USE_SCCS_IDS
static const char SCCSid[] = "@(#) mytinfo tiget.c 3.2 92/02/01 public domain, By Ross Ridge";
#endif

int
tigetnum(cap)
char *cap; {
	int ind;

	ind = _findnumname(cap);
	if (ind == -1)
		return -2;
	return cur_term->nums[ind];
}

int
tigetflag(cap)
char *cap; {
	int ind;

	ind = _findboolname(cap);
	if (ind == -1)
		return -1;
	return cur_term->bools[ind];
}

char *
tigetstr(cap)
char *cap; {
	int ind;

	ind = _findstrname(cap);
	if (ind == -1)
		return (char *) -1;
	return cur_term->strs[ind];
}


OpenPOWER on IntegriCloud