neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

funcs.h (1102B)


      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
     12 typedef void (*VimLFunc)(typval_T *args, typval_T *rvar, EvalFuncData data);
     13 
     14 /// Special flags for base_arg @see EvalFuncDef
     15 enum {
     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
     21 typedef 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"