xref: /titanic_52/usr/src/lib/libcurses/screen/tiget.ed (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gateH
2*7c478bd9Sstevel@tonic-gate!rm -f tiget.c
3*7c478bd9Sstevel@tonic-gate0a
4*7c478bd9Sstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
5*7c478bd9Sstevel@tonic-gate
6*7c478bd9Sstevel@tonic-gate/*
7*7c478bd9Sstevel@tonic-gate * Routines to retrieve a value based on the short terminfo name.
8*7c478bd9Sstevel@tonic-gate * This file is created from tiget.ed. DO NOT EDIT ME!
9*7c478bd9Sstevel@tonic-gate */
10*7c478bd9Sstevel@tonic-gate
11*7c478bd9Sstevel@tonic-gate#include	<sys/types.h>
12*7c478bd9Sstevel@tonic-gate#include	"curses_inc.h"
13*7c478bd9Sstevel@tonic-gate
14*7c478bd9Sstevel@tonic-gate/* generated by sort on caps */
15*7c478bd9Sstevel@tonic-gatestatic	short	booloffsets[] =
16*7c478bd9Sstevel@tonic-gate		{
17*7c478bd9Sstevel@tonic-gate.
18*7c478bd9Sstevel@tonic-gate!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
19*7c478bd9Sstevel@tonic-gate.r !cat ./tmp/tiget.tmp
20*7c478bd9Sstevel@tonic-gate.a
21*7c478bd9Sstevel@tonic-gate		};
22*7c478bd9Sstevel@tonic-gate
23*7c478bd9Sstevel@tonic-gate/* generated by sort on caps */
24*7c478bd9Sstevel@tonic-gatestatic	short	numoffsets[] =
25*7c478bd9Sstevel@tonic-gate		{
26*7c478bd9Sstevel@tonic-gate.
27*7c478bd9Sstevel@tonic-gate!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
28*7c478bd9Sstevel@tonic-gate.r !cat ./tmp/tiget.tmp
29*7c478bd9Sstevel@tonic-gate.a
30*7c478bd9Sstevel@tonic-gate		};
31*7c478bd9Sstevel@tonic-gate
32*7c478bd9Sstevel@tonic-gate/* generated by sort on caps */
33*7c478bd9Sstevel@tonic-gatestatic	short	stroffsets[] =
34*7c478bd9Sstevel@tonic-gate		{
35*7c478bd9Sstevel@tonic-gate.
36*7c478bd9Sstevel@tonic-gate!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
37*7c478bd9Sstevel@tonic-gate.r !cat ./tmp/tiget.tmp
38*7c478bd9Sstevel@tonic-gate!rm ./tmp/tiget.tmp
39*7c478bd9Sstevel@tonic-gate.a
40*7c478bd9Sstevel@tonic-gate		};
41*7c478bd9Sstevel@tonic-gate
42*7c478bd9Sstevel@tonic-gate/*
43*7c478bd9Sstevel@tonic-gate * Return the value of the boolean capability tistr.
44*7c478bd9Sstevel@tonic-gate * Return -1 if the name is not a boolean capability.
45*7c478bd9Sstevel@tonic-gate */
46*7c478bd9Sstevel@tonic-gate
47*7c478bd9Sstevel@tonic-gateint
48*7c478bd9Sstevel@tonic-gatetigetflag(char *tistr)
49*7c478bd9Sstevel@tonic-gate{
50*7c478bd9Sstevel@tonic-gate	int	offset;
51*7c478bd9Sstevel@tonic-gate	char	*bool_array = (char *) cur_bools;
52*7c478bd9Sstevel@tonic-gate
53*7c478bd9Sstevel@tonic-gate	return (((offset = _tcsearch(tistr, booloffsets, boolnames,
54*7c478bd9Sstevel@tonic-gate	    _NUMELEMENTS(booloffsets), 0)) == -1) ? -1 : bool_array[offset]);
55*7c478bd9Sstevel@tonic-gate}
56*7c478bd9Sstevel@tonic-gate
57*7c478bd9Sstevel@tonic-gate/*
58*7c478bd9Sstevel@tonic-gate * Return the value of the numeric capability tistr.
59*7c478bd9Sstevel@tonic-gate * Return -2 if the name is not a numeric capability.
60*7c478bd9Sstevel@tonic-gate */
61*7c478bd9Sstevel@tonic-gate
62*7c478bd9Sstevel@tonic-gateint
63*7c478bd9Sstevel@tonic-gatetigetnum(char *tistr)
64*7c478bd9Sstevel@tonic-gate{
65*7c478bd9Sstevel@tonic-gate	int	offset;
66*7c478bd9Sstevel@tonic-gate	short	*num_array = (short *) cur_nums;
67*7c478bd9Sstevel@tonic-gate
68*7c478bd9Sstevel@tonic-gate	return (((offset = _tcsearch(tistr, numoffsets, numnames,
69*7c478bd9Sstevel@tonic-gate	    _NUMELEMENTS(numoffsets), 0)) == -1) ? -2 : num_array[offset]);
70*7c478bd9Sstevel@tonic-gate}
71*7c478bd9Sstevel@tonic-gate
72*7c478bd9Sstevel@tonic-gate/*
73*7c478bd9Sstevel@tonic-gate * Return the value of the string capability tistr.
74*7c478bd9Sstevel@tonic-gate * Return (char *) -1 if the name is not a string capability.
75*7c478bd9Sstevel@tonic-gate */
76*7c478bd9Sstevel@tonic-gate
77*7c478bd9Sstevel@tonic-gatechar	*
78*7c478bd9Sstevel@tonic-gatetigetstr(char *tistr)
79*7c478bd9Sstevel@tonic-gate{
80*7c478bd9Sstevel@tonic-gate	int	offset;
81*7c478bd9Sstevel@tonic-gate	char	**str_array = (char **) cur_strs;
82*7c478bd9Sstevel@tonic-gate
83*7c478bd9Sstevel@tonic-gate	return (((offset = _tcsearch(tistr, stroffsets, strnames,
84*7c478bd9Sstevel@tonic-gate	    _NUMELEMENTS(stroffsets), 0)) == -1) ? (char *) -1 :
85*7c478bd9Sstevel@tonic-gate	    str_array[offset]);
86*7c478bd9Sstevel@tonic-gate}
87*7c478bd9Sstevel@tonic-gate.
88*7c478bd9Sstevel@tonic-gate0r copyright.h
89*7c478bd9Sstevel@tonic-gate/copyright\.h/d
90*7c478bd9Sstevel@tonic-gatew tiget.c
91*7c478bd9Sstevel@tonic-gateq
92