From 5e815edece308a91296720cd6cb8d988af6c90c8 Mon Sep 17 00:00:00 2001 From: Jakub Łuczyński Date: Tue, 11 Feb 2020 16:19:14 +0100 Subject: rename: user_funcs -> userfunc Lets stick with vim for now --- src/nvim/eval/userfunc.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/nvim/eval/userfunc.h (limited to 'src/nvim/eval/userfunc.h') diff --git a/src/nvim/eval/userfunc.h b/src/nvim/eval/userfunc.h new file mode 100644 index 0000000000..db4e02ee98 --- /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 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 -- cgit