1 diff -c -r -N /usr/local/src/nvi-1.79/build/Makefile.in ./build/Makefile.in
2 *** /usr/local/src/nvi-1.79/build/Makefile.in Wed Oct 23 22:43:38 1996
3 --- ./build/Makefile.in Fri Aug 14 01:41:14 1998
9 ! CFLAGS= -c $(OPTFLAG) @CFLAGS@ -I. -I$(srcdir)/include @CPPFLAGS@
11 PERL= @vi_cv_path_perl@
12 PERLLIB=@vi_cv_perllib@
17 ! CFLAGS= -c $(OPTFLAG) @CFLAGS@ -I. -I$(srcdir)/include @CPPFLAGS@ -DGTAGS
19 PERL= @vi_cv_path_perl@
20 PERLLIB=@vi_cv_perllib@
21 diff -c -r -N /usr/local/src/nvi-1.79/common/main.c ./common/main.c
22 *** /usr/local/src/nvi-1.79/common/main.c Sat Oct 12 07:28:28 1996
23 --- ./common/main.c Fri Aug 14 01:41:14 1998
29 int ch, flagchk, lflag, secure, startup, readonly, rval, silent;
33 char *tag_f, *wsizearg, path[256];
35 /* Initialize the busy routine, if not defined by the screen. */
39 /* Set the file snapshot flag. */
40 F_SET(gp, G_SNAPSHOT);
44 + while ((ch = getopt(argc, argv, "c:D:eFGlRrSsT:t:vw:")) != EOF)
46 + while ((ch = getopt(argc, argv, "c:eFGlRrSst:vw:")) != EOF)
50 while ((ch = getopt(argc, argv, "c:D:eFlRrSsT:t:vw:")) != EOF)
52 while ((ch = getopt(argc, argv, "c:eFlRrSst:vw:")) != EOF)
56 case 'c': /* Run the command. */
61 case 'F': /* No snapshot. */
62 F_CLR(gp, G_SNAPSHOT);
65 + case 'G': /* gtags mode. */
69 case 'l': /* Set lisp, showmatch options. */
77 *oargp++ = O_READONLY;
80 + *oargp++ = O_GTAGSMODE;
84 *oargp = -1; /* Options initialization. */
85 diff -c -r -N /usr/local/src/nvi-1.79/common/options.c ./common/options.c
86 *** /usr/local/src/nvi-1.79/common/options.c Tue Oct 15 03:56:29 1996
87 --- ./common/options.c Fri Aug 14 01:41:14 1998
91 {"filec", NULL, OPT_STR, 0},
93 {"flash", NULL, OPT_1BOOL, 0},
95 + /* O_GTAGSMODE FreeBSD2.2 */
96 + {"gtagsmode", NULL, OPT_0BOOL, 0},
99 {"hardtabs", NULL, OPT_NUM, 0},
100 /* O_ICLOWER 4.4BSD */
104 {"eb", O_ERRORBELLS}, /* 4BSD */
105 {"ed", O_EDCOMPATIBLE}, /* 4BSD */
106 {"ex", O_EXRC}, /* System V (undocumented) */
108 + {"gt", O_GTAGSMODE}, /* FreeBSD2.2 */
110 {"ht", O_HARDTABS}, /* 4BSD */
111 {"ic", O_IGNORECASE}, /* 4BSD */
112 {"li", O_LINES}, /* 4.4BSD */
113 diff -c -r -N /usr/local/src/nvi-1.79/docs/USD.doc/vi.man/vi.1 ./docs/USD.doc/vi.man/vi.1
114 *** /usr/local/src/nvi-1.79/docs/USD.doc/vi.man/vi.1 Fri Oct 11 10:34:05 1996
115 --- ./docs/USD.doc/vi.man/vi.1 Fri Aug 14 01:41:14 1998
171 Start editing with the lisp and showmatch options set.
174 + Start editing in gtags mode, as if the gtagsmode option was set.
177 Start editing in read-only mode, as if the command name was
184 Push a tag reference onto the tag stack.
185 + In gtagsmode, if at the first column of line,
186 + locate function references otherwise function definitions.
189 Switch to the most recently edited file.
194 Rewind the argument list.
196 + .B "rta[g][!] tagstring"
197 + Edit the file refering the specified tag. (Only in gtagsmode)
199 .B "se[t] [option[=[value]] ...] [nooption ...] [option? ...] [all]"
200 Display or set editor options.
207 Flash the screen instead of beeping the keyboard on error.
209 + .B "gtagsmode, gt [off]"
210 + Use GTAGS and GRTAGS instead of tags.
212 .B "hardtabs, ht [8]"
213 Set the spacing between hardware tab settings.
214 diff -c -r -N /usr/local/src/nvi-1.79/ex/ex.h ./ex/ex.h
215 *** /usr/local/src/nvi-1.79/ex/ex.h Tue Aug 13 09:24:00 1996
216 --- ./ex/ex.h Fri Aug 14 01:41:14 1998
220 #define E_SEARCH_WMSG 0x01000000 /* Display search-wrapped message. */
221 #define E_USELASTCMD 0x02000000 /* Use the last command. */
222 #define E_VISEARCH 0x04000000 /* It's really a vi search command. */
224 + #define E_REFERENCE 0x08000000 /* locate function references */
226 u_int32_t flags; /* Current flags. */
229 diff -c -r -N /usr/local/src/nvi-1.79/ex/ex_cmd.c ./ex/ex_cmd.c
230 *** /usr/local/src/nvi-1.79/ex/ex_cmd.c Wed Oct 23 22:31:01 1996
231 --- ./ex/ex_cmd.c Fri Aug 14 01:41:14 1998
237 "re-edit all the files in the file argument list"},
240 + {"rtag", ex_rtag_push, E_NEWSCREEN,
242 + "rta[g][!] [string]",
243 + "edit the file containing the tag"},
247 * Adding new commands starting with 's' may break the substitute command code
248 diff -c -r -N /usr/local/src/nvi-1.79/ex/ex_tag.c ./ex/ex_tag.c
249 *** /usr/local/src/nvi-1.79/ex/ex_tag.c Mon Sep 16 05:02:43 1996
250 --- ./ex/ex_tag.c Fri Aug 14 01:53:35 1998
254 static int compare __P((char *, char *, char *));
255 static void ctag_file __P((SCR *, TAGF *, char *, char **, size_t *));
256 static int ctag_search __P((SCR *, char *, size_t, char *));
258 + static int getentry __P((char *, char **, char **, char **));
259 + static TAGQ *gtag_slist __P((SCR *, char *, int));
261 static int ctag_sfile __P((SCR *, TAGF *, TAGQ *, char *));
262 static TAGQ *ctag_slist __P((SCR *, char *));
263 static char *linear_search __P((char *, char *, char *));
272 + * ex_rtag_push -- ^]
273 + * :rtag[!] [string]
275 + * Enter a new TAGQ context based on a ctag string.
277 + * PUBLIC: int ex_rtag_push __P((SCR *, EXCMD *));
280 + ex_rtag_push(sp, cmdp)
284 + F_SET(cmdp, E_REFERENCE);
285 + return ex_tag_push(sp, cmdp);
297 /* Get the tag information. */
299 + if (O_ISSET(sp, O_GTAGSMODE)) {
300 + if ((tqp = gtag_slist(sp, exp->tag_last, F_ISSET(cmdp, E_REFERENCE))) == NULL)
304 if ((tqp = ctag_slist(sp, exp->tag_last)) == NULL)
316 + * get tag information from current line.
318 + * gtags temporary file format.
319 + * <tag> <lineno> <file> <image>
322 + * +------------------------------------------------
323 + * |main 30 main.c main(argc, argv)
324 + * |func 21 subr.c func(arg)
327 + getentry(buf, tag, file, line)
328 + char *buf, **tag, **file, **line;
332 + for (*tag = p; *p && !isspace(*p); p++) /* tag name */
337 + for (; *p && isspace(*p); p++) /* (skip blanks) */
341 + *line = p; /* line no */
342 + for (*line = p; *p && !isspace(*p); p++)
347 + for (; *p && isspace(*p); p++) /* (skip blanks) */
351 + *file = p; /* file name */
352 + for (*file = p; *p && !isspace(*p); p++)
359 + if (strlen(*tag) && strlen(*line) && strlen(*file) && atoi(*line) > 0)
362 + return 0; /* ERROR */
367 + * Search the list of tags files for a tag, and return tag queue.
370 + gtag_slist(sp, tag, ref)
381 + char *name, *file, *line;
382 + char command[BUFSIZ];
386 + /* Allocate and initialize the tag queue structure. */
388 + CALLOC_GOTO(sp, tqp, TAGQ *, 1, sizeof(TAGQ) + len + 1);
389 + CIRCLEQ_INIT(&tqp->tagq);
390 + tqp->tag = tqp->buf;
391 + memcpy(tqp->tag, tag, (tqp->tlen = len) + 1);
394 + * Find the tag, only display missing file messages once, and
395 + * then only if we didn't find the tag.
397 + snprintf(command, sizeof(command), "global -%s '%s' 2>/dev/null", ref ? "rx" : "x", tag);
398 + if (fp = popen(command, "r")) {
399 + while (fgets(buf, sizeof(buf), fp)) {
400 + if (buf[strlen(buf)-1] == '\n') /* chop(buf) */
401 + buf[strlen(buf)-1] = 0;
403 + while (fgetc(fp) != '\n')
405 + if (getentry(buf, &name, &file, &line) == 0) {
407 + F_SET(tfp, TAGF_ERR);
410 + CALLOC_GOTO(sp, tp,
411 + TAG *, 1, sizeof(TAG) + strlen(file) + 1 + strlen(line) + 1);
412 + tp->fname = tp->buf;
413 + strcpy(tp->fname, file);
414 + tp->fnlen = strlen(file);
415 + tp->search = tp->fname + tp->fnlen + 1;
416 + strcpy(tp->search, line);
417 + CIRCLEQ_INSERT_TAIL(&tqp->tagq, tp, q);
422 + /* Check to see if we found anything. */
423 + if (tqp->tagq.cqh_first == (void *)&tqp->tagq) {
424 + msgq_str(sp, M_ERR, tag, "162|%s: tag not found");
429 + tqp->current = tqp->tagq.cqh_first;
438 * Search the list of tags files for a tag, and return tag queue.
439 diff -c -r -N /usr/local/src/nvi-1.79/include/ex_def.h ./include/ex_def.h
440 *** /usr/local/src/nvi-1.79/include/ex_def.h Wed Oct 23 22:53:09 1996
441 --- ./include/ex_def.h Fri Aug 14 01:41:14 1998
447 ! #define C_SUBSTITUTE 49
448 ! #define C_SCRIPT 50
451 ! #define C_SOURCE 53
453 ! #define C_SUSPEND 55
456 ! #define C_TAGNEXT 58
457 ! #define C_TAGPOP 59
458 ! #define C_TAGPREV 60
459 ! #define C_TAGTOP 61
460 ! #define C_TCLCMD 62
462 ! #define C_UNABBREVIATE 64
465 ! #define C_VERSION 67
466 ! #define C_VISUAL_EX 68
467 ! #define C_VISUAL_VI 69
468 ! #define C_VIUSAGE 70
475 ! #define C_SUBTILDE 77
481 ! #define C_SUBSTITUTE 50
482 ! #define C_SCRIPT 51
485 ! #define C_SOURCE 54
487 ! #define C_SUSPEND 56
490 ! #define C_TAGNEXT 59
491 ! #define C_TAGPOP 60
492 ! #define C_TAGPREV 61
493 ! #define C_TAGTOP 62
494 ! #define C_TCLCMD 63
496 ! #define C_UNABBREVIATE 65
499 ! #define C_VERSION 68
500 ! #define C_VISUAL_EX 69
501 ! #define C_VISUAL_VI 70
502 ! #define C_VIUSAGE 71
509 ! #define C_SUBTILDE 78
510 diff -c -r -N /usr/local/src/nvi-1.79/include/ex_extern.h ./include/ex_extern.h
511 *** /usr/local/src/nvi-1.79/include/ex_extern.h Wed Oct 23 22:53:10 1996
512 --- ./include/ex_extern.h Fri Aug 14 01:41:14 1998
516 char *, size_t, char **, size_t *, regex_t *, u_int));
517 void re_error __P((SCR *, int, regex_t *));
518 int ex_tag_first __P((SCR *, char *));
519 + int ex_rtag_push __P((SCR *, EXCMD *));
520 int ex_tag_push __P((SCR *, EXCMD *));
521 int ex_tag_next __P((SCR *, EXCMD *));
522 int ex_tag_prev __P((SCR *, EXCMD *));
523 diff -c -r -N /usr/local/src/nvi-1.79/include/options_def.h ./include/options_def.h
524 *** /usr/local/src/nvi-1.79/include/options_def.h Wed Oct 23 22:53:10 1996
525 --- ./include/options_def.h Fri Aug 14 01:41:14 1998
528 #define O_EXTENDED 15
531 ! #define O_HARDTABS 18
532 ! #define O_ICLOWER 19
533 ! #define O_IGNORECASE 20
534 ! #define O_KEYTIME 21
535 ! #define O_LEFTRIGHT 22
539 ! #define O_LOCKFILES 26
541 ! #define O_MATCHTIME 28
543 ! #define O_MODELINE 30
544 ! #define O_MSGCAT 31
545 ! #define O_NOPRINT 32
546 ! #define O_NUMBER 33
549 ! #define O_OPTIMIZE 36
550 ! #define O_PARAGRAPHS 37
553 ! #define O_PROMPT 40
554 ! #define O_READONLY 41
555 ! #define O_RECDIR 42
556 ! #define O_REDRAW 43
558 ! #define O_REPORT 45
560 ! #define O_SCROLL 47
561 ! #define O_SEARCHINCR 48
562 ! #define O_SECTIONS 49
563 ! #define O_SECURE 50
565 ! #define O_SHELLMETA 52
566 ! #define O_SHIFTWIDTH 53
567 ! #define O_SHOWMATCH 54
568 ! #define O_SHOWMODE 55
569 ! #define O_SIDESCROLL 56
570 ! #define O_SLOWOPEN 57
571 ! #define O_SOURCEANY 58
572 ! #define O_TABSTOP 59
573 ! #define O_TAGLENGTH 60
577 ! #define O_TILDEOP 64
578 ! #define O_TIMEOUT 65
579 ! #define O_TTYWERASE 66
580 ! #define O_VERBOSE 67
585 ! #define O_WINDOW 72
586 ! #define O_WINDOWNAME 73
587 ! #define O_WRAPLEN 74
588 ! #define O_WRAPMARGIN 75
589 ! #define O_WRAPSCAN 76
590 ! #define O_WRITEANY 77
591 ! #define O_OPTIONCOUNT 78
593 #define O_EXTENDED 15
596 ! #define O_GTAGSMODE 18
597 ! #define O_HARDTABS 19
598 ! #define O_ICLOWER 20
599 ! #define O_IGNORECASE 21
600 ! #define O_KEYTIME 22
601 ! #define O_LEFTRIGHT 23
605 ! #define O_LOCKFILES 27
607 ! #define O_MATCHTIME 29
609 ! #define O_MODELINE 31
610 ! #define O_MSGCAT 32
611 ! #define O_NOPRINT 33
612 ! #define O_NUMBER 34
615 ! #define O_OPTIMIZE 37
616 ! #define O_PARAGRAPHS 38
619 ! #define O_PROMPT 41
620 ! #define O_READONLY 42
621 ! #define O_RECDIR 43
622 ! #define O_REDRAW 44
624 ! #define O_REPORT 46
626 ! #define O_SCROLL 48
627 ! #define O_SEARCHINCR 49
628 ! #define O_SECTIONS 50
629 ! #define O_SECURE 51
631 ! #define O_SHELLMETA 53
632 ! #define O_SHIFTWIDTH 54
633 ! #define O_SHOWMATCH 55
634 ! #define O_SHOWMODE 56
635 ! #define O_SIDESCROLL 57
636 ! #define O_SLOWOPEN 58
637 ! #define O_SOURCEANY 59
638 ! #define O_TABSTOP 60
639 ! #define O_TAGLENGTH 61
643 ! #define O_TILDEOP 65
644 ! #define O_TIMEOUT 66
645 ! #define O_TTYWERASE 67
646 ! #define O_VERBOSE 68
651 ! #define O_WINDOW 73
652 ! #define O_WINDOWNAME 74
653 ! #define O_WRAPLEN 75
654 ! #define O_WRAPMARGIN 76
655 ! #define O_WRAPSCAN 77
656 ! #define O_WRITEANY 78
657 ! #define O_OPTIONCOUNT 79
658 diff -c -r -N /usr/local/src/nvi-1.79/vi/v_ex.c ./vi/v_ex.c
659 *** /usr/local/src/nvi-1.79/vi/v_ex.c Mon Sep 16 05:03:02 1996
660 --- ./vi/v_ex.c Fri Aug 14 01:41:14 1998
668 + if (O_ISSET(sp, O_GTAGSMODE) && vp->m_start.cno == 0)
669 + ex_cinit(&cmd, C_RTAG, 0, OOBLNO, 0, 0, ap);
672 ex_cinit(&cmd, C_TAG, 0, OOBLNO, 0, 0, ap);
673 ex_cadd(&cmd, &a, VIP(sp)->keyw, strlen(VIP(sp)->keyw));
674 return (v_exec_ex(sp, vp, &cmd));