Commit | Line | Data |
---|---|---|
61212793 C |
1 | |
2 | ||
3 | ||
4 | UNIFDEF(1) 1988 UNIFDEF(1) | |
5 | ||
6 | ||
7 | ||
8 | N\bNA\bAM\bME\bE | |
9 | unifdef - remove ifdef'ed lines | |
10 | ||
11 | S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS | |
12 | u\bun\bni\bif\bfd\bde\bef\bf [ -\b-t\bt -\b-l\bl -\b-c\bc -\b-D\bD_\bs_\by_\bm -\b-U\bU_\bs_\by_\bm -\b-i\biD\bD_\bs_\by_\bm -\b-i\biD\bD_\bs_\by_\bm ] ... [ file ] | |
13 | ||
14 | D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN | |
15 | _\bU_\bn_\bi_\bf_\bd_\be_\bf is useful for removing ifdef'ed lines from a file | |
16 | while otherwise leaving the file alone. _\bU_\bn_\bi_\bf_\bd_\be_\bf acts on | |
17 | #ifdef, #ifndef, #else, and #endif lines, and it knows only | |
18 | enough about C to know when one of these is inactive because | |
19 | it is inside a comment, or a single or double quote. Pars- | |
20 | ing for quotes is very simplistic: when it finds an open | |
21 | quote, it ignores everything (except escaped quotes) until | |
22 | it finds a close quote, and it will not complain if it gets | |
23 | to the end of a line and finds no backslash for continua- | |
24 | tion. | |
25 | ||
26 | If you want to use _\bu_\bn_\bi_\bf_\bd_\be_\bf for plain text (not C code), use | |
27 | the -\b-t\bt option, which disables this parsing for C comments | |
28 | and quotes. | |
29 | ||
30 | You specify which symbols you want defined (-\b-D\bD_\bs_\by_\bm) or unde- | |
31 | fined (-\b-U\bU_\bs_\by_\bm) and the lines inside those ifdefs will be | |
32 | copied to the output or removed as appropriate. The ifdef, | |
33 | ifndef, else, and endif lines associated with _\bs_\by_\bm will also | |
34 | be removed. Ifdefs involving symbols you don't specify and | |
35 | ``#if'' control lines are untouched and copied out along | |
36 | with their associated ifdef, else, and endif lines. If an | |
37 | ifdef X occurs nested inside another ifdef X, then the | |
38 | inside ifdef is treated as if it were an unrecognized sym- | |
39 | bol. If the same symbol appears in more than one argument, | |
40 | the last occurrence dominates. | |
41 | ||
42 | The -\b-l\bl option causes _\bu_\bn_\bi_\bf_\bd_\be_\bf to replace removed lines with | |
43 | blank lines instead of deleting them. | |
44 | ||
45 | If your C code uses ifdefs to delimit non-C lines, such as | |
46 | comments or code which is under construction, then you must | |
47 | tell _\bu_\bn_\bi_\bf_\bd_\be_\bf which symbols are used for that purpose so that | |
48 | it won't try to parse for quotes and comments inside those | |
49 | ifdefs. You specify ignored ifdefs with -\b-i\biD\bD_\bs_\by_\bm and -\b-i\biU\bU_\bs_\by_\bm | |
50 | similar to -\b-D\bD_\bs_\by_\bm and -\b-U\bU_\bs_\by_\bm above. | |
51 | ||
52 | _\bU_\bn_\bi_\bf_\bd_\be_\bf copies its output to _\bs_\bt_\bd_\bo_\bu_\bt and will take its input | |
53 | from _\bs_\bt_\bd_\bi_\bn if no _\bf_\bi_\bl_\be argument is given. If the -\b-c\bc argument | |
54 | is specified, then the operation of _\bu_\bn_\bi_\bf_\bd_\be_\bf is complemented, | |
55 | i.e. the lines that would have been removed or blanked are | |
56 | retained and vice versa. | |
57 | ||
58 | _\bU_\bn_\bi_\bf_\bd_\be_\bf works nicely with the -\b-D\bD_\bs_\by_\bm option added to _\bd_\bi_\bf_\bf(1) | |
59 | as of the 4.1 Berkeley Software Distribution. | |
60 | ||
61 | ||
62 | ||
63 | Printed 7/27/90 December 1 | |
64 | ||
65 | ||
66 | ||
67 | ||
68 | ||
69 | ||
70 | UNIFDEF(1) 1988 UNIFDEF(1) | |
71 | ||
72 | ||
73 | ||
74 | S\bSE\bEE\bE A\bAL\bLS\bSO\bO | |
75 | diff(1) | |
76 | ||
77 | D\bDI\bIA\bAG\bGN\bNO\bOS\bST\bTI\bIC\bCS\bS | |
78 | Inappropriate else or endif. | |
79 | Premature EOF with line numbers of the unterminated #ifdefs. | |
80 | ||
81 | Exit status is 0 if output is exact copy of input, 1 if not, | |
82 | 2 if trouble. | |
83 | ||
84 | A\bAU\bUT\bTH\bHO\bOR\bR | |
85 | Dave Yost for The Rand Corporation. | |
86 | Still maintained independently by Dave Yost as of 3/85 | |
87 | ||
88 | B\bBU\bUG\bGS\bS | |
89 | Should try to deal with ``#if'' lines. | |
90 | Doesn't work correctly if input contains null characters. | |
91 | ||
92 | ||
93 | ||
94 | ||
95 | ||
96 | ||
97 | ||
98 | ||
99 | ||
100 | ||
101 | ||
102 | ||
103 | ||
104 | ||
105 | ||
106 | ||
107 | ||
108 | ||
109 | ||
110 | ||
111 | ||
112 | ||
113 | ||
114 | ||
115 | ||
116 | ||
117 | ||
118 | ||
119 | ||
120 | ||
121 | ||
122 | ||
123 | ||
124 | ||
125 | ||
126 | ||
127 | ||
128 | ||
129 | Printed 7/27/90 December 2 | |
130 | ||
131 | ||
132 |