refactor: move FunPtr to types.h (#19466)

This type itself is not eval-specific. Moving it to types.h can avoid
including eval/funcs.h in many headers, and types.h is already included
by many headers.
This commit is contained in:
zeertzjq
2022-07-22 22:05:02 +08:00
committed by GitHub
parent ac690f457e
commit a7b9920930
18 changed files with 8 additions and 12 deletions

View File

@@ -1,7 +1,6 @@
#ifndef NVIM_DIGRAPH_H #ifndef NVIM_DIGRAPH_H
#define NVIM_DIGRAPH_H #define NVIM_DIGRAPH_H
#include "nvim/eval/funcs.h"
#include "nvim/ex_cmds_defs.h" #include "nvim/ex_cmds_defs.h"
#include "nvim/types.h" #include "nvim/types.h"

View File

@@ -3,7 +3,6 @@
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/channel.h" #include "nvim/channel.h"
#include "nvim/eval/funcs.h" // For FunPtr
#include "nvim/event/time.h" // For TimeWatcher #include "nvim/event/time.h" // For TimeWatcher
#include "nvim/ex_cmds_defs.h" // For exarg_T #include "nvim/ex_cmds_defs.h" // For exarg_T
#include "nvim/os/fileio.h" // For FileDescriptor #include "nvim/os/fileio.h" // For FileDescriptor

View File

@@ -4,8 +4,6 @@
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/eval/typval.h" #include "nvim/eval/typval.h"
typedef void (*FunPtr)(void);
/// Prototype of C function that implements VimL function /// Prototype of C function that implements VimL function
typedef void (*VimLFunc)(typval_T *args, typval_T *rvar, FunPtr data); typedef void (*VimLFunc)(typval_T *args, typval_T *rvar, FunPtr data);

View File

@@ -9,6 +9,7 @@
#include "nvim/edit.h" #include "nvim/edit.h"
#include "nvim/eval.h" #include "nvim/eval.h"
#include "nvim/eval/encode.h" #include "nvim/eval/encode.h"
#include "nvim/eval/funcs.h"
#include "nvim/eval/userfunc.h" #include "nvim/eval/userfunc.h"
#include "nvim/eval/vars.h" #include "nvim/eval/vars.h"
#include "nvim/ex_cmds2.h" #include "nvim/ex_cmds2.h"

View File

@@ -1,7 +1,6 @@
#ifndef NVIM_EVAL_VARS_H #ifndef NVIM_EVAL_VARS_H
#define NVIM_EVAL_VARS_H #define NVIM_EVAL_VARS_H
#include "nvim/eval/funcs.h" // For FunPtr
#include "nvim/ex_cmds_defs.h" // For exarg_T #include "nvim/ex_cmds_defs.h" // For exarg_T
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS

View File

@@ -1,7 +1,6 @@
#ifndef NVIM_EX_DOCMD_H #ifndef NVIM_EX_DOCMD_H
#define NVIM_EX_DOCMD_H #define NVIM_EX_DOCMD_H
#include "nvim/eval/funcs.h"
#include "nvim/ex_cmds_defs.h" #include "nvim/ex_cmds_defs.h"
#include "nvim/globals.h" #include "nvim/globals.h"

View File

@@ -24,6 +24,7 @@
#include "nvim/digraph.h" #include "nvim/digraph.h"
#include "nvim/edit.h" #include "nvim/edit.h"
#include "nvim/eval.h" #include "nvim/eval.h"
#include "nvim/eval/funcs.h"
#include "nvim/eval/userfunc.h" #include "nvim/eval/userfunc.h"
#include "nvim/event/loop.h" #include "nvim/event/loop.h"
#include "nvim/ex_cmds.h" #include "nvim/ex_cmds.h"

View File

@@ -1,7 +1,6 @@
#ifndef NVIM_INSEXPAND_H #ifndef NVIM_INSEXPAND_H
#define NVIM_INSEXPAND_H #define NVIM_INSEXPAND_H
#include "nvim/eval/funcs.h"
#include "nvim/vim.h" #include "nvim/vim.h"
/// state for pum_ext_select_item. /// state for pum_ext_select_item.

View File

@@ -15,6 +15,7 @@
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/change.h" #include "nvim/change.h"
#include "nvim/cursor.h" #include "nvim/cursor.h"
#include "nvim/eval/funcs.h"
#include "nvim/eval/typval.h" #include "nvim/eval/typval.h"
#include "nvim/eval/userfunc.h" #include "nvim/eval/userfunc.h"
#include "nvim/event/loop.h" #include "nvim/event/loop.h"

View File

@@ -2,7 +2,6 @@
#define NVIM_MAPPING_H #define NVIM_MAPPING_H
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/eval/funcs.h"
#include "nvim/ex_cmds_defs.h" #include "nvim/ex_cmds_defs.h"
#include "nvim/types.h" #include "nvim/types.h"
#include "nvim/vim.h" #include "nvim/vim.h"

View File

@@ -7,6 +7,7 @@
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/charset.h" #include "nvim/charset.h"
#include "nvim/eval/funcs.h"
#include "nvim/fold.h" #include "nvim/fold.h"
#include "nvim/highlight_group.h" #include "nvim/highlight_group.h"
#include "nvim/match.h" #include "nvim/match.h"

View File

@@ -2,7 +2,6 @@
#define NVIM_MATCH_H #define NVIM_MATCH_H
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/eval/funcs.h"
#include "nvim/ex_cmds_defs.h" #include "nvim/ex_cmds_defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS

View File

@@ -18,6 +18,7 @@
#include "nvim/cursor.h" #include "nvim/cursor.h"
#include "nvim/edit.h" #include "nvim/edit.h"
#include "nvim/eval.h" #include "nvim/eval.h"
#include "nvim/eval/funcs.h"
#include "nvim/ex_cmds.h" #include "nvim/ex_cmds.h"
#include "nvim/ex_cmds2.h" #include "nvim/ex_cmds2.h"
#include "nvim/ex_getln.h" #include "nvim/ex_getln.h"

View File

@@ -5,7 +5,6 @@
#include <stdint.h> #include <stdint.h>
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/eval/funcs.h"
#include "nvim/eval/typval.h" #include "nvim/eval/typval.h"
#include "nvim/normal.h" #include "nvim/normal.h"
#include "nvim/os/time.h" #include "nvim/os/time.h"

View File

@@ -10,6 +10,7 @@
#include "nvim/charset.h" #include "nvim/charset.h"
#include "nvim/cursor.h" #include "nvim/cursor.h"
#include "nvim/edit.h" #include "nvim/edit.h"
#include "nvim/eval/funcs.h"
#include "nvim/ex_docmd.h" #include "nvim/ex_docmd.h"
#include "nvim/fold.h" #include "nvim/fold.h"
#include "nvim/highlight_group.h" #include "nvim/highlight_group.h"

View File

@@ -4,7 +4,6 @@
#include <stdbool.h> #include <stdbool.h>
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/eval/funcs.h"
#include "nvim/ex_cmds_defs.h" #include "nvim/ex_cmds_defs.h"
#include "nvim/sign_defs.h" #include "nvim/sign_defs.h"

View File

@@ -1,7 +1,6 @@
#ifndef NVIM_TESTING_H #ifndef NVIM_TESTING_H
#define NVIM_TESTING_H #define NVIM_TESTING_H
#include "nvim/eval/funcs.h"
#include "nvim/eval/typval.h" #include "nvim/eval/typval.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS

View File

@@ -22,6 +22,8 @@ typedef int handle_T;
// absent callback etc. // absent callback etc.
typedef int LuaRef; typedef int LuaRef;
typedef void (*FunPtr)(void);
typedef handle_T NS; typedef handle_T NS;
typedef struct expand expand_T; typedef struct expand expand_T;