SCCS-vsn: usr.bin/ctags/C.c 5.5
SCCS-vsn: usr.bin/ctags/ctags.c 5.8
SCCS-vsn: usr.bin/ctags/ctags.h 5.4
SCCS-vsn: usr.bin/ctags/fortran.c 5.5
SCCS-vsn: usr.bin/ctags/lisp.c 5.5
SCCS-vsn: usr.bin/ctags/print.c 5.4
SCCS-vsn: usr.bin/ctags/tree.c 5.5
SCCS-vsn: usr.bin/ctags/yacc.c 5.6
-static char sccsid[] = "@(#)C.c 5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)C.c 5.5 (Berkeley) %G%";
#endif /* not lint */
#include <stdio.h>
#endif /* not lint */
#include <stdio.h>
+#include <string.h>
+#include "ctags.h"
+
+static int func_entry(), str_entry();
+static void hash_entry();
* hash_entry --
* handle a line starting with a '#'
*/
* hash_entry --
* handle a line starting with a '#'
*/
hash_entry()
{
extern int dflag; /* -d: non-macro defines */
hash_entry()
{
extern int dflag; /* -d: non-macro defines */
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)ctags.c 5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)ctags.c 5.8 (Berkeley) %G%";
+#include <stdlib.h>
+#include "ctags.h"
/*
* ctags: create a tags file
/*
* ctags: create a tags file
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ctags.h 5.3 (Berkeley) %G%
+ * @(#)ctags.h 5.4 (Berkeley) %G%
-#include <stdio.h>
-#include <ctype.h>
-
#define bool char
#define YES 1
#define bool char
#define YES 1
-static char sccsid[] = "@(#)fortran.c 5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)fortran.c 5.5 (Berkeley) %G%";
-char *lbp; /* line buffer pointer */
+static void takeprec();
+
+char *lbp; /* line buffer pointer */
takeprec()
{
for (;isspace(*lbp);++lbp);
takeprec()
{
for (;isspace(*lbp);++lbp);
-static char sccsid[] = "@(#)lisp.c 5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)lisp.c 5.5 (Berkeley) %G%";
extern char *lbp; /* pointer shared with fortran */
extern char *lbp; /* pointer shared with fortran */
-static char sccsid[] = "@(#)print.c 5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)print.c 5.4 (Berkeley) %G%";
-#include <sys/types.h>
-#include <sys/file.h>
-#include <ctags.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "ctags.h"
extern char searchar; /* ex search character */
extern char searchar; /* ex search character */
if (node->right)
put_entries(node->right);
}
if (node->right)
put_entries(node->right);
}
-
-char *
-savestr(str)
- char *str;
-{
- register u_int len;
- register char *space;
- char *malloc();
-
- len = strlen(str) + 1;
- if (!(space = malloc((u_int)len))) {
- /*
- * should probably free up the tree, here,
- * we're just as likely to fail here as we
- * are when getting the NODE structure
- */
- fputs("ctags: no more space.\n",stderr);
- exit(1);
- }
- bcopy(str,space,len);
- return(space);
-}
-static char sccsid[] = "@(#)tree.c 5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)tree.c 5.5 (Berkeley) %G%";
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
extern char *curfile; /* current input file name */
register NODE *np;
register char *fp;
extern char *curfile; /* current input file name */
register NODE *np;
register char *fp;
- char nbuf[MAXTOKEN],
- *malloc(), *savestr();
/*NOSTRICT*/
if (!(np = (NODE *)malloc(sizeof(NODE)))) {
/*NOSTRICT*/
if (!(np = (NODE *)malloc(sizeof(NODE)))) {
*fp = EOS;
name = nbuf;
}
*fp = EOS;
name = nbuf;
}
- np->entry = savestr(name);
+ if (!(np->entry = strdup(name))) {
+ (void)fprintf(stderr, "ctags: %s\n", strerror(errno));
+ exit(1);
+ }
np->file = curfile;
np->lno = ln;
np->left = np->right = 0;
np->file = curfile;
np->lno = ln;
np->left = np->right = 0;
- np->pat = savestr(lbuf);
+ if (!(np->pat = strdup(lbuf))) {
+ (void)fprintf(stderr, "ctags: %s\n", strerror(errno));
+ exit(1);
+ }
if (!head)
head = np;
else
if (!head)
head = np;
else
-static char sccsid[] = "@(#)yacc.c 5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)yacc.c 5.6 (Berkeley) %G%";