*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> unifdef (1)              
Title
Content
Arch
Section
 

unifdef(1)

Contents


NAME    [Toc]    [Back]

       unifdef - Removes #ifdefed lines

SYNOPSIS    [Toc]    [Back]

       unifdef  [-tlc]  [-Dsymbol] [-idsymbol] [-iusymbol] [file]
       [-Usymbol]

       The unifdef command partially simulates  the  behavior  of
       the C preprocessor in processing #ifdef conditionals.

OPTIONS    [Toc]    [Back]

       Complements  the  action  of  unifdef;  retains lines that
       would normally be removed and  removes  lines  that  would
       normally  be  retained.   Specifies  symbol  as  a defined
       #ifdef symbol.  Specifies  defined  lines  inside  certain
       #ifdefs to be ignored but copied out.  Specifies undefined
       lines inside certain #ifdefs to be ignored and not  copied
       out.   Replaces  removed lines with blank lines instead of
       deleting them.  Processes plain text (rather than C  code)
       input.  The unifdef command does not try to recognize comments,
 single quotes, and double quotes.  Specifies symbol
       as an undefined #ifdef symbol.

DESCRIPTION    [Toc]    [Back]

       The  unifdef  command recognizes nested #ifdefs, comments,
       single and double quotes of C syntax so that it can  function
  correctly,  but  does not include files or interpret
       macros. The  unifdef  command  recognizes,  but  does  not
       remove comments.

       The  unifdef command takes its input from stdin if no file
       argument is given, and copies its output to stdout.

       You specify the symbols you want defined with -Dsymbol  or
       undefined with -Usymbol and the lines inside those #ifdefs
       are copied to the output or removed, as  appropriate.  The
       #ifdef,  #ifndef, #else, #elif, and endif lines associated
       with  symbol  are  also  removed.  The  #ifdefs  involving
       unspecified  symbols  are  untouched  and copied out along
       with their associated  #ifdef,  #else,  elif,  and  #endif
       lines.   If the same symbol appears in more than one argument,
 only  the  first  occurrence  is  significant.   For
       instance,  if  an  #ifdef  X  occurs nested inside another
       #ifdef X, the inside #ifdef is considered an  unrecognized
       symbol.

       If  you  use  #ifdefs to delimit non-C lines, such as comments
 or unfinished code, it is necessary to specify which
       symbols  are  to be used for that purpose.  Otherwise, the
       unifdef command tries to parse for quotes and comments  in
       those #ifdef lines.

   Keywords    [Toc]    [Back]
       The  following  keywords can be used with the unifdef command:


       ifdef ifndef else endif elif

       The unifdef command uses  the  elif  keyword  as  follows.
       (Note that "Understood" means unifdef knows how to convert
       elif to if.)  Understood Not understood Not understood

       For example:

       # ifdef X x # elif defined (Y) y # elif  defined  (A)   ||
       defined (B) a # else default # endif

       The  following  list  shows  the results of using the elif
       keyword with variables:

       -DX x

       -UX # if defined (Y) y # elif defined (A)  || defined  (B)
       a # else default # endif -UX -DY y

       -UY  -UX # if defined (Y) y # elif defined (A)  || defined
       (B) a # else default # endif

       -UY -UX -DA # if defined (Y) y  #  elif  defined  (A)   ||
       defined (B) a # else default # endif

NOTES    [Toc]    [Back]

       The unifdef command cannot process cpp constructs such as:

       #if defined(X) || defined(Y)

DIAGNOSTICS    [Toc]    [Back]

       The unifdef command can fail for several reasons: a premature
  end  of  file,  or  an  inappropriate else, elif, or
       endif.

EXIT STATUS    [Toc]    [Back]

       Exit status is 0 if output is an exact copy of input, 1 if
       not, 2 if the unifdef command fails.

EXAMPLES    [Toc]    [Back]

       The  following  command line causes the unifdef command to
       read the file original.c and remove the  #ifdef  A  lines.
       It  then removes everything following an #elif/#else associated
 with the #ifdef A down to the #endif:  unifdef  -DA
       original.c  > modified.c The following command line causes
       the unifdef command  to  read  the  file  original.c,  and
       remove   the  #ifdef  A  down  to  either  its  associated
       #elif/#else, or its associated #endif: unifdef -UA  original.c
 > modified.c

              In  the  case  of  the #elif, the #elif is replaced
              with #if. In  the  case  of  #else,  the  #else  is
              deleted along with its associated #endif.

SEE ALSO    [Toc]    [Back]

      
      
       Commands:  diff(1)



                                                       unifdef(1)
[ Back ]
 Similar pages
Name OS Title
uniq Tru64 Removes or lists repeated lines in a file
paste HP-UX merge same lines of several files or subsequent lines of one file
paste IRIX merge same lines of several files or subsequent lines of one file
paste Tru64 Joins corresponding lines of several files or subsequent lines in one file
rmdir Tru64 Removes a directory
pxfrmdir IRIX Removes a directory entry
pxfunlink IRIX Removes a directory entry
atrm Tru64 Removes jobs spooled by at
DXmSvnRemoveComponent Tru64 Removes a component from each SVN entry.
rmfdmn Tru64 removes a file domain
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service