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 <kahn@zk3.dec.com>
6 * Ported to Win32 by Sergey Khorev <sergey.khorev@gmail.com>
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
31typedef 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
39typedef 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
52 FileID file_id;
53
54 FILE * fr_fp; /* from cscope: FILE. */
55 FILE * to_fp; /* to cscope: FILE. */
56} csinfo_T;
57
58typedef enum { Add, Find, Help, Kill, Reset, Show } csid_e;
59
60typedef enum {
61 Store,
62 Get,
63 Free,
64 Print
65} mcmd_e;
66
67#endif // NVIM_IF_CSCOPE_DEFS_H
68