Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ unifdef(1) — SunOS 3.2/SYS4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

diff(1)

UNIFDEF(1)  —  USER COMMANDS

NAME

unifdef − resolve and remove ifdef’ed lines

SYNOPSIS

unifdef [ −t ] [ −l ] [ −c ] [ −Dname ] [ −Uname ] [ −idname ] [ −iuname ] ... [ filename ]

DESCRIPTION

unifdef removes ifdef’ed lines from a file while otherwise leaving the file alone.  It is smart enough to deal with the nested ifdefs, comments, single and double quotes of C syntax, but it doesn’t do any including or interpretation of macros.  Neither does it strip out comments, though it recognizes and ignores them.  You specify which symbols you want defined with −D options, and which you want undefined with −U options.  Lines within those ifdefs will be copied to the output, or removed, as appropriate.  Any ifdef, ifndef, else, and endif lines associated with name will also be removed. 

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. 

unifdef copies its output to the standard output and will take its input from the standard input if no filename argument is given. 

OPTIONS

−t Plain text option.  unifdef refrains from attempting to recognize comments and single and double quotes. 

−l Replace lines removed lines with blank lines. 

−idname
Ignore, but print out, lines associated with the defined symbol name.  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 within them. 

−iuname
Ignore, but print out, lines associated with the undefined symbol name. 

−c Complement the normal operation.  Lines that would have been removed or blanked are retained, and vice versa. 

SEE ALSO

diff(1)

DIAGNOSTICS

Premature EOF, inappropriate else or endif. 

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

BUGS

Does not know how to deal with cpp constructs such as

#ifdefined(X) || defined(Y)

Sun Release 3.2  —  Last change: 11 April 1986

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