17c478bd9Sstevel@tonic-gateH 27c478bd9Sstevel@tonic-gate!rm -f tifget.c 37c478bd9Sstevel@tonic-gate0a 47c478bd9Sstevel@tonic-gate/* 57c478bd9Sstevel@tonic-gate * Routines to retrieve a value based on the short terminfo name. 67c478bd9Sstevel@tonic-gate * This file is created from tifget.ed. DO NOT EDIT ME! 77c478bd9Sstevel@tonic-gate */ 87c478bd9Sstevel@tonic-gate 97c478bd9Sstevel@tonic-gate#include <sys/types.h> 107c478bd9Sstevel@tonic-gate#include "curses_inc.h" 117c478bd9Sstevel@tonic-gate 127c478bd9Sstevel@tonic-gate/* generated by sort on caps */ 137c478bd9Sstevel@tonic-gatestatic short booloffsets[] = 147c478bd9Sstevel@tonic-gate { 157c478bd9Sstevel@tonic-gate. 167c478bd9Sstevel@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 177c478bd9Sstevel@tonic-gate.r !cat ./tmp/tifget.tmp 187c478bd9Sstevel@tonic-gate.a 197c478bd9Sstevel@tonic-gate }; 207c478bd9Sstevel@tonic-gate 217c478bd9Sstevel@tonic-gate/* generated by sort on caps */ 227c478bd9Sstevel@tonic-gatestatic short numoffsets[] = 237c478bd9Sstevel@tonic-gate { 247c478bd9Sstevel@tonic-gate. 257c478bd9Sstevel@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 267c478bd9Sstevel@tonic-gate.r !cat ./tmp/tifget.tmp 277c478bd9Sstevel@tonic-gate.a 287c478bd9Sstevel@tonic-gate }; 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate/* generated by sort on caps */ 317c478bd9Sstevel@tonic-gatestatic short stroffsets[] = 327c478bd9Sstevel@tonic-gate { 337c478bd9Sstevel@tonic-gate. 347c478bd9Sstevel@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 357c478bd9Sstevel@tonic-gate.r !cat ./tmp/tifget.tmp 367c478bd9Sstevel@tonic-gate!rm ./tmp/tifget.tmp 377c478bd9Sstevel@tonic-gate.a 387c478bd9Sstevel@tonic-gate }; 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate/* 417c478bd9Sstevel@tonic-gate * Return the value of the long-named boolean capability tistr. 427c478bd9Sstevel@tonic-gate * Return -1 if the name is not a boolean capability. 437c478bd9Sstevel@tonic-gate */ 447c478bd9Sstevel@tonic-gate 457c478bd9Sstevel@tonic-gateint 467c478bd9Sstevel@tonic-gatetifgetflag(char *tistr) 477c478bd9Sstevel@tonic-gate{ 487c478bd9Sstevel@tonic-gate int offset; 497c478bd9Sstevel@tonic-gate char *bool_array = (char *) cur_bools; 507c478bd9Sstevel@tonic-gate 517c478bd9Sstevel@tonic-gate return (((offset = _tcsearch(tistr, booloffsets, boolfnames, 527c478bd9Sstevel@tonic-gate _NUMELEMENTS(booloffsets), 0)) == -1) ? -1 : bool_array[offset]); 537c478bd9Sstevel@tonic-gate} 547c478bd9Sstevel@tonic-gate 557c478bd9Sstevel@tonic-gate/* 567c478bd9Sstevel@tonic-gate * Return the value of the long-named numeric capability tistr. 577c478bd9Sstevel@tonic-gate * Return -2 if the name is not a numeric capability. 587c478bd9Sstevel@tonic-gate */ 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gateint 617c478bd9Sstevel@tonic-gatetifgetnum(char *tistr) 627c478bd9Sstevel@tonic-gate{ 637c478bd9Sstevel@tonic-gate int offset; 647c478bd9Sstevel@tonic-gate short *num_array = (short *) cur_nums; 657c478bd9Sstevel@tonic-gate 667c478bd9Sstevel@tonic-gate return (((offset = _tcsearch(tistr, numoffsets, numfnames, 677c478bd9Sstevel@tonic-gate _NUMELEMENTS(numoffsets), 0)) == -1) ? -2 : num_array[offset]); 687c478bd9Sstevel@tonic-gate} 697c478bd9Sstevel@tonic-gate 707c478bd9Sstevel@tonic-gate/* 717c478bd9Sstevel@tonic-gate * Return the value of the long-named string capability tistr. 727c478bd9Sstevel@tonic-gate * Return (char *) -1 if the name is not a string capability. 737c478bd9Sstevel@tonic-gate */ 747c478bd9Sstevel@tonic-gate 757c478bd9Sstevel@tonic-gatechar * 767c478bd9Sstevel@tonic-gatetifgetstr(char *tistr) 777c478bd9Sstevel@tonic-gate{ 787c478bd9Sstevel@tonic-gate int offset; 797c478bd9Sstevel@tonic-gate char **str_array = (char **) cur_strs; 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gate return (((offset = _tcsearch(tistr, stroffsets, strfnames, 827c478bd9Sstevel@tonic-gate _NUMELEMENTS(stroffsets), 0)) == -1) ? (char *) -1 : 837c478bd9Sstevel@tonic-gate str_array[offset]); 847c478bd9Sstevel@tonic-gate} 857c478bd9Sstevel@tonic-gate. 867c478bd9Sstevel@tonic-gate0r copyright.h 87*a6600459Sstevel1,.g/#pragma ident/d 887c478bd9Sstevel@tonic-gatew tifget.c 897c478bd9Sstevel@tonic-gateq 90