1 | #ifndef NVIM_EVAL_H |
2 | #define NVIM_EVAL_H |
3 | |
4 | #include "nvim/hashtab.h" // For hashtab_T |
5 | #include "nvim/buffer_defs.h" |
6 | #include "nvim/ex_cmds_defs.h" // For exarg_T |
7 | #include "nvim/eval/typval.h" |
8 | #include "nvim/profile.h" |
9 | #include "nvim/garray.h" |
10 | #include "nvim/event/rstream.h" |
11 | #include "nvim/event/wstream.h" |
12 | #include "nvim/channel.h" |
13 | #include "nvim/os/stdpaths_defs.h" |
14 | |
15 | #define COPYID_INC 2 |
16 | #define COPYID_MASK (~0x1) |
17 | |
18 | // All user-defined functions are found in this hashtable. |
19 | extern hashtab_T func_hashtab; |
20 | |
21 | // From user function to hashitem and back. |
22 | EXTERN ufunc_T dumuf; |
23 | #define UF2HIKEY(fp) ((fp)->uf_name) |
24 | #define HIKEY2UF(p) ((ufunc_T *)(p - offsetof(ufunc_T, uf_name))) |
25 | #define HI2UF(hi) HIKEY2UF((hi)->hi_key) |
26 | |
27 | /// enum used by var_flavour() |
28 | typedef enum { |
29 | VAR_FLAVOUR_DEFAULT = 1, // doesn't start with uppercase |
30 | VAR_FLAVOUR_SESSION = 2, // starts with uppercase, some lower |
31 | VAR_FLAVOUR_SHADA = 4 // all uppercase |
32 | } var_flavour_T; |
33 | |
34 | /// Defines for Vim variables |
35 | typedef enum { |
36 | VV_COUNT, |
37 | VV_COUNT1, |
38 | VV_PREVCOUNT, |
39 | VV_ERRMSG, |
40 | VV_WARNINGMSG, |
41 | VV_STATUSMSG, |
42 | VV_SHELL_ERROR, |
43 | VV_THIS_SESSION, |
44 | VV_VERSION, |
45 | VV_LNUM, |
46 | VV_TERMRESPONSE, |
47 | VV_FNAME, |
48 | VV_LANG, |
49 | VV_LC_TIME, |
50 | VV_CTYPE, |
51 | VV_CC_FROM, |
52 | VV_CC_TO, |
53 | VV_FNAME_IN, |
54 | VV_FNAME_OUT, |
55 | VV_FNAME_NEW, |
56 | VV_FNAME_DIFF, |
57 | VV_CMDARG, |
58 | VV_FOLDSTART, |
59 | VV_FOLDEND, |
60 | VV_FOLDDASHES, |
61 | VV_FOLDLEVEL, |
62 | VV_PROGNAME, |
63 | VV_SEND_SERVER, |
64 | VV_DYING, |
65 | VV_EXCEPTION, |
66 | VV_THROWPOINT, |
67 | VV_STDERR, |
68 | VV_REG, |
69 | VV_CMDBANG, |
70 | VV_INSERTMODE, |
71 | VV_VAL, |
72 | VV_KEY, |
73 | VV_PROFILING, |
74 | VV_FCS_REASON, |
75 | VV_FCS_CHOICE, |
76 | VV_BEVAL_BUFNR, |
77 | VV_BEVAL_WINNR, |
78 | VV_BEVAL_WINID, |
79 | VV_BEVAL_LNUM, |
80 | VV_BEVAL_COL, |
81 | VV_BEVAL_TEXT, |
82 | VV_SCROLLSTART, |
83 | VV_SWAPNAME, |
84 | VV_SWAPCHOICE, |
85 | VV_SWAPCOMMAND, |
86 | VV_CHAR, |
87 | VV_MOUSE_WIN, |
88 | VV_MOUSE_WINID, |
89 | VV_MOUSE_LNUM, |
90 | VV_MOUSE_COL, |
91 | VV_OP, |
92 | VV_SEARCHFORWARD, |
93 | VV_HLSEARCH, |
94 | VV_OLDFILES, |
95 | VV_WINDOWID, |
96 | VV_PROGPATH, |
97 | VV_COMPLETED_ITEM, |
98 | VV_OPTION_NEW, |
99 | VV_OPTION_OLD, |
100 | VV_OPTION_TYPE, |
101 | VV_ERRORS, |
102 | VV_MSGPACK_TYPES, |
103 | VV_EVENT, |
104 | VV_FALSE, |
105 | VV_TRUE, |
106 | VV_NULL, |
107 | VV__NULL_LIST, // List with NULL value. For test purposes only. |
108 | VV__NULL_DICT, // Dictionary with NULL value. For test purposes only. |
109 | VV_VIM_DID_ENTER, |
110 | VV_TESTING, |
111 | VV_TYPE_NUMBER, |
112 | VV_TYPE_STRING, |
113 | VV_TYPE_FUNC, |
114 | VV_TYPE_LIST, |
115 | VV_TYPE_DICT, |
116 | VV_TYPE_FLOAT, |
117 | VV_TYPE_BOOL, |
118 | VV_ECHOSPACE, |
119 | VV_EXITING, |
120 | } VimVarIndex; |
121 | |
122 | /// All recognized msgpack types |
123 | typedef enum { |
124 | kMPNil, |
125 | kMPBoolean, |
126 | kMPInteger, |
127 | kMPFloat, |
128 | kMPString, |
129 | kMPBinary, |
130 | kMPArray, |
131 | kMPMap, |
132 | kMPExt, |
133 | #define LAST_MSGPACK_TYPE kMPExt |
134 | } MessagePackType; |
135 | |
136 | /// Array mapping values from MessagePackType to corresponding list pointers |
137 | extern const list_T *eval_msgpack_type_lists[LAST_MSGPACK_TYPE + 1]; |
138 | |
139 | #undef LAST_MSGPACK_TYPE |
140 | |
141 | typedef int (*ArgvFunc)(int current_argcount, typval_T *argv, |
142 | int called_func_argcount); |
143 | |
144 | #ifdef INCLUDE_GENERATED_DECLARATIONS |
145 | # include "eval.h.generated.h" |
146 | #endif |
147 | #endif // NVIM_EVAL_H |
148 | |