Home
Search all pages
Subjects
By activity
Professions, Sciences, Humanities, Business, ...
User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...
Text Strings
Conversions, tests, processing, manipulation,...
Math
Integer, Floating point, Matrix, Statistics, Boolean, ...
Processing
Algorithms, Memory, Process control, Debugging, ...
Stored Data
Data storage, Integrity, Encryption, Compression, ...
Communications
Networks, protocols, Interprocess, Remote, Client Server, ...
Hard World Timing, Calendar and Clock, Audio, Video, Printer, Controls...
File System
Management, Filtering, File & Directory access, Viewers, ...
|
|
|
RocketLink!--> Man page versions:
OpenBSD
FreeBSD
NetBSD
Solaris
Others
UNIFDEF(1) OpenBSD Reference Manual UNIFDEF(1)
NAME
unifdef - remove ifdef'ed lines
SYNOPSIS
unifdef [-clt] [-Dsym -Usym -iDsym -iDsym] ... [file]
DESCRIPTION
unifdef is useful for removing ifdef'ed lines from a file while otherwise
leaving the file alone. unifdef acts on #ifdef, #ifndef, #else, and #en-
dif lines, and it knows only enough about C to know when one of these is
inactive because it is inside a comment, or a single or double quote.
Parsing for quotes is very simplistic: when it finds an open quote, it
ignores everything (except escaped quotes) until it finds a close quote,
and it will not complain if it gets to the end of a line and finds no
backslash for continuation.
The options are as follows:
-Dsym
-Usym Specify which symbols to define or undefine, and the lines inside
those ifdefs will be copied to the output or removed as appropri-
ate. The ifdef, ifndef, else, and endif lines associated with
sym will also be removed. ifdefs involving symbols you don't
specify and ``#if'' control lines 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, the last occur-
rence dominates.
-c If the -c flag is specified, then the operation of unifdef is
complemented, i.e. the lines that would have been removed or
blanked are retained and vice versa.
-l Replace removed lines with blank lines instead of deleting them.
-t Disables parsing for C comments and quotes, which is useful for
plain text.
-iDsym
-iUsym Ignore ifdefs. If your C code uses 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 inside those
ifdefs. One specifies ignored ifdefs with -iDsym and -iUsym sim-
ilar to -Dsym and -Usym above.
unifdef copies its output to stdout and will take its input from stdin if
no file argument is given.
unifdef works nicely with the -Dsym option added to diff(1) as of the 4.1
Berkeley Software Distribution.
SEE ALSO
diff(1)
DIAGNOSTICS
Inappropriate else or endif.
Premature EOF with line numbers of the unterminated #ifdefs.
Exit status is 0 if output is exact copy of input, 1 if not, 2 if trou-
ble.
BUGS
Should try to deal with ``#if'' lines.
Doesn't work correctly if input contains null characters.
HISTORY
The unifdef command appeared in 4.3BSD.
OpenBSD 2.6 April 1, 1994 2
Source: OpenBSD 2.6 man pages. Copyright: Portions are copyrighted by BERKELEY SOFTWARE DESIGN, INC., The Regents of the University of California, Massachusetts Institute of Technology, Free Software Foundation, FreeBSD Inc., and others. |
(Corrections, notes, and links courtesy of RocketAware.com)
FreeBSD Sources for unifdef(1) OpenBSD sources for unifdef(1)
Up to: C/C++
RocketLink!--> Man page versions:
OpenBSD
FreeBSD
NetBSD
Solaris
Others
Rapid-Links:
Search | About | Comments | Submit Path: RocketAware >
unifdef.1/
RocketAware.com is a service of Mib Software Copyright 1999, Forrest J. Cavalier III. All Rights Reserved. We welcome submissions and comments
|