4 #pragma ident "%Z%%M% %I% %E% SMI"
7 * Routines to retrieve a value based on the short terminfo name.
8 * This file is created from tiget.ed. DO NOT EDIT ME!
11 #include <sys/types.h>
12 #include "curses_inc.h"
14 /* generated by sort on caps */
15 static short booloffsets[] =
18 !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 .r !cat ./tmp/tiget.tmp
23 /* generated by sort on caps */
24 static short numoffsets[] =
27 !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 .r !cat ./tmp/tiget.tmp
32 /* generated by sort on caps */
33 static short stroffsets[] =
36 !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 .r !cat ./tmp/tiget.tmp
43 * Return the value of the boolean capability tistr.
44 * Return -1 if the name is not a boolean capability.
48 tigetflag(char *tistr)
51 char *bool_array = (char *) cur_bools;
53 return (((offset = _tcsearch(tistr, booloffsets, boolnames,
54 _NUMELEMENTS(booloffsets), 0)) == -1) ? -1 : bool_array[offset]);
58 * Return the value of the numeric capability tistr.
59 * Return -2 if the name is not a numeric capability.
66 short *num_array = (short *) cur_nums;
68 return (((offset = _tcsearch(tistr, numoffsets, numnames,
69 _NUMELEMENTS(numoffsets), 0)) == -1) ? -2 : num_array[offset]);
73 * Return the value of the string capability tistr.
74 * Return (char *) -1 if the name is not a string capability.
81 char **str_array = (char **) cur_strs;
83 return (((offset = _tcsearch(tistr, stroffsets, strnames,
84 _NUMELEMENTS(stroffsets), 0)) == -1) ? (char *) -1 :