]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/MKtermsort.sh
ncurses 5.2
[ncurses.git] / progs / MKtermsort.sh
index 6cbe9548354ed3c598145b943541401f17e0d2df..5486fd7436891d9d81802f9dbbb7a0295e24a813 100755 (executable)
@@ -1,17 +1,24 @@
 #!/bin/sh
 #!/bin/sh
+# $Id: MKtermsort.sh,v 1.6 2000/01/25 11:35:36 tom Exp $
 #
 # 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.
 #
 #
 # 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.
 #
+# keep the order independent of locale:
+LANGUAGE=C
+LC_ALL=C
+export LANGUAGE
+export LC_ALL
+#
 AWK=${1-awk}
 DATA=${2-../include/Caps}
 
 echo "/*";
 echo " * termsort.c --- sort order arrays for use by infocmp.";
 echo " *";
 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 " * Note: this file is generated using MKtermsort.sh, do not edit by hand.";
 echo " */";
 
 echo "static const int bool_terminfo_sort[] = {";
 echo " */";
 
 echo "static const int bool_terminfo_sort[] = {";
@@ -95,27 +102,26 @@ $3 == "str"     {printf("%s\t%d\n", $4, i++);}
 echo "};";
 echo "";
 
 echo "};";
 echo "";
 
-echo "static const int bool_from_termcap[] = {";
+echo "static const bool bool_from_termcap[] = {";
 $AWK <$DATA '
 $AWK <$DATA '
-$3 == "bool" && substr($5, 1, 1) == "-"       {print "0,\t/* ", $2, " */";}
-$3 == "bool" && substr($5, 1, 1) == "Y"       {print "1,\t/* ", $2, " */";}
+$3 == "bool" && substr($5, 1, 1) == "-"       {print "\tFALSE,\t/* ", $2, " */";}
+$3 == "bool" && substr($5, 1, 1) == "Y"       {print "\tTRUE,\t/* ", $2, " */";}
 '
 echo "};";
 echo "";
 
 '
 echo "};";
 echo "";
 
-echo "static const int num_from_termcap[] = {";
+echo "static const bool num_from_termcap[] = {";
 $AWK <$DATA '
 $AWK <$DATA '
-$3 == "num" && substr($5, 1, 1) == "-"        {print "0,\t/* ", $2, " */";}
-$3 == "num" && substr($5, 1, 1) == "Y"        {print "1,\t/* ", $2, " */";}
+$3 == "num" && substr($5, 1, 1) == "-"        {print "\tFALSE,\t/* ", $2, " */";}
+$3 == "num" && substr($5, 1, 1) == "Y"        {print "\tTRUE,\t/* ", $2, " */";}
 '
 echo "};";
 echo "";
 
 '
 echo "};";
 echo "";
 
-echo "static const int str_from_termcap[] = {";
+echo "static const bool str_from_termcap[] = {";
 $AWK <$DATA '
 $AWK <$DATA '
-$3 == "str" && substr($5, 1, 1) == "-"        {print "0,\t/* ", $2, " */";}
-$3 == "str" && substr($5, 1, 1) == "Y"        {print "1,\t/* ", $2, " */";}
+$3 == "str" && substr($5, 1, 1) == "-"        {print "\tFALSE,\t/* ", $2, " */";}
+$3 == "str" && substr($5, 1, 1) == "Y"        {print "\tTRUE,\t/* ", $2, " */";}
 '
 echo "};";
 echo "";
 '
 echo "};";
 echo "";
-