1unifdef(1)                       User Commands                      unifdef(1)
2
3
4

NAME

6       unifdef - resolve and remove ifdef'ed lines from C program source
7

SYNOPSIS

9       unifdef [-clt] [-Dname] [-Uname] [-iDname] [-iUname] ...
10            [filename]
11
12

DESCRIPTION

14       unifdef  removes  ifdefed lines from a file while otherwise leaving the
15       file alone. It is smart enough to deal with  the  nested  ifdefs,  com‐
16       ments,  single  and  double  quotes of C syntax, but it does not do any
17       including or interpretation of macros. Neither does it strip  out  com‐
18       ments, though it recognizes and ignores them. You specify which symbols
19       you want defined with -D options, and which you want undefined with  -U
20       options.  Lines  within  those  ifdefs will be copied to the output, or
21       removed, as appropriate. Any ifdef, ifndef, else, and endif lines asso‐
22       ciated with filename will also be removed.
23
24
25       ifdefs  involving  symbols  you do not specify are untouched and copied
26       out along with their associated ifdef, else, and endiff1 lines.
27
28
29       If an ifdefX occurs nested inside another ifdefX, then the inside ifdef
30       is  treated  as  if  it were an unrecognized symbol. If the same symbol
31       appears in more than one argument, only the first occurrence is signif‐
32       icant.
33
34
35       unifdef  copies  its  output  to  the standard output and will take its
36       input from the standard input if no filename argument is given.
37

OPTIONS

39       The following options are supported:
40
41       -c         Complement the normal operation. Lines that would have  been
42                  removed or blanked are retained, and vice versa.
43
44
45       -l         Replace ``lines removed'' lines with blank lines.
46
47
48       -t         Plain  text option. unifdef refrains from attempting to rec‐
49                  ognize comments and single and double quotes.
50
51
52       -Dname     Lines associated with the defined symbol name.
53
54
55       -Uname     Lines associated with the undefined symbol name.
56
57
58       -iDname    Ignore, but print out, lines  associated  with  the  defined
59                  symbol  name. If you use ifdefs to delimit non-C lines, such
60                  as comments or code which is under  construction,  then  you
61                  must tell unifdef which symbols are used for that purpose so
62                  that it will not try to parse for quotes and comments within
63                  them.
64
65
66       -iUname    Ignore,  but  print out, lines associated with the undefined
67                  symbol name.
68
69

EXIT STATUS

71       The following exit values are returned:
72
73       0    Successful operation.
74
75
76       1    Operation failed.
77
78

ATTRIBUTES

80       See attributes(5) for descriptions of the following attributes:
81
82
83
84
85       ┌─────────────────────────────┬─────────────────────────────┐
86       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
87       ├─────────────────────────────┼─────────────────────────────┤
88       │Availability                 │SUNWbtool                    │
89       └─────────────────────────────┴─────────────────────────────┘
90

SEE ALSO

92       diff(1), attributes(5)
93

DIAGNOSTICS

95       Premature EOF    Inappropriate else or endif.
96
97
98
99
100SunOS 5.11                        14 Jan 1992                       unifdef(1)
Impressum