if_cscope_defs.h
Go to the documentation of this file.
1 #ifndef NVIM_IF_CSCOPE_DEFS_H
2 #define NVIM_IF_CSCOPE_DEFS_H
3 
4 // CSCOPE support for Vim added by Andy Kahn <[email protected]>
5 // Ported to Win32 by Sergey Khorev <[email protected]>
6 //
7 // The basic idea/structure of cscope for Vim was borrowed from Nvi.
8 // There might be a few lines of code that look similar to what Nvi
9 // has. If this is a problem and requires inclusion of the annoying
10 // BSD license, then sue me; I'm not worth much anyway.
11 
12 #if defined(UNIX)
13 # include <sys/types.h> // pid_t
14 #endif
15 
16 #include "nvim/ex_cmds_defs.h"
17 #include "nvim/os/fs_defs.h"
18 #include "nvim/os/os_defs.h"
19 
20 #define CSCOPE_SUCCESS 0
21 #define CSCOPE_FAILURE -1
22 
23 #define CSCOPE_DBFILE "cscope.out"
24 #define CSCOPE_PROMPT ">> "
25 
26 // See ":help cscope-find" for the possible queries.
27 
28 typedef struct {
29  char *name;
30  int (*func)(exarg_T *eap);
31  char *help;
32  char *usage;
33  int cansplit; // if supports splitting window
34 } cscmd_T;
35 
36 typedef struct csi {
37  char *fname; // cscope db name
38  char *ppath; // path to prepend (the -P option)
39  char *flags; // additional cscope flags/options (e.g, -p2)
40 #if defined(UNIX)
41  pid_t pid; // PID of the connected cscope process
42 #else
43  DWORD pid; // PID of the connected cscope process
44  HANDLE hProc; // cscope process handle
45  DWORD nVolume; // Volume serial number, instead of st_dev
46  DWORD nIndexHigh; // st_ino has no meaning on Windows
48 #endif
50 
51  FILE *fr_fp; // from cscope: FILE.
52  FILE *to_fp; // to cscope: FILE.
53 } csinfo_T;
54 
55 typedef enum { Add, Find, Help, Kill, Reset, Show, } csid_e;
56 
57 typedef enum {
59  Get,
62 } mcmd_e;
63 
64 #endif // NVIM_IF_CSCOPE_DEFS_H
cscmd_T
Definition: if_cscope_defs.h:28
DWORD
DWORD
Definition: pty_conpty_win.c:17
csi::nIndexLow
DWORD nIndexLow
Definition: if_cscope_defs.h:47
FileID
Struct which encapsulates inode/dev_id information.
Definition: fs_defs.h:12
csid_e
csid_e
Definition: if_cscope_defs.h:55
Show
@ Show
Definition: if_cscope_defs.h:55
exarg
Arguments used for Ex commands.
Definition: ex_cmds_defs.h:145
csi::file_id
FileID file_id
Definition: if_cscope_defs.h:49
Print
@ Print
Definition: if_cscope_defs.h:61
csi::pid
DWORD pid
Definition: if_cscope_defs.h:43
csi::flags
char * flags
Definition: if_cscope_defs.h:39
csi::nIndexHigh
DWORD nIndexHigh
Definition: if_cscope_defs.h:46
cscmd_T::usage
char * usage
Definition: if_cscope_defs.h:32
Reset
@ Reset
Definition: if_cscope_defs.h:55
csi::fname
char * fname
Definition: if_cscope_defs.h:37
csi
Definition: if_cscope_defs.h:36
Kill
@ Kill
Definition: if_cscope_defs.h:55
Get
@ Get
Definition: if_cscope_defs.h:59
cscmd_T::name
char * name
Definition: if_cscope_defs.h:29
Free
@ Free
Definition: if_cscope_defs.h:60
csi::fr_fp
FILE * fr_fp
Definition: if_cscope_defs.h:51
csi::to_fp
FILE * to_fp
Definition: if_cscope_defs.h:52
func
fc func
Definition: userfunc.c:851
csi::ppath
char * ppath
Definition: if_cscope_defs.h:38
csi::hProc
HANDLE hProc
Definition: if_cscope_defs.h:44
os_defs.h
Add
@ Add
Definition: if_cscope_defs.h:55
HANDLE
HANDLE
Definition: pty_conpty_win.c:17
csi::nVolume
DWORD nVolume
Definition: if_cscope_defs.h:45
ex_cmds_defs.h
mcmd_e
mcmd_e
Definition: if_cscope_defs.h:57
csinfo_T
struct csi csinfo_T
cscmd_T::help
char * help
Definition: if_cscope_defs.h:31
cscmd_T::cansplit
int cansplit
Definition: if_cscope_defs.h:33
Store
@ Store
Definition: if_cscope_defs.h:58
Help
@ Help
Definition: if_cscope_defs.h:55
fs_defs.h
Find
@ Find
Definition: if_cscope_defs.h:55