2 * Copyright (c) 1992, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 1992, 1993, 1994, 1995, 1996
5 * Keith Bostic. All rights reserved.
6 * Copyright (c) 1994, 1996
7 * Rob Mayoff. All rights reserved.
9 * See the LICENSE file for redistribution information.
13 * Cscope connection information. One of these is maintained per cscope
14 * connection, linked from the EX_PRIVATE structure.
17 SLIST_ENTRY(_csc) q; /* Linked list of cscope connections. */
19 char *dname; /* Base directory of this cscope connection. */
20 size_t dlen; /* Length of base directory. */
21 pid_t pid; /* PID of the connected cscope process. */
22 struct timespec mtim; /* Last modification time of cscope database. */
24 FILE *from_fp; /* from cscope: FILE. */
25 int from_fd; /* from cscope: file descriptor. */
26 FILE *to_fp; /* to cscope: FILE. */
27 int to_fd; /* to cscope: file descriptor. */
29 char **paths; /* Array of search paths for this cscope. */
30 char *pbuf; /* Search path buffer. */
31 size_t pblen; /* Search path buffer length. */
33 char buf[1]; /* Variable length buffer. */
37 * Tag file information. One of these is maintained per tag file, linked
38 * from the EXPRIVATE structure.
40 struct _tagf { /* Tag files. */
41 TAILQ_ENTRY(_tagf) q; /* Linked list of tag files. */
42 char *name; /* Tag file name. */
43 int errnum; /* Errno. */
45 #define TAGF_ERR 0x01 /* Error occurred. */
46 #define TAGF_ERR_WARN 0x02 /* Error reported. */
51 * Tags are structured internally as follows:
53 * +----+ +----+ +----+ +----+
54 * | EP | -> | Q1 | <-- | T1 | <-- | T2 |
55 * +----+ +----+ --> +----+ --> +----+
65 * Each Q is a TAGQ, or tag "query", which is the result of one tag or cscope
66 * command. Each Q references one or more TAG's, or tagged file locations.
68 * tag: put a new Q at the head (^])
69 * tagnext: T1 -> T2 inside Q (^N)
70 * tagprev: T2 -> T1 inside Q (^P)
71 * tagpop: discard Q (^T)
72 * tagtop: discard all Q
74 struct _tag { /* Tag list. */
75 TAILQ_ENTRY(_tag) q; /* Linked list of tags. */
77 /* Tag pop/return information. */
78 FREF *frp; /* Saved file. */
79 recno_t lno; /* Saved line number. */
80 size_t cno; /* Saved column number. */
82 char *fname; /* Filename. */
83 size_t fnlen; /* Filename length. */
84 recno_t slno; /* Search line number. */
85 CHAR_T *search; /* Search string. */
86 size_t slen; /* Search string length. */
87 CHAR_T *msg; /* Message string. */
88 size_t mlen; /* Message string length. */
90 CHAR_T buf[1]; /* Variable length buffer. */
93 struct _tagq { /* Tag queue. */
94 TAILQ_ENTRY(_tagq) q; /* Linked list of tag queues. */
95 /* This queue's tag list. */
96 TAILQ_HEAD(_tagqh, _tag) tagq[1];
98 TAG *current; /* Current TAG within the queue. */
100 char *tag; /* Tag string. */
101 size_t tlen; /* Tag string length. */
103 #define TAG_CSCOPE 0x01 /* Cscope tag. */
106 char buf[1]; /* Variable length buffer. */