4 * Copyright (c) 1992, 1993, 1994
5 * The Regents of the University of California. All rights reserved.
6 * Copyright (c) 1992, 1993, 1994, 1995, 1996
7 * Keith Bostic. All rights reserved.
8 * Copyright (c) 1994, 1996
9 * Rob Mayoff. All rights reserved.
11 * See the LICENSE file for redistribution information.
13 * Id: tag.h,v 10.8 2000/07/14 14:29:22 skimo Exp (Berkeley) Date: 2000/07/14 14:29:22
17 * Cscope connection information. One of these is maintained per cscope
18 * connection, linked from the EX_PRIVATE structure.
21 LIST_ENTRY(_csc
) q
; /* Linked list of cscope connections. */
23 char *dname
; /* Base directory of this cscope connection. */
24 size_t dlen
; /* Length of base directory. */
25 pid_t pid
; /* PID of the connected cscope process. */
26 time_t mtime
; /* Last modification time of cscope database. */
28 FILE *from_fp
; /* from cscope: FILE. */
29 int from_fd
; /* from cscope: file descriptor. */
30 FILE *to_fp
; /* to cscope: FILE. */
31 int to_fd
; /* to cscope: file descriptor. */
33 char **paths
; /* Array of search paths for this cscope. */
34 char *pbuf
; /* Search path buffer. */
35 size_t pblen
; /* Search path buffer length. */
37 char buf
[1]; /* Variable length buffer. */
41 * Tag file information. One of these is maintained per tag file, linked
42 * from the EXPRIVATE structure.
44 struct _tagf
{ /* Tag files. */
45 TAILQ_ENTRY(_tagf
) q
; /* Linked list of tag files. */
46 char *name
; /* Tag file name. */
47 int errnum
; /* Errno. */
49 #define TAGF_ERR 0x01 /* Error occurred. */
50 #define TAGF_ERR_WARN 0x02 /* Error reported. */
55 * Tags are structured internally as follows:
57 * +----+ +----+ +----+ +----+
58 * | EP | -> | Q1 | <-- | T1 | <-- | T2 |
59 * +----+ +----+ --> +----+ --> +----+
69 * Each Q is a TAGQ, or tag "query", which is the result of one tag or cscope
70 * command. Each Q references one or more TAG's, or tagged file locations.
72 * tag: put a new Q at the head (^])
73 * tagnext: T1 -> T2 inside Q (^N)
74 * tagprev: T2 -> T1 inside Q (^P)
75 * tagpop: discard Q (^T)
76 * tagtop: discard all Q
78 struct _tag
{ /* Tag list. */
79 CIRCLEQ_ENTRY(_tag
) q
; /* Linked list of tags. */
81 /* Tag pop/return information. */
82 FREF
*frp
; /* Saved file. */
83 db_recno_t lno
; /* Saved line number. */
84 size_t cno
; /* Saved column number. */
86 char *fname
; /* Filename. */
87 size_t fnlen
; /* Filename length. */
88 db_recno_t slno
; /* Search line number. */
89 CHAR_T
*search
; /* Search string. */
90 size_t slen
; /* Search string length. */
91 CHAR_T
*msg
; /* Message string. */
92 size_t mlen
; /* Message string length. */
94 CHAR_T buf
[1]; /* Variable length buffer. */
97 struct _tagq
{ /* Tag queue. */
98 CIRCLEQ_ENTRY(_tagq
) q
; /* Linked list of tag queues. */
99 /* This queue's tag list. */
100 CIRCLEQ_HEAD(_tagqh
, _tag
) tagq
;
102 TAG
*current
; /* Current TAG within the queue. */
104 char *tag
; /* Tag string. */
105 size_t tlen
; /* Tag string length. */
107 #define TAG_CSCOPE 0x01 /* Cscope tag. */
110 char buf
[1]; /* Variable length buffer. */