From 93b3633be5a539b3d5806e62d37684c36d95d5ae Mon Sep 17 00:00:00 2001 From: Philippe Charnier Date: Wed, 12 Dec 2001 18:24:42 +0000 Subject: [PATCH] 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. --- usr.bin/ctags/C.c | 1 - usr.bin/ctags/ctags.1 | 54 +++++++++++++++++++++-------------------- usr.bin/ctags/ctags.c | 4 +-- usr.bin/ctags/fortran.c | 1 - usr.bin/ctags/print.c | 2 -- usr.bin/ctags/tree.c | 2 +- usr.bin/ctags/yacc.c | 3 +-- 7 files changed, 32 insertions(+), 35 deletions(-) diff --git a/usr.bin/ctags/C.c b/usr.bin/ctags/C.c index f7394c5fd024..b1f162ded031 100644 --- a/usr.bin/ctags/C.c +++ b/usr.bin/ctags/C.c @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include "ctags.h" diff --git a/usr.bin/ctags/ctags.1 b/usr.bin/ctags/ctags.1 index 7082995850d6..040519555d38 100644 --- a/usr.bin/ctags/ctags.1 +++ b/usr.bin/ctags/ctags.1 @@ -49,8 +49,8 @@ makes a tags file for .Xr ex 1 from the specified C, Pascal, Fortran, -.Tn YACC , -lex, and lisp sources. +Yacc, +Lex, and Lisp sources. 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 is defined, and a search pattern for the object definition, separated by @@ -64,33 +64,35 @@ Depending upon the options provided to .Nm , objects will consist of subroutines, typedefs, defines, structs, enums and unions. -.Bl -tag -width Ds +.Pp +The following options are available: +.Bl -tag -width indent .It Fl B -use backward searching patterns +Use backward searching patterns .Pq Li ?...? . .It Fl F -use forward searching patterns +Use forward searching patterns .Pq Li /.../ (the default). .It Fl a -append to +Append to .Ar tags file. .It Fl d -create tags for +Create tags for .Li #defines that don't take arguments; .Li #defines that take arguments are tagged automatically. .It Fl f -Places the tag descriptions in a file called +Place the tag descriptions in a file called .Ar tagsfile . The default behaviour is to place them in a file called .Ar tags . .It Fl t -create tags for typedefs, structs, unions, and enums. +Create tags for typedefs, structs, unions, and enums. .It Fl u -update the specified files in the +Update the specified files in the .Ar tags file, that is, all 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 .Ed .It Fl w -suppress warning diagnostics. +Suppress warning diagnostics. .It Fl x .Nm produces a list of object @@ -123,22 +125,22 @@ function index. .El .Pp Files whose names end in -.Nm \&.c +.Em \&.c or -.Nm \&.h +.Em \&.h are assumed to be C source files and are searched for C style routine and macro definitions. Files whose names end in -.Nm \&.y +.Em \&.y are assumed to be -.Tn YACC +Yacc source files. Files whose names end in -.Nm \&.l -are assumed to be lisp files if their +.Em \&.l +are assumed to be Lisp files if their first non-blank character is `;', `(', or `[', 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 searched for C style definitions. .Pp @@ -149,20 +151,20 @@ is created by prepending .Ar M to the name of the file, with the trailing -.Nm \&.c +.Em \&.c and any leading pathname components removed. This makes use of .Nm practical in directories with more than one program. .Pp -Yacc and lex files each have a special tag. +Yacc and Lex files each have a special tag. .Ar Yyparse is the start of the second section of the yacc file, and .Ar yylex is the start of -the second section of the lex file. +the second section of the Lex file. .Sh FILES .Bl -tag -width tags -compact .It Pa tags @@ -177,12 +179,12 @@ Duplicate objects are not considered errors. .Xr vi 1 .Sh BUGS Recognition of -.Nm functions , -.Nm subroutines +.Em functions , +.Em subroutines and -.Nm procedures +.Em procedures for -.Tn FORTRAN +Fortran and Pascal is done is a very simpleminded way. No attempt is made to deal with block structure; if you have two Pascal procedures in different blocks with the same name you lose. @@ -191,7 +193,7 @@ doesn't understand about Pascal types. .Pp The method of deciding whether to look for C, Pascal or -.Tn FORTRAN +Fortran functions is a hack. .Pp .Nm Ctags diff --git a/usr.bin/ctags/ctags.c b/usr.bin/ctags/ctags.c index 199ffb64e1ea..eb9519b9f942 100644 --- a/usr.bin/ctags/ctags.c +++ b/usr.bin/ctags/ctags.c @@ -49,8 +49,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include #include "ctags.h" @@ -188,7 +188,7 @@ usage() /* * 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. * Every char which is NOT in that string is false with respect to * the pseudo-function. Therefore, all of the array "_wht" is NO diff --git a/usr.bin/ctags/fortran.c b/usr.bin/ctags/fortran.c index 2195606242c4..05b4acbf72f3 100644 --- a/usr.bin/ctags/fortran.c +++ b/usr.bin/ctags/fortran.c @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "ctags.h" diff --git a/usr.bin/ctags/print.c b/usr.bin/ctags/print.c index 36c790bd85b6..be64dca15ec4 100644 --- a/usr.bin/ctags/print.c +++ b/usr.bin/ctags/print.c @@ -42,8 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include "ctags.h" diff --git a/usr.bin/ctags/tree.c b/usr.bin/ctags/tree.c index ac99639cf371..8c9b25c663f2 100644 --- a/usr.bin/ctags/tree.c +++ b/usr.bin/ctags/tree.c @@ -71,7 +71,7 @@ pfnote(name, ln) free_tree(head); /*NOSTRICT*/ if (!(head = np = (NODE *)malloc(sizeof(NODE)))) - err(1, "out of space"); + errx(1, "out of space"); } if (!xflag && !strcmp(name, "main")) { if (!(fp = strrchr(curfile, '/'))) diff --git a/usr.bin/ctags/yacc.c b/usr.bin/ctags/yacc.c index f6f2c3f6ebfb..025a623e38ea 100644 --- a/usr.bin/ctags/yacc.c +++ b/usr.bin/ctags/yacc.c @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "ctags.h" @@ -133,7 +132,7 @@ toss_yysec() * state == 0 : waiting * state == 1 : received a newline * state == 2 : received first % - * state == 3 : recieved second % + * state == 3 : received second % */ lineftell = ftell(inf); for (state = 0; GETC(!=, EOF);)