2N/AH
2N/A!rm -f tiget.c
2N/A0a
2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A/*
2N/A * Routines to retrieve a value based on the short terminfo name.
2N/A * This file is created from tiget.ed. DO NOT EDIT ME!
2N/A */
2N/A
2N/A#include <sys/types.h>
2N/A#include "curses_inc.h"
2N/A
2N/A/* generated by sort on caps */
2N/Astatic short booloffsets[] =
2N/A {
2N/A.
2N/A!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
2N/A.r !cat ./tmp/tiget.tmp
2N/A.a
2N/A };
2N/A
2N/A/* generated by sort on caps */
2N/Astatic short numoffsets[] =
2N/A {
2N/A.
2N/A!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
2N/A.r !cat ./tmp/tiget.tmp
2N/A.a
2N/A };
2N/A
2N/A/* generated by sort on caps */
2N/Astatic short stroffsets[] =
2N/A {
2N/A.
2N/A!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
2N/A.r !cat ./tmp/tiget.tmp
2N/A!rm ./tmp/tiget.tmp
2N/A.a
2N/A };
2N/A
2N/A/*
2N/A * Return the value of the boolean capability tistr.
2N/A * Return -1 if the name is not a boolean capability.
2N/A */
2N/A
2N/Aint
2N/Atigetflag(char *tistr)
2N/A{
2N/A int offset;
2N/A char *bool_array = (char *) cur_bools;
2N/A
2N/A return (((offset = _tcsearch(tistr, booloffsets, boolnames,
2N/A _NUMELEMENTS(booloffsets), 0)) == -1) ? -1 : bool_array[offset]);
2N/A}
2N/A
2N/A/*
2N/A * Return the value of the numeric capability tistr.
2N/A * Return -2 if the name is not a numeric capability.
2N/A */
2N/A
2N/Aint
2N/Atigetnum(char *tistr)
2N/A{
2N/A int offset;
2N/A short *num_array = (short *) cur_nums;
2N/A
2N/A return (((offset = _tcsearch(tistr, numoffsets, numnames,
2N/A _NUMELEMENTS(numoffsets), 0)) == -1) ? -2 : num_array[offset]);
2N/A}
2N/A
2N/A/*
2N/A * Return the value of the string capability tistr.
2N/A * Return (char *) -1 if the name is not a string capability.
2N/A */
2N/A
2N/Achar *
2N/Atigetstr(char *tistr)
2N/A{
2N/A int offset;
2N/A char **str_array = (char **) cur_strs;
2N/A
2N/A return (((offset = _tcsearch(tistr, stroffsets, strnames,
2N/A _NUMELEMENTS(stroffsets), 0)) == -1) ? (char *) -1 :
2N/A str_array[offset]);
2N/A}
2N/A.
2N/A0r copyright.h
2N/A1,.g/#pragma ident/d
2N/Aw tiget.c
2N/Aq