version 1.8, 2000/03/04 22:19:22 |
version 1.9, 2000/03/05 20:09:21 |
|
|
Each line of the tags file contains the object name, the file in which it |
Each line of the tags file contains the object name, the file in which it |
is defined, and a search pattern for the object definition, separated by |
is defined, and a search pattern for the object definition, separated by |
whitespace. |
whitespace. |
|
.Pp |
Using the |
Using the |
.Ar tags |
.Ar tags |
file, |
file, |
|
|
.Nm ctags , |
.Nm ctags , |
objects will consist of subroutines, typedefs, defines, structs, |
objects will consist of subroutines, typedefs, defines, structs, |
enums, and unions. |
enums, and unions. |
|
.Pp |
|
The options are as follows: |
.Bl -tag -width Ds |
.Bl -tag -width Ds |
.It Fl B |
.It Fl B |
Use backward searching patterns |
Use backward searching patterns |
|
|
.Ar tags |
.Ar tags |
file, that is, all |
file, that is, all |
references to them are deleted, and the new values are appended to the |
references to them are deleted, and the new values are appended to the |
file. (Beware: this option is implemented in a way which is rather |
file. |
|
(Beware: this option is implemented in a way which is rather |
slow; it is usually faster to simply rebuild the |
slow; it is usually faster to simply rebuild the |
.Ar tags |
.Ar tags |
file.) |
file.) |
.It Fl v |
.It Fl v |
An index of the form expected by |
An index of the form expected by |
.Xr vgrind 1 |
.Xr vgrind 1 |
is produced on the standard output. This listing |
is produced on the standard output. |
contains the object name, file name, and page number (assuming 64 |
This listing contains the object name, file name, and page number (assuming |
line pages). Since the output will be sorted into lexicographic order, |
64 line pages). |
|
Since the output will be sorted into lexicographic order, |
it may be desired to run the output through |
it may be desired to run the output through |
.Xr sort 1 . |
.Xr sort 1 . |
Sample use: |
Sample use: |
|
|
.Nm |
.Nm |
produces a list of object |
produces a list of object |
names, the line number and file name on which each is defined, as well |
names, the line number and file name on which each is defined, as well |
as the text of that line and prints this on the standard output. This |
as the text of that line and prints this on the standard output. |
is a simple index which can be printed out as an off-line readable |
This is a simple index which can be printed out as an off-line readable |
function index. |
function index. |
.El |
.El |
.Pp |
.Pp |
Files whose names end in |
Files whose names end in |
.Nm \&.c |
.Dq \&.c |
or |
or |
.Nm \&.h |
.Dq \&.h |
are assumed to be C |
are assumed to be C |
source files and are searched for C style routine and macro definitions. |
source files and are searched for C style routine and macro definitions. |
Files whose names end in |
Files whose names end in |
.Nm \&.y |
.Dq \&.y |
are assumed to be |
are assumed to be |
.Tn YACC |
.Tn YACC |
source files. |
source files. |
Files whose names end in |
Files whose names end in |
.Nm \&.l |
.Dq \&.l |
are assumed to be lisp files if their |
are assumed to be lisp files if their |
first non-blank character is `;', `(', or `[', |
first non-blank character is |
|
.Ql \&; , |
|
.Ql ( , |
|
or |
|
.Ql [ , |
otherwise, they are |
otherwise, they are |
treated as lex files. Other files are first examined to see if they |
treated as lex files. |
|
Other files are first examined to see if they |
contain any Pascal or Fortran routine definitions, and, if not, are |
contain any Pascal or Fortran routine definitions, and, if not, are |
searched for C style definitions. |
searched for C style definitions. |
.Pp |
.Pp |
The tag |
The tag |
.Li main |
.Li main |
is treated specially in C programs. The tag formed |
is treated specially in C programs. |
is created by prepending |
The tag formed is created by prepending |
.Ar M |
.Sq M |
to the name of the file, with the |
to the name of the file, with the |
trailing |
trailing |
.Nm \&.c |
.Dq \&.c |
and any leading pathname components removed. This |
and any leading pathname components removed. |
makes use of |
This makes use of |
.Nm |
.Nm |
practical in directories with more than one |
practical in directories with more than one program. |
program. |
|
.Pp |
.Pp |
Yacc and lex files each have a special tag. |
Yacc and lex files each have a special tag. |
.Ar Yyparse |
.Ar Yyparse |
|
|
.Nm procedures |
.Nm procedures |
for |
for |
.Tn FORTRAN |
.Tn FORTRAN |
and Pascal is done in a very simple-minded way. No attempt |
and Pascal is done in a very simple-minded way. |
|
No attempt |
is made to deal with block structure; if you have two Pascal procedures |
is made to deal with block structure; if you have two Pascal procedures |
in different blocks with the same name you lose. |
in different blocks with the same name you lose. |
.Nm |
.Nm |
|
|
.Pp |
.Pp |
.Nm |
.Nm |
relies on the input being well formed, and any syntactical |
relies on the input being well formed, and any syntactical |
errors will completely confuse it. It also finds some legal syntax |
errors will completely confuse it. |
confusing; for example, since it doesn't understand |
It also finds some legal syntax confusing; for example, |
|
since it doesn't understand |
.Li #ifdef Ns 's |
.Li #ifdef Ns 's |
(incidentally, that's a feature, not a bug), any code with unbalanced |
(incidentally, that's a feature, not a bug), any code with unbalanced |
braces inside |
braces inside |
|
|
will cause it to become somewhat disoriented. |
will cause it to become somewhat disoriented. |
In a similar fashion, multiple line changes within a definition will |
In a similar fashion, multiple line changes within a definition will |
cause it to enter the last line of the object, rather than the first, as |
cause it to enter the last line of the object, rather than the first, as |
the searching pattern. The last line of multiple line |
the searching pattern. |
|
The last line of multiple line |
.Li typedef Ns 's |
.Li typedef Ns 's |
will similarly be noted. |
will similarly be noted. |
.Sh HISTORY |
.Sh HISTORY |