X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2FMKunctrl.awk;h=2140900e8c3be185b4df4f959f2bc71005c36fe4;hp=4bebf3cf4cc75481ffac3095b9a2b871df13a81a;hb=4573ed8af000c7a7907a59ec750da29c46c15498;hpb=bd7ef7c2309fd00aa4576168c46f557c622cb9c3;ds=inline diff --git a/ncurses/base/MKunctrl.awk b/ncurses/base/MKunctrl.awk index 4bebf3cf..2140900e 100644 --- a/ncurses/base/MKunctrl.awk +++ b/ncurses/base/MKunctrl.awk @@ -1,6 +1,6 @@ -# $Id: MKunctrl.awk,v 1.22 2008/05/31 19:36:11 tom Exp $ +# $Id: MKunctrl.awk,v 1.26 2009/07/04 22:05:15 Clemens.Ladisch Exp $ ############################################################################## -# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. # +# Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -36,19 +36,12 @@ BEGIN { print "#include " print "#include " print "" - print "#if USE_WIDEC_SUPPORT" - print "#if HAVE_WCTYPE_H" - print "#include " - print "#endif" - print "#endif" - print "" print "#undef unctrl" print "" } END { - print "NCURSES_EXPORT(NCURSES_CONST char *) _nc_unctrl (SCREEN *sp, chtype ch)" + print "NCURSES_EXPORT(NCURSES_CONST char *) safe_unctrl(SCREEN *sp, chtype ch)" print "{" - blob="" offset=0 if (bigstrings) { @@ -101,6 +94,7 @@ END { blob = blob "\""; print "" + printf "#if NCURSES_EXT_FUNCS\n"; if (bigstrings) { blob = blob "\n/* printable values in 128-255 range */" printf "static const short unctrl_c1[] = {" @@ -135,6 +129,7 @@ END { } } print "};" + print "#endif /* NCURSES_EXT_FUNCS */" blob = blob "\"\n" print "" @@ -156,16 +151,6 @@ END { print "\t\t && (check < 160))" printf "\t\t\tresult = %s_c1[check - 128];\n", stringname; print "\t\telse" - print "#if USE_WIDEC_SUPPORT" - print "\t\tif ((check >= 160)" - print "\t\t && (check < 256)" - print "\t\t && ((sp != 0)" - print "\t\t && ((sp->_legacy_coding > 0)" - print "\t\t || (sp->_legacy_coding == 0" - print "\t\t && (isprint(check) || iswprint(check))))))" - printf "\t\t\tresult = %s_c1[check - 128];\n", stringname; - print "\t\telse" - print "#else" print "\t\tif ((check >= 160)" print "\t\t && (check < 256)" print "\t\t && ((sp != 0)" @@ -174,7 +159,6 @@ END { print "\t\t && isprint(check)))))" printf "\t\t\tresult = %s_c1[check - 128];\n", stringname; print "\t\telse" - print "#endif /* USE_WIDEC_SUPPORT */" print "#endif /* NCURSES_EXT_FUNCS */" printf "\t\t\tresult = %s_table[check];\n", stringname; print "\t} else {" @@ -185,6 +169,6 @@ END { print "" print "NCURSES_EXPORT(NCURSES_CONST char *) unctrl (chtype ch)" print "{" - print "\treturn _nc_unctrl(SP, ch);" + print "\treturn safe_unctrl(CURRENT_SCREEN, ch);" print "}" }