Remove unused #includes. lex -> Lex, yacc -> Yacc, ... Some .Nm to .Em

conversions. Sort #includes. Spelling. use errx() instead of err() when
explicit message is given.
This commit is contained in:
Philippe Charnier 2001-12-12 18:24:42 +00:00
parent b0a2f60daf
commit 93b3633be5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87750
7 changed files with 32 additions and 35 deletions

View File

@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$");
#include <limits.h> #include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include "ctags.h" #include "ctags.h"

View File

@ -49,8 +49,8 @@ makes a tags file for
.Xr ex 1 .Xr ex 1
from the specified C, from the specified C,
Pascal, Fortran, Pascal, Fortran,
.Tn YACC , Yacc,
lex, and lisp sources. Lex, and Lisp sources.
A tags file gives the locations of specified objects in a group of files. A tags file gives the locations of specified objects in a group of files.
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
@ -64,33 +64,35 @@ Depending upon the options provided to
.Nm , .Nm ,
objects will consist of subroutines, typedefs, defines, structs, objects will consist of subroutines, typedefs, defines, structs,
enums and unions. enums and unions.
.Bl -tag -width Ds .Pp
The following options are available:
.Bl -tag -width indent
.It Fl B .It Fl B
use backward searching patterns Use backward searching patterns
.Pq Li ?...? . .Pq Li ?...? .
.It Fl F .It Fl F
use forward searching patterns Use forward searching patterns
.Pq Li /.../ .Pq Li /.../
(the default). (the default).
.It Fl a .It Fl a
append to Append to
.Ar tags .Ar tags
file. file.
.It Fl d .It Fl d
create tags for Create tags for
.Li #defines .Li #defines
that don't take arguments; that don't take arguments;
.Li #defines .Li #defines
that take arguments are tagged automatically. that take arguments are tagged automatically.
.It Fl f .It Fl f
Places the tag descriptions in a file called Place the tag descriptions in a file called
.Ar tagsfile . .Ar tagsfile .
The default behaviour is to place them in a file called The default behaviour is to place them in a file called
.Ar tags . .Ar tags .
.It Fl t .It Fl t
create tags for typedefs, structs, unions, and enums. Create tags for typedefs, structs, unions, and enums.
.It Fl u .It Fl u
update the specified files in the Update the specified files in the
.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
@ -112,7 +114,7 @@ ctags \-v files \&| sort \-f > index
vgrind \-x index vgrind \-x index
.Ed .Ed
.It Fl w .It Fl w
suppress warning diagnostics. Suppress warning diagnostics.
.It Fl x .It Fl x
.Nm .Nm
produces a list of object produces a list of object
@ -123,22 +125,22 @@ function index.
.El .El
.Pp .Pp
Files whose names end in Files whose names end in
.Nm \&.c .Em \&.c
or or
.Nm \&.h .Em \&.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 .Em \&.y
are assumed to be are assumed to be
.Tn YACC Yacc
source files. source files.
Files whose names end in Files whose names end in
.Nm \&.l .Em \&.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 `;', `(', or `[',
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
@ -149,20 +151,20 @@ is created by prepending
.Ar M .Ar M
to the name of the file, with the to the name of the file, with the
trailing trailing
.Nm \&.c .Em \&.c
and any leading pathname components removed. This and any leading pathname components removed. This
makes use of 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
is the start is the start
of the second section of the yacc file, and of the second section of the yacc file, and
.Ar yylex .Ar yylex
is the start of is the start of
the second section of the lex file. the second section of the Lex file.
.Sh FILES .Sh FILES
.Bl -tag -width tags -compact .Bl -tag -width tags -compact
.It Pa tags .It Pa tags
@ -177,12 +179,12 @@ Duplicate objects are not considered errors.
.Xr vi 1 .Xr vi 1
.Sh BUGS .Sh BUGS
Recognition of Recognition of
.Nm functions , .Em functions ,
.Nm subroutines .Em subroutines
and and
.Nm procedures .Em procedures
for for
.Tn FORTRAN Fortran
and Pascal is done is a very simpleminded way. No attempt and Pascal is done is a very simpleminded 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.
@ -191,7 +193,7 @@ doesn't
understand about Pascal types. understand about Pascal types.
.Pp .Pp
The method of deciding whether to look for C, Pascal or The method of deciding whether to look for C, Pascal or
.Tn FORTRAN Fortran
functions is a hack. functions is a hack.
.Pp .Pp
.Nm Ctags .Nm Ctags

View File

@ -49,8 +49,8 @@ __FBSDID("$FreeBSD$");
#include <err.h> #include <err.h>
#include <limits.h> #include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <unistd.h> #include <unistd.h>
#include "ctags.h" #include "ctags.h"
@ -188,7 +188,7 @@ usage()
/* /*
* init -- * init --
* this routine sets up the boolean psuedo-functions which work by * this routine sets up the boolean pseudo-functions which work by
* setting boolean flags dependent upon the corresponding character. * setting boolean flags dependent upon the corresponding character.
* Every char which is NOT in that string is false with respect to * Every char which is NOT in that string is false with respect to
* the pseudo-function. Therefore, all of the array "_wht" is NO * the pseudo-function. Therefore, all of the array "_wht" is NO

View File

@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
#include <ctype.h> #include <ctype.h>
#include <limits.h> #include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include "ctags.h" #include "ctags.h"

View File

@ -42,8 +42,6 @@ __FBSDID("$FreeBSD$");
#include <limits.h> #include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h> #include <unistd.h>
#include "ctags.h" #include "ctags.h"

View File

@ -71,7 +71,7 @@ pfnote(name, ln)
free_tree(head); free_tree(head);
/*NOSTRICT*/ /*NOSTRICT*/
if (!(head = np = (NODE *)malloc(sizeof(NODE)))) if (!(head = np = (NODE *)malloc(sizeof(NODE))))
err(1, "out of space"); errx(1, "out of space");
} }
if (!xflag && !strcmp(name, "main")) { if (!xflag && !strcmp(name, "main")) {
if (!(fp = strrchr(curfile, '/'))) if (!(fp = strrchr(curfile, '/')))

View File

@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
#include <ctype.h> #include <ctype.h>
#include <limits.h> #include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include "ctags.h" #include "ctags.h"
@ -133,7 +132,7 @@ toss_yysec()
* state == 0 : waiting * state == 0 : waiting
* state == 1 : received a newline * state == 1 : received a newline
* state == 2 : received first % * state == 2 : received first %
* state == 3 : recieved second % * state == 3 : received second %
*/ */
lineftell = ftell(inf); lineftell = ftell(inf);
for (state = 0; GETC(!=, EOF);) for (state = 0; GETC(!=, EOF);)