Specify that a symbol is defined, and optionally specify what value to give it for the purpose of handling #if and #elif directives.
Specify that a symbol is undefined. If the same symbol appears in more than one argument, the last occurrence dominates.
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.
Turn on printing of degugging messages.
Because unifdef processes its input one line at a time, it cannot remove preprocessor directives that span more than one line. The most common example of this is a directive with a multi-line comment hanging off its right hand end. By default, if unifdef has to process such a directive, it will complain that the line is too obfuscated. The -e option changes the behaviour so that, where possible, such lines are left unprocessed instead of reporting an error.
Process #if and #elif lines with constant expressions. By default, sections controlled by such lines are passed through unchanged because they typically start ""#if 0"" and are used as a kind of comment to sketch out future or past development. It would be rude to strip them out, just as it would be for normal comments.
Replace removed lines with blank lines instead of deleting them.
Add #line directives to the output following any deleted lines, so that errors produced when compiling the output file correspond to line numbers in the input file.
Instead of processing the input file as usual, this option causes unifdef to produce a list of symbols that appear in expressions that unifdef understands. It is useful in conjunction with the -dM option of cpp(1) for creating unifdef command lines.
Disables parsing for C comments and line continuations, which is useful for plain text.
-iD sym [= val] -iU sym
Ignore #ifdef s. If your C code uses #ifdef s 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 comments and line continuations inside those #ifdef s. One specifies ignored symbols with -iD sym[= val] and -iU sym similar to -D sym [= val] and -U sym above.
Specifies to unifdefall an additional place to look for #include files. This option is ignored by unifdef for compatibility with cpp(1) and to simplify the implementation of unifdefall.
The unifdef utility copies its output to stdout and will take its input from stdin if no file argument is given.
The unifdef utility works nicely with the -D sym option of diff(1).