aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/userfunc.h
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2020-04-27 01:45:30 -0400
committerGitHub <noreply@github.com>2020-04-27 01:45:30 -0400
commitfc98f2d5815d8f7e671766db255edbb7365960b1 (patch)
tree6180a999aa9d1806d14e23f51be82e0347dc5d12 /src/nvim/eval/userfunc.h
parent34ad1ea36637845adb14c579587168126d3210e3 (diff)
parent6b050a145dcd2836512cdb8e5239cd2b656267b9 (diff)
downloadrneovim-fc98f2d5815d8f7e671766db255edbb7365960b1.tar.gz
rneovim-fc98f2d5815d8f7e671766db255edbb7365960b1.tar.bz2
rneovim-fc98f2d5815d8f7e671766db255edbb7365960b1.zip
Merge #11851 'eval.c: factor out eval/userfunc.c'
vim-patch:7.4.2058
Diffstat (limited to 'src/nvim/eval/userfunc.h')
-rw-r--r--src/nvim/eval/userfunc.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/nvim/eval/userfunc.h b/src/nvim/eval/userfunc.h
new file mode 100644
index 0000000000..ad8e071548
--- /dev/null
+++ b/src/nvim/eval/userfunc.h
@@ -0,0 +1,36 @@
+#ifndef NVIM_EVAL_USERFUNC_H
+#define NVIM_EVAL_USERFUNC_H
+
+#include "nvim/eval/typval.h"
+#include "nvim/ex_cmds_defs.h"
+
+///< Structure used by trans_function_name()
+typedef struct {
+ dict_T *fd_dict; ///< Dictionary used.
+ char_u *fd_newkey; ///< New key in "dict" in allocated memory.
+ dictitem_T *fd_di; ///< Dictionary item used.
+} funcdict_T;
+
+/// errors for when calling a function
+typedef enum {
+ ERROR_UNKNOWN = 0,
+ ERROR_TOOMANY,
+ ERROR_TOOFEW,
+ ERROR_SCRIPT,
+ ERROR_DICT,
+ ERROR_NONE,
+ ERROR_OTHER,
+ ERROR_BOTH,
+ ERROR_DELETED,
+} FnameTransError;
+
+typedef int (*ArgvFunc)(int current_argcount, typval_T *argv, int argskip,
+ int called_func_argcount);
+
+#define FUNCARG(fp, j) ((char_u **)(fp->uf_args.ga_data))[j]
+#define FUNCLINE(fp, j) ((char_u **)(fp->uf_lines.ga_data))[j]
+
+#ifdef INCLUDE_GENERATED_DECLARATIONS
+# include "eval/userfunc.h.generated.h"
+#endif
+#endif // NVIM_EVAL_USERFUNC_H