userfunc.h
Go to the documentation of this file.
1 #ifndef NVIM_EVAL_USERFUNC_H
2 #define NVIM_EVAL_USERFUNC_H
3 
4 #include "nvim/eval/typval.h"
5 #include "nvim/ex_cmds_defs.h"
6 
8 typedef struct {
12 } funcdict_T;
13 
15 struct funccal_entry {
16  void *top_funccal;
18 };
19 
21 typedef enum {
33 
35 typedef int (*ArgvFunc)(int current_argcount, typval_T *argv, int argskip,
36  int called_func_argcount);
37 
39 typedef struct {
44  bool *doesrange;
45  bool evaluate;
49 } funcexe_T;
50 
51 #define FUNCEXE_INIT (funcexe_T) { \
52  .argv_func = NULL, \
53  .firstline = 0, \
54  .lastline = 0, \
55  .doesrange = NULL, \
56  .evaluate = false, \
57  .partial = NULL, \
58  .selfdict = NULL, \
59  .basetv = NULL, \
60 }
61 
62 #define FUNCARG(fp, j) ((char_u **)(fp->uf_args.ga_data))[j]
63 #define FUNCLINE(fp, j) ((char_u **)(fp->uf_lines.ga_data))[j]
64 
65 #ifdef INCLUDE_GENERATED_DECLARATIONS
66 # include "eval/userfunc.h.generated.h"
67 #endif
68 #endif // NVIM_EVAL_USERFUNC_H
ERROR_DELETED
@ ERROR_DELETED
Definition: userfunc.h:30
typval_T
Structure that holds an internal variable value.
Definition: typval.h:131
funcdict_T::fd_di
dictitem_T * fd_di
Dictionary item used.
Definition: userfunc.h:11
ERROR_NONE
@ ERROR_NONE
Definition: userfunc.h:27
funcdict_T
< Structure used by trans_function_name()
Definition: userfunc.h:8
funccal_entry
Definition: userfunc.h:15
argv
static int typval_T argv[3]
Definition: eval.c:6533
ERROR_BOTH
@ ERROR_BOTH
Definition: userfunc.h:29
funcexe_T::evaluate
bool evaluate
actually evaluate expressions
Definition: userfunc.h:45
ERROR_NOTMETHOD
@ ERROR_NOTMETHOD
Definition: userfunc.h:31
funccal_entry::top_funccal
void * top_funccal
Definition: userfunc.h:16
funcexe_T::basetv
typval_T * basetv
base for base->method()
Definition: userfunc.h:48
funcexe_T
Structure passed between functions dealing with function call execution.
Definition: userfunc.h:39
ERROR_TOOFEW
@ ERROR_TOOFEW
Definition: userfunc.h:24
ERROR_OTHER
@ ERROR_OTHER
Definition: userfunc.h:28
partial_S
Definition: typval.h:360
firstline
funcexe firstline
Definition: eval.c:3299
typval.h
ArgvFunc
int(* ArgvFunc)(int current_argcount, typval_T *argv, int argskip, int called_func_argcount)
Used in funcexe_T. Returns the new argcount.
Definition: userfunc.h:35
funccal_entry::next
funccal_entry_T * next
Definition: userfunc.h:17
funcdict_T::fd_dict
dict_T * fd_dict
Dictionary used.
Definition: userfunc.h:9
dictitem_T
Definition: coverity-model.c:39
FnameTransError
FnameTransError
errors for when calling a function
Definition: userfunc.h:21
ERROR_SCRIPT
@ ERROR_SCRIPT
Definition: userfunc.h:25
char_u
unsigned char char_u
Definition: types.h:12
ERROR_DICT
@ ERROR_DICT
Definition: userfunc.h:26
funcexe_T::selfdict
dict_T * selfdict
Dictionary for "self".
Definition: userfunc.h:47
ex_cmds_defs.h
funcexe_T::argv_func
ArgvFunc argv_func
Definition: userfunc.h:40
dict_T
Definition: coverity-model.c:40
funcexe_T::doesrange
bool * doesrange
[out] if not NULL: function handled range
Definition: userfunc.h:44
funcdict_T::fd_newkey
char_u * fd_newkey
New key in "dict" in allocated memory.
Definition: userfunc.h:10
funcexe_T::lastline
linenr_T lastline
last line of range
Definition: userfunc.h:43
ERROR_TOOMANY
@ ERROR_TOOMANY
Definition: userfunc.h:23
funcexe_T::partial
partial_T * partial
for extra arguments
Definition: userfunc.h:46
ERROR_UNKNOWN
@ ERROR_UNKNOWN
Definition: userfunc.h:22
linenr_T
long linenr_T
Definition: pos.h:7