Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ unifdef(1) — Ultrix/UWS 4.0 VAX

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

diff(1)

unifdef(1)  —  Unsupported

Name

unifdef − removes ifdef’ed lines

Syntax

unifdef [ −c −Dsym −idsym −iusym −l −t −Usym ] ...  [ file ]

Arguments

symThe ifdef, ifndef, else, and endif lines associated with the symbol, sym , will also be removed. 

fileThe unifdef command copies its output to stdout and will take its input from stdin if no file argument is given. 

Description

The unifdef command is useful for removing ifdef’ed lines from a file while otherwise leaving the file alone. The unifdef command is like a stripped-down C preprocessor: it is smart enough to deal with the nested ifdefs, comments, single and double quotes of C syntax so that it can do its job, but it doesn’t do any including or interpretation of macros. Neither does it strip out comments, though it recognizes and ignores them. Ifdefs involving symbols you don’t specify are untouched and copied out along with their associated ifdef, else, and endif lines. If an ifdef X occurs nested inside another ifdef X, then the inside ifdef is treated as if it were an unrecognized symbol. If the same symbol appears in more than one argument, only the first occurrence is significant.

If you use ifdefs to delimit non-C lines, such as comments or code which is under construction, then you must tell unifdef which symbols are used for that purpose so that it won’t try to parse for quotes and comments in those ifdef’ed lines. 

Options

−cCauses the operation of unifdef to be complemented. The lines that would have been removed or blanked are retained and vice versa.

−idsymSpecifies that you want the lines inside certain ifdefs to be ignored, but copied out. 

−iusymSpecifies that you want the lines inside certain ifdefs to be ignored, but copied out. 

−lCauses unifdef to replace removed lines with blank lines instead of deleting them.

−tMakes unifdef refrain from attempting to recognize comments and single and double quotes. This option is for use on plain text (not C code).

−DsymSpecifies which symbols you want defined and the lines inside those ifdefs will be copied to the output. 

−UsymSpecifies which symbols you want undefined and the lines inside those ifdefs will be removed. 

Diagnostics

Premature EOF, inappropriate else or endif. 

Exit status is 0 if output is exact copy of input, 1 if not, 2 if trouble. 

Restrictions

Does not know how to deal with cpp constructs such as

#ifdefined(X) || defined(Y)

See Also

diff(1)
 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026