aboutsummaryrefslogtreecommitdiff
path: root/contrib/ncurses/progs/MKtermsort.sh
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1999-08-24 01:06:48 +0000
committerPeter Wemm <peter@FreeBSD.org>1999-08-24 01:06:48 +0000
commit0e3d540892016a47f6a68ec9ba2879d35ce5f7c2 (patch)
treead214c5b2c8142ad6dc6d2ce3a9c83e6317d7f77 /contrib/ncurses/progs/MKtermsort.sh
downloadsrc-0e3d540892016a47f6a68ec9ba2879d35ce5f7c2.tar.gz
src-0e3d540892016a47f6a68ec9ba2879d35ce5f7c2.zip
Import unmodified (but trimmed) ncurses 5.0 prerelease 990821.vendor/ncurses/5.0-19990821
This contains the full eti (panel, form, menu) extensions. bmake glue to follow. Obtained from: ftp://ftp.clark.net/pub/dickey/ncurses
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=50276 svn path=/vendor/ncurses/5.0-19990821/; revision=50278; tag=vendor/ncurses/5.0-19990821
Diffstat (limited to 'contrib/ncurses/progs/MKtermsort.sh')
-rwxr-xr-xcontrib/ncurses/progs/MKtermsort.sh121
1 files changed, 121 insertions, 0 deletions
diff --git a/contrib/ncurses/progs/MKtermsort.sh b/contrib/ncurses/progs/MKtermsort.sh
new file mode 100755
index 000000000000..6cbe9548354e
--- /dev/null
+++ b/contrib/ncurses/progs/MKtermsort.sh
@@ -0,0 +1,121 @@
+#!/bin/sh
+#
+# MKtermsort.sh -- generate indirection vectors for the various sort methods
+#
+# The output of this script is C source for nine arrays that list three sort
+# orders for each of the three different classes of terminfo capabilities.
+#
+AWK=${1-awk}
+DATA=${2-../include/Caps}
+
+echo "/*";
+echo " * termsort.c --- sort order arrays for use by infocmp.";
+echo " *";
+echo " * Note: this file is generated using termsort.sh, do not edit by hand.";
+echo " */";
+
+echo "static const int bool_terminfo_sort[] = {";
+$AWK <$DATA '
+BEGIN {i = 0;}
+/^#/ {next;}
+$3 == "bool" {printf("%s\t%d\n", $2, i++);}
+' | sort | $AWK '{print "\t", $2, ",\t/* ", $1, " */";}';
+echo "};";
+echo "";
+
+echo "static const int num_terminfo_sort[] = {";
+$AWK <$DATA '
+BEGIN {i = 0;}
+/^#/ {next;}
+$3 == "num" {printf("%s\t%d\n", $2, i++);}
+' | sort | $AWK '{print "\t", $2, ",\t/* ", $1, " */";}';
+echo "};";
+echo "";
+
+echo "static const int str_terminfo_sort[] = {";
+$AWK <$DATA '
+BEGIN {i = 0;}
+/^#/ {next;}
+$3 == "str" {printf("%s\t%d\n", $2, i++);}
+' | sort | $AWK '{print "\t", $2, ",\t/* ", $1, " */";}';
+echo "};";
+echo "";
+
+echo "static const int bool_variable_sort[] = {";
+$AWK <$DATA '
+BEGIN {i = 0;}
+/^#/ {next;}
+$3 == "bool" {printf("%s\t%d\n", $1, i++);}
+' | sort | $AWK '{print "\t", $2, ",\t/* ", $1, " */";}';
+echo "};";
+echo "";
+
+echo "static const int num_variable_sort[] = {";
+$AWK <$DATA '
+BEGIN {i = 0;}
+/^#/ {next;}
+$3 == "num" {printf("%s\t%d\n", $1, i++);}
+' | sort | $AWK '{print "\t", $2, ",\t/* ", $1, " */";}';
+echo "};";
+echo "";
+
+echo "static const int str_variable_sort[] = {";
+$AWK <$DATA '
+BEGIN {i = 0;}
+/^#/ {next;}
+$3 == "str" {printf("%s\t%d\n", $1, i++);}
+' | sort | $AWK '{print "\t", $2, ",\t/* ", $1, " */";}';
+echo "};";
+echo "";
+
+echo "static const int bool_termcap_sort[] = {";
+$AWK <$DATA '
+BEGIN {i = 0;}
+/^#/ {next;}
+$3 == "bool" {printf("%s\t%d\n", $4, i++);}
+' | sort | $AWK '{print "\t", $2, ",\t/* ", $1, " */";}';
+echo "};";
+echo "";
+
+echo "static const int num_termcap_sort[] = {";
+$AWK <$DATA '
+BEGIN {i = 0;}
+/^#/ {next;}
+$3 == "num" {printf("%s\t%d\n", $4, i++);}
+' | sort | $AWK '{print "\t", $2, ",\t/* ", $1, " */";}';
+echo "};";
+echo "";
+
+echo "static const int str_termcap_sort[] = {";
+$AWK <$DATA '
+BEGIN {i = 0;}
+/^#/ {next;}
+$3 == "str" {printf("%s\t%d\n", $4, i++);}
+' | sort | $AWK '{print "\t", $2, ",\t/* ", $1, " */";}';
+echo "};";
+echo "";
+
+echo "static const int bool_from_termcap[] = {";
+$AWK <$DATA '
+$3 == "bool" && substr($5, 1, 1) == "-" {print "0,\t/* ", $2, " */";}
+$3 == "bool" && substr($5, 1, 1) == "Y" {print "1,\t/* ", $2, " */";}
+'
+echo "};";
+echo "";
+
+echo "static const int num_from_termcap[] = {";
+$AWK <$DATA '
+$3 == "num" && substr($5, 1, 1) == "-" {print "0,\t/* ", $2, " */";}
+$3 == "num" && substr($5, 1, 1) == "Y" {print "1,\t/* ", $2, " */";}
+'
+echo "};";
+echo "";
+
+echo "static const int str_from_termcap[] = {";
+$AWK <$DATA '
+$3 == "str" && substr($5, 1, 1) == "-" {print "0,\t/* ", $2, " */";}
+$3 == "str" && substr($5, 1, 1) == "Y" {print "1,\t/* ", $2, " */";}
+'
+echo "};";
+echo "";
+