annotate src/if_cscope.h @ 1767:59edc8429da0 v7.2.065

updated for version 7.2-065
author vimboss
date Wed, 03 Dec 2008 17:50:45 +0000
parents 9f8fd6a14cfc
children 3f661e42f262
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 /* vi:set ts=8 sts=4 sw=4:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 * CSCOPE support for Vim added by Andy Kahn <kahn@zk3.dec.com>
148
72aefd4c1e0d updated for version 7.0046
vimboss
parents: 132
diff changeset
4 * Ported to Win32 by Sergey Khorev <sergey.khorev@gmail.com>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 * The basic idea/structure of cscope for Vim was borrowed from Nvi.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 * There might be a few lines of code that look similar to what Nvi
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 * has. If this is a problem and requires inclusion of the annoying
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 * BSD license, then sue me; I'm not worth much anyway.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 #if defined(FEAT_CSCOPE) || defined(PROTO)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 #if defined(UNIX)
132
d6009de12681 updated for version 7.0044
vimboss
parents: 7
diff changeset
15 # include <sys/types.h> /* pid_t */
d6009de12681 updated for version 7.0044
vimboss
parents: 7
diff changeset
16 # include <sys/stat.h> /* dev_t, ino_t */
d6009de12681 updated for version 7.0044
vimboss
parents: 7
diff changeset
17 #else
d6009de12681 updated for version 7.0044
vimboss
parents: 7
diff changeset
18 # if defined (WIN32)
d6009de12681 updated for version 7.0044
vimboss
parents: 7
diff changeset
19 # ifndef WIN32_LEAN_AND_MEAN
d6009de12681 updated for version 7.0044
vimboss
parents: 7
diff changeset
20 # define WIN32_LEAN_AND_MEAN
d6009de12681 updated for version 7.0044
vimboss
parents: 7
diff changeset
21 # endif
d6009de12681 updated for version 7.0044
vimboss
parents: 7
diff changeset
22 # include <windows.h>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 #define CSCOPE_SUCCESS 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 #define CSCOPE_FAILURE -1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 #define CSCOPE_MAX_CONNECTIONS 8 /* you actually need more? */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 #define CSCOPE_DBFILE "cscope.out"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 #define CSCOPE_PROMPT ">> "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 * s 0name Find this C symbol
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 * g 1name Find this definition
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 * d 2name Find functions called by this function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 * c 3name Find functions calling this function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 * t 4string find text string (cscope 12.9)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 * t 4name Find assignments to (cscope 13.3)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 * 5pattern change pattern -- NOT USED
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 * e 6pattern Find this egrep pattern
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 * f 7name Find this file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 * i 8name Find files #including this file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 typedef struct {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 char * name;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 int (*func) __ARGS((exarg_T *eap));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 char * help;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 char * usage;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 int cansplit; /* if supports splitting window */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 } cscmd_T;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 typedef struct csi {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 char * fname; /* cscope db name */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 char * ppath; /* path to prepend (the -P option) */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 char * flags; /* additional cscope flags/options (e.g, -p2) */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 #if defined(UNIX)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 pid_t pid; /* PID of the connected cscope process. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 dev_t st_dev; /* ID of dev containing cscope db */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 ino_t st_ino; /* inode number of cscope db */
132
d6009de12681 updated for version 7.0044
vimboss
parents: 7
diff changeset
62 #else
d6009de12681 updated for version 7.0044
vimboss
parents: 7
diff changeset
63 # if defined(WIN32)
1385
d0cf8c843186 updated for version 7.1-100
vimboss
parents: 378
diff changeset
64 DWORD pid; /* PID of the connected cscope process. */
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 HANDLE hProc; /* cscope process handle */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 DWORD nVolume; /* Volume serial number, instead of st_dev */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 DWORD nIndexHigh; /* st_ino has no meaning in the Windows */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 DWORD nIndexLow;
132
d6009de12681 updated for version 7.0044
vimboss
parents: 7
diff changeset
69 # endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 FILE * fr_fp; /* from cscope: FILE. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 FILE * to_fp; /* to cscope: FILE. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 } csinfo_T;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 typedef enum { Add, Find, Help, Kill, Reset, Show } csid_e;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 typedef enum {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 Store,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 Get,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 Free,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 Print
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 } mcmd_e;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 #endif /* FEAT_CSCOPE */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 /* the end */