1 # $Id: MKunctrl.awk,v 1.3 1997/04/26 23:04:45 tom Exp $
2 ################################################################################
3 # Copyright 1997 by Thomas E. Dickey <dickey@clark.net> #
4 # All Rights Reserved. #
6 # Permission to use, copy, modify, and distribute this software and its #
7 # documentation for any purpose and without fee is hereby granted, provided #
8 # that the above copyright notice appear in all copies and that both that #
9 # copyright notice and this permission notice appear in supporting #
10 # documentation, and that the name of the above listed copyright holder(s) not #
11 # be used in advertising or publicity pertaining to distribution of the #
12 # software without specific, written prior permission. THE ABOVE LISTED #
13 # COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, #
14 # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT #
15 # SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, #
16 # INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM #
17 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE #
18 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR #
19 # PERFORMANCE OF THIS SOFTWARE. #
20 ################################################################################
23 print "/* generated by MKunctrl.awk */"
25 print "#include <curses.priv.h>"
29 print "NCURSES_CONST char *unctrl(register chtype ch)"
31 printf "static const char* const table[] = {"
32 for ( ch = 0; ch < 256; ch++ ) {
37 printf "\"^\\%03o\"", ch + 64
38 } else if (ch == 127) {
41 printf "\"\\%03o\"", ch
46 else if (((ch + 1) % 8) != 0)
52 print "\treturn (NCURSES_CONST char *)table[TextOf(ch)];"