annotate src/if_cscope.h @ 924:ba9375e24d49 v7.0.050

updated for version 7.0-050
author vimboss
date Tue, 08 Aug 2006 19:34:19 +0000
parents 6b49757d378c
children d0cf8c843186
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 #define FIND_USAGE "find c|d|e|f|g|i|s|t name"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 #define FIND_HELP "\n\
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 c: Find functions calling this function\n\
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 d: Find functions called by this function\n\
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 e: Find this egrep pattern\n\
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 f: Find this file\n\
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 g: Find this definition\n\
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 i: Find files #including this file\n\
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 s: Find this C symbol\n\
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 t: Find assignments to\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 typedef struct {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 char * name;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 int (*func) __ARGS((exarg_T *eap));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 char * help;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 char * usage;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 int cansplit; /* if supports splitting window */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 } cscmd_T;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 typedef struct csi {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 char * fname; /* cscope db name */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 char * ppath; /* path to prepend (the -P option) */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 char * flags; /* additional cscope flags/options (e.g, -p2) */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 #if defined(UNIX)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 pid_t pid; /* PID of the connected cscope process. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 dev_t st_dev; /* ID of dev containing cscope db */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 ino_t st_ino; /* inode number of cscope db */
132
d6009de12681 updated for version 7.0044
vimboss
parents: 7
diff changeset
73 #else
d6009de12681 updated for version 7.0044
vimboss
parents: 7
diff changeset
74 # if defined(WIN32)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 int pid; /* Can't get pid so set it to 0 ;) */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 HANDLE hProc; /* cscope process handle */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 DWORD nVolume; /* Volume serial number, instead of st_dev */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 DWORD nIndexHigh; /* st_ino has no meaning in the Windows */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 DWORD nIndexLow;
132
d6009de12681 updated for version 7.0044
vimboss
parents: 7
diff changeset
80 # endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 FILE * fr_fp; /* from cscope: FILE. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 FILE * to_fp; /* to cscope: FILE. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 } csinfo_T;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 typedef enum { Add, Find, Help, Kill, Reset, Show } csid_e;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 typedef enum {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 Store,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 Get,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 Free,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 Print
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 } mcmd_e;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 #endif /* FEAT_CSCOPE */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 /* the end */