summaryrefslogtreecommitdiff
path: root/usr/src/lib/libcurses/screen/tiget.ed
blob: 6e9c1988e470038c54f9ff4990e508e6d6515ea3 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
H
!rm -f tiget.c
0a
#pragma ident	"%Z%%M%	%I%	%E% SMI"

/*
 * Routines to retrieve a value based on the short terminfo name.
 * This file is created from tiget.ed. DO NOT EDIT ME!
 */

#include	<sys/types.h>
#include	"curses_inc.h"

/* generated by sort on caps */
static	short	booloffsets[] =
		{
.
!sed -e '1,/^--- begin bool/d' -e '/^--- end bool/,$d' -e '/^#/d' < caps | awk '{printf "\t/* \%s */\t\%d,\n", $2, i++}' | sort > ./tmp/tiget.tmp
.r !cat ./tmp/tiget.tmp
.a
		};

/* generated by sort on caps */
static	short	numoffsets[] =
		{
.
!sed -e '1,/^--- begin num/d' -e '/^--- end num/,$d' -e '/^#/d' < caps | awk '{printf "\t/* \%s */\t\%d,\n", $2, i++}' | sort > ./tmp/tiget.tmp
.r !cat ./tmp/tiget.tmp
.a
		};

/* generated by sort on caps */
static	short	stroffsets[] =
		{
.
!sed -e '1,/^--- begin str/d' -e '/^--- end str/,$d' -e '/^#/d' < caps | awk '{printf "\t/* \%s */\t\%d,\n", $2, i++}' | sort > ./tmp/tiget.tmp
.r !cat ./tmp/tiget.tmp
!rm ./tmp/tiget.tmp
.a
		};

/*
 * Return the value of the boolean capability tistr.
 * Return -1 if the name is not a boolean capability.
 */

int
tigetflag(char *tistr)
{
	int	offset;
	char	*bool_array = (char *) cur_bools;

	return (((offset = _tcsearch(tistr, booloffsets, boolnames,
	    _NUMELEMENTS(booloffsets), 0)) == -1) ? -1 : bool_array[offset]);
}

/*
 * Return the value of the numeric capability tistr.
 * Return -2 if the name is not a numeric capability.
 */

int
tigetnum(char *tistr)
{
	int	offset;
	short	*num_array = (short *) cur_nums;

	return (((offset = _tcsearch(tistr, numoffsets, numnames,
	    _NUMELEMENTS(numoffsets), 0)) == -1) ? -2 : num_array[offset]);
}

/*
 * Return the value of the string capability tistr.
 * Return (char *) -1 if the name is not a string capability.
 */

char	*
tigetstr(char *tistr)
{
	int	offset;
	char	**str_array = (char **) cur_strs;

	return (((offset = _tcsearch(tistr, stroffsets, strnames,
	    _NUMELEMENTS(stroffsets), 0)) == -1) ? (char *) -1 :
	    str_array[offset]);
}
.
0r copyright.h
1,.g/#pragma ident/d
w tiget.c
q