blob: a572f7385e3f92f4b82d0c717dbcb92af5f40ccc [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001/* vi:set ts=8 sts=4 sw=4:
2 *
3 * CSCOPE support for Vim added by Andy Kahn <kahn@zk3.dec.com>
Bram Moolenaar2ce06f62005-01-31 19:19:04 +00004 * Ported to Win32 by Sergey Khorev <sergey.khorev@gmail.com>
Bram Moolenaar071d4272004-06-13 20:20:40 +00005 *
6 * The basic idea/structure of cscope for Vim was borrowed from Nvi.
7 * There might be a few lines of code that look similar to what Nvi
8 * has. If this is a problem and requires inclusion of the annoying
9 * BSD license, then sue me; I'm not worth much anyway.
10 */
11
12#if defined(FEAT_CSCOPE) || defined(PROTO)
13
Bram Moolenaar9e24f0c2016-02-27 17:22:27 +010014#if defined (WIN32)
15# ifndef WIN32_LEAN_AND_MEAN
16# define WIN32_LEAN_AND_MEAN
Bram Moolenaar071d4272004-06-13 20:20:40 +000017# endif
Bram Moolenaar9e24f0c2016-02-27 17:22:27 +010018# include <windows.h>
Bram Moolenaar071d4272004-06-13 20:20:40 +000019#endif
20
21#define CSCOPE_SUCCESS 0
22#define CSCOPE_FAILURE -1
Bram Moolenaar071d4272004-06-13 20:20:40 +000023
24#define CSCOPE_DBFILE "cscope.out"
25#define CSCOPE_PROMPT ">> "
Bram Moolenaar071d4272004-06-13 20:20:40 +000026
27/*
28 * s 0name Find this C symbol
29 * g 1name Find this definition
30 * d 2name Find functions called by this function
31 * c 3name Find functions calling this function
32 * t 4string find text string (cscope 12.9)
33 * t 4name Find assignments to (cscope 13.3)
34 * 5pattern change pattern -- NOT USED
35 * e 6pattern Find this egrep pattern
36 * f 7name Find this file
37 * i 8name Find files #including this file
38 */
Bram Moolenaar071d4272004-06-13 20:20:40 +000039
40typedef struct {
41 char * name;
Bram Moolenaard99df422016-01-29 23:20:40 +010042 int (*func)(exarg_T *eap);
Bram Moolenaar071d4272004-06-13 20:20:40 +000043 char * help;
44 char * usage;
45 int cansplit; /* if supports splitting window */
46} cscmd_T;
47
48typedef struct csi {
49 char * fname; /* cscope db name */
50 char * ppath; /* path to prepend (the -P option) */
51 char * flags; /* additional cscope flags/options (e.g, -p2) */
52#if defined(UNIX)
53 pid_t pid; /* PID of the connected cscope process. */
54 dev_t st_dev; /* ID of dev containing cscope db */
55 ino_t st_ino; /* inode number of cscope db */
Bram Moolenaardf3267e2005-01-25 22:07:05 +000056#else
57# if defined(WIN32)
Bram Moolenaar02b06312007-09-06 15:39:22 +000058 DWORD pid; /* PID of the connected cscope process. */
Bram Moolenaar071d4272004-06-13 20:20:40 +000059 HANDLE hProc; /* cscope process handle */
60 DWORD nVolume; /* Volume serial number, instead of st_dev */
61 DWORD nIndexHigh; /* st_ino has no meaning in the Windows */
62 DWORD nIndexLow;
Bram Moolenaardf3267e2005-01-25 22:07:05 +000063# endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000064#endif
65
66 FILE * fr_fp; /* from cscope: FILE. */
67 FILE * to_fp; /* to cscope: FILE. */
68} csinfo_T;
69
70typedef enum { Add, Find, Help, Kill, Reset, Show } csid_e;
71
72typedef enum {
73 Store,
74 Get,
75 Free,
76 Print
77} mcmd_e;
78
79
80#endif /* FEAT_CSCOPE */
81
82/* the end */