Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man1 / unifdef.1
blob9bb36bf6d04b282843766714cc00be40eb548b6b
1 '\" te
2 .\"  Copyright (c) 1994 Sun Microsystems, Inc. - All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH UNIFDEF 1 "Jan 14, 1992"
7 .SH NAME
8 unifdef \- resolve and remove ifdef'ed lines from C program source
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBunifdef\fR [\fB-clt\fR] [\fB-D\fR\fIname\fR] [\fB-U\fR\fIname\fR] [\fB-iD\fR\fIname\fR] [\fB-iU\fR\fIname\fR] ...
13      [\fIfilename\fR]
14 .fi
16 .SH DESCRIPTION
17 .LP
18 \fBunifdef\fR removes \fBifdef\fRed lines from a file while otherwise leaving
19 the file alone. It is smart enough to deal with the nested \fBifdef\fRs,
20 comments, single and double quotes of C syntax, but it does not do any
21 including or interpretation of macros. Neither does it strip out comments,
22 though it recognizes and ignores them. You specify which symbols you want
23 defined with \fB-D\fR options, and which you want undefined with \fB-U\fR
24 options. Lines within those \fBifdef\fRs will be copied to the output, or
25 removed, as appropriate. Any \fBifdef\fR, \fBifndef\fR, \fBelse\fR, and
26 \fBendif\fR lines associated with \fIfilename\fR will also be removed.
27 .sp
28 .LP
29 \fBifdef\fRs involving symbols you do not specify are untouched and copied out
30 along with their associated \fBifdef\fR, \fBelse\fR, and \fBendif\fR lines.
31 .sp
32 .LP
33 If an \fBifdef\fR\fIX\fR occurs nested inside another \fBifdef\fR\fIX\fR, then
34 the inside \fBifdef\fR is treated as if it were an unrecognized symbol. If the
35 same symbol appears in more than one argument, only the first occurrence is
36 significant.
37 .sp
38 .LP
39 \fBunifdef\fR copies its output to the standard output and will take its input
40 from the standard input if no \fIfilename\fR argument is given.
41 .SH OPTIONS
42 .LP
43 The following options are supported:
44 .sp
45 .ne 2
46 .na
47 \fB\fB-c\fR\fR
48 .ad
49 .RS 11n
50 Complement the normal operation. Lines that would have been removed or blanked
51 are retained, and vice versa.
52 .RE
54 .sp
55 .ne 2
56 .na
57 \fB\fB-l\fR\fR
58 .ad
59 .RS 11n
60 Replace ``lines removed'' lines with blank lines.
61 .RE
63 .sp
64 .ne 2
65 .na
66 \fB\fB-t\fR\fR
67 .ad
68 .RS 11n
69 Plain text option. \fBunifdef\fR refrains from attempting to recognize comments
70 and single and double quotes.
71 .RE
73 .sp
74 .ne 2
75 .na
76 \fB\fB-D\fR\fIname\fR\fR
77 .ad
78 .RS 11n
79 Lines associated with the defined symbol \fIname\fR.
80 .RE
82 .sp
83 .ne 2
84 .na
85 \fB\fB-U\fR\fIname\fR\fR
86 .ad
87 .RS 11n
88 Lines associated with the undefined symbol \fIname\fR.
89 .RE
91 .sp
92 .ne 2
93 .na
94 \fB\fB-iD\fR\fIname\fR\fR
95 .ad
96 .RS 11n
97 Ignore, but print out, lines associated with the defined symbol \fIname\fR. If
98 you use \fBifdef\fRs to delimit non-C lines, such as comments or code which is
99 under construction, then you must tell \fBunifdef\fR which symbols are used for
100 that purpose so that it will not try to parse for quotes and comments within
101 them.
105 .ne 2
107 \fB\fB-iU\fR\fIname\fR\fR
109 .RS 11n
110 Ignore, but print out, lines associated with the undefined symbol \fIname\fR.
113 .SH EXIT STATUS
115 The following exit values are returned:
117 .ne 2
119 \fB\fB0\fR\fR
121 .RS 5n
122 Successful operation.
126 .ne 2
128 \fB\fB1\fR\fR
130 .RS 5n
131 Operation failed.
134 .SH SEE ALSO
136 \fBdiff\fR(1), \fBattributes\fR(5)
137 .SH DIAGNOSTICS
138 .ne 2
140 \fB\fBPremature\fR \fBEOF\fR\fR
142 .RS 17n
143 Inappropriate \fBelse\fR or \fBendif\fR.