Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ifdef(1) [minix man page]

IFDEF(1)						      General Commands Manual							  IFDEF(1)

NAME
ifdef - remove #ifdefs from a file SYNOPSIS
ifdef [-t] [-dsymbol] [-Dsymbol] [-Usymbol] [-Isymbol] [file] OPTIONS
-D Define symbol permanently -I Ignore symbol -U Undefine symbol permanently -d Define symbol. It may be #undef'ed later -t Produce a table of the symbols on stdout EXAMPLES
ifdef -DUNIX file.c >newfile.c # Define UNIX ifdef -D_MINIX -UDOS <x.c >y.c # Define DESCRIPTION
Ifdef allows conditional code [ #ifdef ... #endif ] to be selectively removed from C files, but at the same time leaving all other C pre- processor commands intact such as #define, #include etc. Input to ifdef is either the file named as the last argument, or stdin if no file is named. Output goes to stdout. Symbols may be defined with the -d or -D flags just like cpp, except that the latter option ignores subsequent #undefs. It is not permit- ted to give values to symbols. Similarly, -U undefines a symbol and ignores subsequent #definess. Symbols defined with -I are ignored; any #ifdef using an ignored symbol will be left intact. IFDEF(1)

Check Out this Related Man Page

unifdef(1)							   User Commands							unifdef(1)

NAME
unifdef - resolve and remove ifdef'ed lines from C program source SYNOPSIS
unifdef [-clt] [-Dname] [-Uname] [-iDname] [-iUname] ... [filename] DESCRIPTION
unifdef removes ifdefed lines from a file while otherwise leaving the file alone. It is smart enough to deal with the nested ifdefs, com- ments, single and double quotes of C syntax, but it does not do any including or interpretation of macros. Neither does it strip out com- ments, 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 filename will also be removed. ifdefs involving symbols you do not specify are untouched and copied out along with their associated ifdef, else, and endiff1 lines. If an ifdefX occurs nested inside another ifdefX, 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
The following options are supported: -c Complement the normal operation. Lines that would have been removed or blanked are retained, and vice versa. -l Replace ``lines removed'' lines with blank lines. -t Plain text option. unifdef refrains from attempting to recognize comments and single and double quotes. -Dname Lines associated with the defined symbol name. -Uname Lines associated with the undefined symbol name. -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 will not try to parse for quotes and comments within them. -iUname Ignore, but print out, lines associated with the undefined symbol name. EXIT STATUS
The following exit values are returned: 0 Successful operation. 1 Operation failed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWbtool | +-----------------------------+-----------------------------+ SEE ALSO
diff(1), attributes(5) DIAGNOSTICS
Premature EOF Inappropriate else or endif. SunOS 5.11 14 Jan 1992 unifdef(1)
Man Page

Featured Tech Videos