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