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