man(1) Manual page archive


     UNIFDEF(1)                                             UNIFDEF(1)

     NAME
          unifdef - remove ifdef'ed lines from C code

     SYNOPSIS
          unifdef [ -D name ][ -U name ][ -D name ][ -U name ][ -iD
          name ][ -iU name ][ -clt ][ file ]

     DESCRIPTION
          Unifdef reads the given file or standard input if not speci-
          fied and removes the specified  #ifdef, #ifndef, #else, and
          #endif lines, simplifying complex C or C++ code.  Ifdefs not
          specified on the command line are left untouched.  Only one
          level of ifdef nesting is processed on each pass.

          The ifdef and ifndef'ed symbols to be removed may be speci-
          fied with -Dname and -Uname respectively;

          If the -c flag is specified, then these flags are comple-
          mented.

          The -l option causes the replaced lines to be replaced with
          blank lines instead of deleting them.

          If the file does not contain option may be useful to disable
          comment and quote parsing.

          Unifdef's comment and quote parsing maybe removed by ifdefs.
          Such code can be explicitly ignored using the disabled using
          -iDname and -iUname in a similar way to the -Dname and
          -Uname options above.

     DIAGNOSTICS
          Inappropriate else or endif.
          Premature EOF.

          Exit status is 0 if ifdefs where replaced, 1 if no changes
          where made, 2 if trouble.

     BUGS
          Does not deal with ``#if'' lines.

     HISTORY
          The unifdef command appeared in BSD 4.3 .