home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / elvis184.zip / os2 / ctags.doc next >
Text File  |  1994-01-17  |  5KB  |  133 lines

  1.  
  2.  
  3. NAME
  4.        ctags - Generates "tags" and (optionally) "refs" files
  5.  
  6. SYNOPSIS
  7.        ctags [-BSstvraT] filesnames...
  8.  
  9. DESCRIPTION
  10.        ctags  generates  the "tags" and "refs" files from a group
  11.        of C source files.  The "tags"  file  is  used  by  Elvis'
  12.        ":tag"  command,  control-]  command,  and -t option.  The
  13.        "refs" file is sometimes used by the ref(1) program.
  14.  
  15.        Each C source file is scanned for #define  statements  and
  16.        global  function  definitions.   The  name of the macro or
  17.        function becomes the name of a tag.  For each tag, a  line
  18.        is added to the "tags" file which contains:
  19.                      - the name of the tag
  20.                      - a tab character
  21.                      - the name of the file containing the tag
  22.                      - a tab character
  23.                      - a way to find the particular line within the file.
  24.  
  25.        The  filenames  list  will typically be the names of all C
  26.        source files in the current directory, like this:
  27.               $ ctags -stv *.[ch]
  28.  
  29. OPTIONS
  30.        -B     Normally, ctags  encloses  regular  expressions  in
  31.               slashes  (/regexp/)  which  causes  elvis to search
  32.               from the top of the file.  The -B flag causes ctags
  33.               to  enclose  the  regular  expressions  in question
  34.               marks (?regexp?) so elvis will search backward from
  35.               the bottom of the file.  This rarely matters.
  36.  
  37.        -t     Include typedefs.  A tag will be generated for each
  38.               user-defined type.  Also tags will be generated for
  39.               struct  and enum names.  Types are considered to be
  40.               global if they are defined in a  header  file,  and
  41.               static if they are defined in a C source file.
  42.  
  43.        -v     Include  variable declarations.  A tag will be gen-
  44.               erated for each variable, except for those that are
  45.               declared inside the body of a function.
  46.  
  47.        -s     Include  static  tags.   Ctags  will  normally  put
  48.               global tags in the "tags" file, and silently ignore
  49.               the  static tags.  This flag causes both global and
  50.               static tags to be added.  The name of a static  tag
  51.               is  generated by prefixing the name of the declared
  52.               item with the name of the file where it is defined,
  53.               with  a  colon  in  between.   For example, "static
  54.               foo(){}"  in  "bar.c"  results  in  a   tag   named
  55.               "bar.c:foo".
  56.  
  57.  
  58.  
  59.  
  60.                                                                 1
  61.  
  62.  
  63.  
  64.  
  65.  
  66. CTAGS(1)                                                 CTAGS(1)
  67.  
  68.  
  69.        -S     Include static tags, but make them look like global
  70.               tags.  Most  tags-aware  programs  don't  like  the
  71.               "filename:tagname" tags produced by the -s flag, so
  72.               -S was added as an alternative.  If elvis  and  ref
  73.               are the only programs that read the tags file, then
  74.               you don't need -S; otherwise you do.
  75.  
  76.        -r     This causes  ctags  to  generate  both  "tags"  and
  77.               "refs".  Without -r, it would only generate "tags".
  78.  
  79.        -a     Append to  "tags",  and  maybe  "refs".   Normally,
  80.               ctags  overwrites  these  files  each  time  it  is
  81.               invoked.  This flag is useful when you have to many
  82.               files in the current directory for you to list them
  83.               on a single command-line; it allows  you  to  split
  84.               the arguments among several invocations.
  85.  
  86.        -T     This flag isn't available on all systems.  UNIX has
  87.               it, but most others don't.  The  -T  flag  prevents
  88.               ctags  from generating a "tags" file.  This is use-
  89.               ful when you want  to  generate  a  "refs"  without
  90.               changing "tags".
  91.  
  92. FILES
  93.        tags   A  cross-reference  that  lists  each tag name, the
  94.               name of the source file that contains it, and a way
  95.               to locate a particular line in the source file.
  96.  
  97.        refs   The  "refs"  file contains the definitions for each
  98.               tag in the "tags" file, and very little else.  This
  99.               file  can  be  useful,  for example, when licensing
  100.               restrictions prevent you  from  making  the  source
  101.               code  to  the standard C library readable by every-
  102.               body, but you still everybody to  know  what  argu-
  103.               ments the library functions need.
  104.  
  105. BUGS
  106.        ctags  is  sensitive to indenting and line breaks.  Conse-
  107.        quently, it might not discover all of the tags in  a  file
  108.        that is formatted in an unusual way.
  109.  
  110. SEE ALSO
  111.        elvis(1), refs(1)
  112.  
  113. AUTHOR
  114.        Steve Kirkendall
  115.        kirkenda@cs.pdx.edu
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.                                                                 2
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.