10Sstevel@tonic-gateH 20Sstevel@tonic-gate!rm -f tifget.c 30Sstevel@tonic-gate0a 40Sstevel@tonic-gate#pragma ident "%Z%%M% %I% %E% SMI" 50Sstevel@tonic-gate 60Sstevel@tonic-gate/* 70Sstevel@tonic-gate * Routines to retrieve a value based on the short terminfo name. 80Sstevel@tonic-gate * This file is created from tifget.ed. DO NOT EDIT ME! 90Sstevel@tonic-gate */ 100Sstevel@tonic-gate 110Sstevel@tonic-gate#include <sys/types.h> 120Sstevel@tonic-gate#include "curses_inc.h" 130Sstevel@tonic-gate 140Sstevel@tonic-gate/* generated by sort on caps */ 150Sstevel@tonic-gatestatic short booloffsets[] = 160Sstevel@tonic-gate { 170Sstevel@tonic-gate. 180Sstevel@tonic-gate!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 190Sstevel@tonic-gate.r !cat ./tmp/tifget.tmp 200Sstevel@tonic-gate.a 210Sstevel@tonic-gate }; 220Sstevel@tonic-gate 230Sstevel@tonic-gate/* generated by sort on caps */ 240Sstevel@tonic-gatestatic short numoffsets[] = 250Sstevel@tonic-gate { 260Sstevel@tonic-gate. 270Sstevel@tonic-gate!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 280Sstevel@tonic-gate.r !cat ./tmp/tifget.tmp 290Sstevel@tonic-gate.a 300Sstevel@tonic-gate }; 310Sstevel@tonic-gate 320Sstevel@tonic-gate/* generated by sort on caps */ 330Sstevel@tonic-gatestatic short stroffsets[] = 340Sstevel@tonic-gate { 350Sstevel@tonic-gate. 360Sstevel@tonic-gate!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 370Sstevel@tonic-gate.r !cat ./tmp/tifget.tmp 380Sstevel@tonic-gate!rm ./tmp/tifget.tmp 390Sstevel@tonic-gate.a 400Sstevel@tonic-gate }; 410Sstevel@tonic-gate 420Sstevel@tonic-gate/* 430Sstevel@tonic-gate * Return the value of the long-named boolean capability tistr. 440Sstevel@tonic-gate * Return -1 if the name is not a boolean capability. 450Sstevel@tonic-gate */ 460Sstevel@tonic-gate 470Sstevel@tonic-gateint 480Sstevel@tonic-gatetifgetflag(char *tistr) 490Sstevel@tonic-gate{ 500Sstevel@tonic-gate int offset; 510Sstevel@tonic-gate char *bool_array = (char *) cur_bools; 520Sstevel@tonic-gate 530Sstevel@tonic-gate return (((offset = _tcsearch(tistr, booloffsets, boolfnames, 540Sstevel@tonic-gate _NUMELEMENTS(booloffsets), 0)) == -1) ? -1 : bool_array[offset]); 550Sstevel@tonic-gate} 560Sstevel@tonic-gate 570Sstevel@tonic-gate/* 580Sstevel@tonic-gate * Return the value of the long-named numeric capability tistr. 590Sstevel@tonic-gate * Return -2 if the name is not a numeric capability. 600Sstevel@tonic-gate */ 610Sstevel@tonic-gate 620Sstevel@tonic-gateint 630Sstevel@tonic-gatetifgetnum(char *tistr) 640Sstevel@tonic-gate{ 650Sstevel@tonic-gate int offset; 660Sstevel@tonic-gate short *num_array = (short *) cur_nums; 670Sstevel@tonic-gate 680Sstevel@tonic-gate return (((offset = _tcsearch(tistr, numoffsets, numfnames, 690Sstevel@tonic-gate _NUMELEMENTS(numoffsets), 0)) == -1) ? -2 : num_array[offset]); 700Sstevel@tonic-gate} 710Sstevel@tonic-gate 720Sstevel@tonic-gate/* 730Sstevel@tonic-gate * Return the value of the long-named string capability tistr. 740Sstevel@tonic-gate * Return (char *) -1 if the name is not a string capability. 750Sstevel@tonic-gate */ 760Sstevel@tonic-gate 770Sstevel@tonic-gatechar * 780Sstevel@tonic-gatetifgetstr(char *tistr) 790Sstevel@tonic-gate{ 800Sstevel@tonic-gate int offset; 810Sstevel@tonic-gate char **str_array = (char **) cur_strs; 820Sstevel@tonic-gate 830Sstevel@tonic-gate return (((offset = _tcsearch(tistr, stroffsets, strfnames, 840Sstevel@tonic-gate _NUMELEMENTS(stroffsets), 0)) == -1) ? (char *) -1 : 850Sstevel@tonic-gate str_array[offset]); 860Sstevel@tonic-gate} 870Sstevel@tonic-gate. 880Sstevel@tonic-gate0r copyright.h 89*2026Sstevel1,.g/#pragma ident/d 900Sstevel@tonic-gatew tifget.c 910Sstevel@tonic-gateq 92