Print this page
3764 Semantic of nawk's print statement changed
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libxcurses2/src/libc/xcurses/mknames.awk
+++ new/usr/src/lib/libxcurses2/src/libc/xcurses/mknames.awk
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License, Version 1.0 only
6 6 # (the "License"). You may not use this file except in compliance
7 7 # with the License.
8 8 #
9 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 # or http://www.opensolaris.org/os/licensing.
11 11 # See the License for the specific language governing permissions
12 12 # and limitations under the License.
13 13 #
14 14 # When distributing Covered Code, include this CDDL HEADER in each
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 # If applicable, add the following below this CDDL HEADER, with the
17 17 # fields enclosed by brackets "[]" replaced with your own identifying
18 18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 19 #
20 20 # CDDL HEADER END
21 21 #
22 22 # Copyright (c) 1995-1998 by Sun Microsystems, Inc.
23 23 # All rights reserved.
24 24 #
25 -# ident "%Z%%M% %I% %E% SMI"
26 -#
27 25 # mknames.awk
28 26 #
29 27 # XCurses Library
30 28 #
31 29 # Copyright 1990, 1995 by Mortice Kern Systems Inc. All rights reserved.
32 30 #
33 31 # rcsid = $Header: /team/ps/sun_xcurses/archive/local_changes/xcurses/src/lib/libxcurses/src/libc/xcurses/rcs/mknames.awk 1.3 1998/05/29 15:58:51 cbates Exp $
34 32 #
35 33
36 34 function header(file, array) {
37 35 print "/*" > file
38 36 print " * Copyright (c) 1998 by Sun Microsystems, Inc." > file
39 37 print " * All rights reserved." > file
40 38 print " */" > file
41 -print > file
39 +print "" > file
42 40 print "#pragma ident \"@(#)" file "\t%I%\t%E% SMI\"" > file
43 -print > file
41 +print "" > file
44 42 print "/*" > file
45 43 printf " * %s\n", file > file
46 44 print " *" > file
47 45 print " * XCurses Library" > file
48 46 print " *" > file
49 47 print " * **** THIS FILE IS MACHINE GENERATED." > file
50 48 print " * **** DO NOT EDIT THIS FILE." > file
51 49 print " *" > file
52 50 print " * Copyright 1990, 1995 by Mortice Kern Systems Inc. All rights reserved." > file
53 51 print " *" > file
54 52 print " */" > file
55 -print > file
53 +print "" > file
56 54 printf "const char *%s[] = {\n", array > file
57 55 }
58 56
59 57 function tail(file) {
60 58 printf("\t0\n};\n") >file;
61 59 close(file);
62 60 }
63 61
64 62 BEGIN {
65 63 header("boolname.c", "boolnames");
66 64 header("boolcode.c", "boolcodes");
67 65 header("boolfnam.c", "boolfnames");
68 66 header("numname.c", "numnames");
69 67 header("numcode.c", "numcodes");
70 68 header("numfnam.c", "numfnames");
71 69 header("strname.c", "strnames");
72 70 header("strcode.c", "strcodes");
73 71 header("strfnam.c", "strfnames");
74 72 }
75 73
76 74 $4 == "bool" {
77 75 printf "\t\"%s\",\n", $1 > "boolfnam.c"
78 76 printf "\t\"%s\",\n", $2 > "boolname.c"
79 77 printf "\t\"%s\",\n", $3 > "boolcode.c"
80 78 }
81 79
82 80 $4 == "number" {
83 81 printf "\t\"%s\",\n", $1 > "numfnam.c"
84 82 printf "\t\"%s\",\n", $2 > "numname.c"
85 83 printf "\t\"%s\",\n", $3 > "numcode.c"
86 84 }
87 85
88 86 $4 == "str" {
89 87 if ($1 ~ /^key_/)
90 88 {
91 89 printf "\t\"%s\",\n", toupper($1) > "strfnam.c"
92 90 }
93 91 else
94 92 {
95 93 printf "\t\"%s\",\n", $1 > "strfnam.c"
96 94 }
97 95 printf "\t\"%s\",\n", $2 > "strname.c"
98 96 printf "\t\"%s\",\n", $3 > "strcode.c"
99 97 }
100 98
101 99 END {
102 100 tail("boolname.c");
103 101 tail("boolcode.c");
104 102 tail("boolfnam.c");
105 103 tail("numname.c");
106 104 tail("numcode.c");
107 105 tail("numfnam.c");
108 106 tail("strname.c");
109 107 tail("strcode.c");
110 108 tail("strfnam.c");
111 109 }
↓ open down ↓ |
46 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX