H !rm -f tifget.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 tifget.ed. DO NOT EDIT ME! */ #include #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", $1, i++}' | sort > ./tmp/tifget.tmp .r !cat ./tmp/tifget.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", $1, i++}' | sort > ./tmp/tifget.tmp .r !cat ./tmp/tifget.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", $1, i++}' | sort > ./tmp/tifget.tmp .r !cat ./tmp/tifget.tmp !rm ./tmp/tifget.tmp .a }; /* * Return the value of the long-named boolean capability tistr. * Return -1 if the name is not a boolean capability. */ int tifgetflag(char *tistr) { int offset; char *bool_array = (char *) cur_bools; return (((offset = _tcsearch(tistr, booloffsets, boolfnames, _NUMELEMENTS(booloffsets), 0)) == -1) ? -1 : bool_array[offset]); } /* * Return the value of the long-named numeric capability tistr. * Return -2 if the name is not a numeric capability. */ int tifgetnum(char *tistr) { int offset; short *num_array = (short *) cur_nums; return (((offset = _tcsearch(tistr, numoffsets, numfnames, _NUMELEMENTS(numoffsets), 0)) == -1) ? -2 : num_array[offset]); } /* * Return the value of the long-named string capability tistr. * Return (char *) -1 if the name is not a string capability. */ char * tifgetstr(char *tistr) { int offset; char **str_array = (char **) cur_strs; return (((offset = _tcsearch(tistr, stroffsets, strfnames, _NUMELEMENTS(stroffsets), 0)) == -1) ? (char *) -1 : str_array[offset]); } . 0r copyright.h /copyright\.h/d w tifget.c q