robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

bfredlMerge pull request #35206 from bfredl/nopreproc_cleanup38986188ba

master
1.1 KiB31 linesraw
1#pragma once
2
3#include <stdbool.h>
4#include <stdint.h>
5
6#include "nvim/cmdexpand_defs.h"  // IWYU pragma: keep
7#include "nvim/eval/typval_defs.h"
8#include "nvim/pos_defs.h"  // IWYU pragma: keep
9#include "nvim/types_defs.h"
10
11/// Prototype of C function that implements Vimscript function
12typedef void (*VimLFunc)(typval_T *args, typval_T *rvar, EvalFuncData data);
13
14/// Special flags for base_arg @see EvalFuncDef
15enum {
16  BASE_NONE = 0,          ///< Not a method (no base argument).
17  BASE_LAST = UINT8_MAX,  ///< Use the last argument as the method base.
18};
19
20/// Structure holding Vimscript function definition
21typedef struct {
22  char *name;         ///< Name of the function.
23  uint8_t min_argc;   ///< Minimal number of arguments.
24  uint8_t max_argc;   ///< Maximal number of arguments.
25  uint8_t base_arg;   ///< Method base arg # (1-indexed), BASE_NONE or BASE_LAST.
26  bool fast;          ///< Can be run in |api-fast| events
27  VimLFunc func;      ///< Function implementation.
28  EvalFuncData data;  ///< Userdata for function implementation.
29} EvalFuncDef;
30
31#include "eval/funcs.h.generated.h"