#!/bin/sh # $Id: MKfallback.sh,v 1.11 2001/12/02 01:55:30 tom Exp $ # # MKfallback.sh -- create fallback table for entry reads # # This script generates source code for a custom version of read_entry.c # that (instead of reading capabilities for an argument terminal type # from an on-disk terminfo tree) tries to match the type with one of a # specified list of types generated in. # terminfo_dir=$1 shift terminfo_src=$1 shift if test $# != 0 ; then tmp_info=tmp_info echo creating temporary terminfo directory... >&2 TERMINFO=`pwd`/$tmp_info export TERMINFO TERMINFO_DIRS=$TERMINFO:$terminfo_dir export TERMINFO_DIRS tic $terminfo_src >&2 else tmp_info= fi cat < #include EOF if [ "$*" ] then cat < /* fallback entries for: $* */ EOF for x in $* do echo "/* $x */" infocmp -E $x done cat <term_names, name, "|")) return(tp); EOF else echo " /* the fallback list is empty */"; fi cat <&2 rm -rf $tmp_info fi