2 # Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3 # Use is subject to license terms.
7 # The contents of this file are subject to the terms of the
8 # Common Development and Distribution License, Version 1.0 only
9 # (the "License"). You may not use this file except in compliance
12 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
13 # or http://www.opensolaris.org/os/licensing.
14 # See the License for the specific language governing permissions
15 # and limitations under the License.
17 # When distributing Covered Code, include this CDDL HEADER in each
18 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
19 # If applicable, add the following below this CDDL HEADER, with the
20 # fields enclosed by brackets "[]" replaced with your own identifying
21 # information: Portions Copyright [yyyy] [name of copyright owner]
25 # ident "%Z%%M% %I% %E% SMI"
29 # Extract MACROs referenced by MSG_INTL and MSG_ORIG
30 # The MACROS referenced by MSG_INTL() go to MSG_INTL_LIST
31 # The MACROS referenced by MSG_ORIG() go to MSG_ORIG_LIST
35 FS =
"[,(){]|[ ]+|[\t]+"
37 # These variables are used to handle the lines such as:
45 # If the input line has MSG_INTL or MSG_ORIG, collect the
46 # MACRO used. Assumption is that the MACRO names have to be
47 # composed of upper characters.
49 /MSG_INTL
|MSG_ORIG
|_elf_seterr
/ {
50 for (i =
1; i
<=
NF; ++i
) {
51 if ($i ==
"MSG_INTL" || $i ==
"_elf_seterr") {
59 if (match($j
, /[a
-z
]/) ==
0 &&
60 match($j
, /[A
-Z
]/) != 0)
61 print $j
> "MSG_INTL_LIST"
64 if ($i ==
"MSG_ORIG") {
72 if (match($j
, /[a
-z
]/) ==
0 &&
73 match($j
, /[A
-Z
]/) != 0)
74 print $j
> "MSG_ORIG_LIST"
80 # If the previous line ended with MSG_INTL or MSG_ORIG not
81 # having the MACRO name, pick it from the next line.
84 if (watchme_intl ==
1) {
85 if (match($
1, /[a
-z
]/) ==
0 &&
86 match($
1, /[A
-Z
]/) != 0)
87 print $
1 > "MSG_INTL_LIST"
89 } else if (watchme_orig ==
1) {
90 if (match($
1, /[a
-z
]/) ==
0 &&
91 match($
1, /[A
-Z
]/) != 0)
92 print $
1 > "MSG_INTL_ORIG"