refactor: move non-symbols to defs.h headers

This commit is contained in:
dundargoc 2023-12-12 15:40:21 +01:00 committed by dundargoc
parent c0cb1e8e94
commit 69bc519b53
79 changed files with 514 additions and 478 deletions

View File

@ -142,12 +142,12 @@ iwyu: build/.ran-cmake
cmake --preset iwyu
cmake --build build > build/iwyu.log
iwyu-fix-includes --only_re="src/nvim" --ignore_re="(src/nvim/eval/encode.c|src/nvim/auto/|src/nvim/os/lang.c|src/nvim/map.c\
|src/nvim/api/private/helpers.h\
|src/nvim/api/private/validate.h\
|src/nvim/assert_defs.h\
|src/nvim/buffer.h\
|src/nvim/buffer_defs.h\
|src/nvim/channel.h\
|src/nvim/channel_defs.h\
|src/nvim/charset.h\
|src/nvim/drawline.h\
|src/nvim/eval.h\
@ -158,7 +158,6 @@ iwyu: build/.ran-cmake
|src/nvim/eval/window.h\
|src/nvim/event/libuv_process.h\
|src/nvim/event/loop.h\
|src/nvim/event/multiqueue.h\
|src/nvim/event/process.h\
|src/nvim/event/rstream.h\
|src/nvim/event/signal.h\
@ -174,8 +173,6 @@ iwyu: build/.ran-cmake
|src/nvim/keycodes.h\
|src/nvim/lua/executor.h\
|src/nvim/main.h\
|src/nvim/mark.h\
|src/nvim/msgpack_rpc/channel.h\
|src/nvim/msgpack_rpc/channel_defs.h\
|src/nvim/msgpack_rpc/helpers.h\
|src/nvim/msgpack_rpc/unpacker.h\

View File

@ -23,7 +23,6 @@
{ symbol: [ "extern_proc", private, '<uv.h>', public ] },
{ symbol: [ "iovec", private, '<sys/uio.h>', public ] },
{ include: [ '"keysets_defs.generated.h"', private, '"nvim/api/private/dispatch.h"', public ] },
{ include: [ '<uv/unix.h>', private, '<uv.h>', public ] },
]

View File

@ -900,12 +900,12 @@ def CheckIncludes(filename, lines, error):
# These should be synced with the ignored headers in the `iwyu` target in
# the Makefile.
check_includes_ignore = [
"src/nvim/api/private/helpers.h",
"src/nvim/api/private/validate.h",
"src/nvim/assert_defs.h",
"src/nvim/buffer.h",
"src/nvim/buffer_defs.h",
"src/nvim/channel.h",
"src/nvim/channel_defs.h",
"src/nvim/charset.h",
"src/nvim/drawline.h",
"src/nvim/eval.h",
@ -916,7 +916,6 @@ def CheckIncludes(filename, lines, error):
"src/nvim/eval/window.h",
"src/nvim/event/libuv_process.h",
"src/nvim/event/loop.h",
"src/nvim/event/multiqueue.h",
"src/nvim/event/process.h",
"src/nvim/event/rstream.h",
"src/nvim/event/signal.h",
@ -932,8 +931,6 @@ def CheckIncludes(filename, lines, error):
"src/nvim/keycodes.h",
"src/nvim/lua/executor.h",
"src/nvim/main.h",
"src/nvim/mark.h",
"src/nvim/msgpack_rpc/channel.h",
"src/nvim/msgpack_rpc/channel_defs.h",
"src/nvim/msgpack_rpc/helpers.h",
"src/nvim/msgpack_rpc/unpacker.h",
@ -949,10 +946,12 @@ def CheckIncludes(filename, lines, error):
]
skip_headers = [
"klib/kvec.h",
"klib/klist.h",
"auto/config.h",
"nvim/func_attr.h"
"klib/klist.h",
"klib/kvec.h",
"nvim/func_attr.h",
"nvim/gettext.h",
"nvim/globals.h"
]
for i in check_includes_ignore:

View File

@ -15,7 +15,6 @@
#include "nvim/macros_defs.h"
#include "nvim/memory.h"
#include "nvim/option.h"
#include "nvim/option_vars.h"
#include "nvim/vim_defs.h"
#include "nvim/window.h"

View File

@ -27,5 +27,5 @@ extern const MsgpackRpcRequestHandler method_handlers[];
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "api/private/dispatch.h.generated.h"
# include "api/private/dispatch_wrappers.h.generated.h" // IWYU pragma: export
# include "keysets_defs.generated.h"
# include "keysets_defs.generated.h" // IWYU pragma: export
#endif

View File

@ -17,7 +17,6 @@
#include "nvim/ascii_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/eval/typval.h"
#include "nvim/eval/typval_defs.h"
#include "nvim/eval/vars.h"
#include "nvim/ex_eval.h"
#include "nvim/garray.h"

View File

@ -2,21 +2,15 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "klib/kvec.h"
#include "nvim/api/private/defs.h"
#include "nvim/api/private/dispatch.h"
#include "nvim/decoration.h"
#include "nvim/eval/typval_defs.h"
#include "nvim/ex_eval_defs.h"
#include "nvim/getchar.h"
#include "nvim/gettext.h"
#include "nvim/globals.h"
#include "nvim/macros_defs.h"
#include "nvim/map_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/message_defs.h" // IWYU pragma: keep
#define OBJECT_OBJ(o) o

View File

@ -15,7 +15,7 @@
#include "nvim/autocmd.h"
#include "nvim/channel.h"
#include "nvim/eval.h"
#include "nvim/event/loop.h"
#include "nvim/event/defs.h"
#include "nvim/event/wstream.h"
#include "nvim/globals.h"
#include "nvim/grid.h"

View File

@ -54,6 +54,7 @@
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/os/input.h"
#include "nvim/os/os_defs.h"
#include "nvim/os/process.h"
#include "nvim/popupmenu.h"
#include "nvim/pos_defs.h"

View File

@ -13,7 +13,6 @@
#include "nvim/charset.h"
#include "nvim/cmdexpand_defs.h"
#include "nvim/eval/typval.h"
#include "nvim/eval/typval_defs.h"
#include "nvim/eval/window.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds2.h"

View File

@ -2,9 +2,7 @@
#include "nvim/arglist_defs.h" // IWYU pragma: export
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "arglist.h.generated.h"

View File

@ -19,7 +19,7 @@
#include "nvim/eval/typval.h"
#include "nvim/eval/userfunc.h"
#include "nvim/eval/vars.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/fileio.h"

View File

@ -39,7 +39,6 @@
#include "nvim/charset.h"
#include "nvim/cmdexpand.h"
#include "nvim/cursor.h"
#include "nvim/decoration.h"
#include "nvim/diff.h"
#include "nvim/digraph.h"
#include "nvim/drawscreen.h"

View File

@ -37,6 +37,7 @@
#include "nvim/option_vars.h"
#include "nvim/os/fs.h"
#include "nvim/os/input.h"
#include "nvim/os/os_defs.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/sha256.h"

View File

@ -15,8 +15,10 @@
#include "nvim/eval.h"
#include "nvim/eval/encode.h"
#include "nvim/eval/typval.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/rstream.h"
#include "nvim/event/socket.h"
#include "nvim/event/stream.h"
#include "nvim/event/wstream.h"
#include "nvim/garray.h"
#include "nvim/gettext.h"
@ -32,6 +34,7 @@
#include "nvim/os/shell.h"
#include "nvim/path.h"
#include "nvim/rbuffer.h"
#include "nvim/types_defs.h"
#ifdef MSWIN
# include "nvim/os/fs.h"

View File

@ -4,6 +4,7 @@
#include <stdint.h>
#include <stdlib.h>
#include "nvim/channel_defs.h" // IWYU pragma: export
#include "nvim/eval/typval_defs.h"
#include "nvim/event/libuv_process.h"
#include "nvim/event/multiqueue.h"
@ -19,60 +20,6 @@
#include "nvim/terminal.h"
#include "nvim/types_defs.h"
#define CHAN_STDIO 1
#define CHAN_STDERR 2
typedef enum {
kChannelStreamProc,
kChannelStreamSocket,
kChannelStreamStdio,
kChannelStreamStderr,
kChannelStreamInternal,
} ChannelStreamType;
typedef enum {
kChannelPartStdin,
kChannelPartStdout,
kChannelPartStderr,
kChannelPartRpc,
kChannelPartAll,
} ChannelPart;
typedef enum {
kChannelStdinPipe,
kChannelStdinNull,
} ChannelStdinMode;
typedef struct {
Stream in;
Stream out;
} StdioPair;
typedef struct {
bool closed;
} StderrState;
typedef struct {
LuaRef cb;
bool closed;
} InternalState;
typedef struct {
Callback cb;
dict_T *self;
garray_T buffer;
bool eof;
bool buffered;
bool fwd_err;
const char *type;
} CallbackReader;
#define CALLBACK_READER_INIT ((CallbackReader){ .cb = CALLBACK_NONE, \
.self = NULL, \
.buffer = GA_EMPTY_INIT_VALUE, \
.buffered = false, \
.fwd_err = false, \
.type = NULL })
static inline bool callback_reader_set(CallbackReader reader)
{
return reader.cb.type != kCallbackNone || reader.self;

74
src/nvim/channel_defs.h Normal file
View File

@ -0,0 +1,74 @@
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include "nvim/eval/typval_defs.h"
#include "nvim/event/libuv_process.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/process.h"
#include "nvim/event/socket.h"
#include "nvim/event/stream.h"
#include "nvim/garray_defs.h"
#include "nvim/macros_defs.h"
#include "nvim/main.h"
#include "nvim/map_defs.h"
#include "nvim/msgpack_rpc/channel_defs.h"
#include "nvim/os/pty_process.h"
#include "nvim/terminal.h"
#include "nvim/types_defs.h"
#define CHAN_STDIO 1
#define CHAN_STDERR 2
typedef enum {
kChannelStreamProc,
kChannelStreamSocket,
kChannelStreamStdio,
kChannelStreamStderr,
kChannelStreamInternal,
} ChannelStreamType;
typedef enum {
kChannelPartStdin,
kChannelPartStdout,
kChannelPartStderr,
kChannelPartRpc,
kChannelPartAll,
} ChannelPart;
typedef enum {
kChannelStdinPipe,
kChannelStdinNull,
} ChannelStdinMode;
typedef struct {
Stream in;
Stream out;
} StdioPair;
typedef struct {
bool closed;
} StderrState;
typedef struct {
LuaRef cb;
bool closed;
} InternalState;
typedef struct {
Callback cb;
dict_T *self;
garray_T buffer;
bool eof;
bool buffered;
bool fwd_err;
const char *type;
} CallbackReader;
#define CALLBACK_READER_INIT ((CallbackReader){ .cb = CALLBACK_NONE, \
.self = NULL, \
.buffer = GA_EMPTY_INIT_VALUE, \
.buffered = false, \
.fwd_err = false, \
.type = NULL })

View File

@ -6,7 +6,6 @@
#include "nvim/api/extmark.h"
#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/buffer.h"
#include "nvim/decoration.h"
#include "nvim/drawscreen.h"
#include "nvim/extmark.h"
@ -14,6 +13,7 @@
#include "nvim/grid.h"
#include "nvim/highlight.h"
#include "nvim/highlight_group.h"
#include "nvim/map_defs.h"
#include "nvim/marktree.h"
#include "nvim/memory.h"
#include "nvim/move.h"

View File

@ -91,6 +91,7 @@
#include "nvim/normal.h"
#include "nvim/option.h"
#include "nvim/option_vars.h"
#include "nvim/os/os_defs.h"
#include "nvim/plines.h"
#include "nvim/popupmenu.h"
#include "nvim/pos_defs.h"

View File

@ -32,6 +32,7 @@
#include "nvim/eval/vars.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/process.h"
#include "nvim/event/time.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"

View File

@ -48,6 +48,7 @@
#include "nvim/eval/userfunc.h"
#include "nvim/eval/vars.h"
#include "nvim/eval/window.h"
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/process.h"

View File

@ -6,5 +6,5 @@ extern dict_T *gc_first_dict;
extern list_T *gc_first_list;
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "eval/gc.h.generated.h" // IWYU pragma: export
# include "eval/gc.h.generated.h"
#endif

View File

@ -2,6 +2,10 @@
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <uv.h>
#include "nvim/rbuffer_defs.h"
enum { EVENT_HANDLER_MAX_ARGC = 10, };
@ -12,3 +16,165 @@ typedef struct {
} Event;
#define event_create(cb, ...) ((Event){ .handler = cb, .argv = { __VA_ARGS__ } })
typedef struct multiqueue MultiQueue;
typedef void (*PutCallback)(MultiQueue *multiq, void *data);
#define multiqueue_put(q, h, ...) \
do { \
multiqueue_put_event(q, event_create(h, __VA_ARGS__)); \
} while (0)
#define CREATE_EVENT(multiqueue, handler, ...) \
do { \
if (multiqueue) { \
multiqueue_put((multiqueue), (handler), __VA_ARGS__); \
} else { \
void *argv[] = { __VA_ARGS__ }; \
(handler)(argv); \
} \
} while (0)
// Poll for events until a condition or timeout
#define LOOP_PROCESS_EVENTS_UNTIL(loop, multiqueue, timeout, condition) \
do { \
int64_t remaining = timeout; \
uint64_t before = (remaining > 0) ? os_hrtime() : 0; \
while (!(condition)) { \
LOOP_PROCESS_EVENTS(loop, multiqueue, remaining); \
if (remaining == 0) { \
break; \
} else if (remaining > 0) { \
uint64_t now = os_hrtime(); \
remaining -= (int64_t)((now - before) / 1000000); \
before = now; \
if (remaining <= 0) { \
break; \
} \
} \
} \
} while (0)
#define LOOP_PROCESS_EVENTS(loop, multiqueue, timeout) \
do { \
if (multiqueue && !multiqueue_empty(multiqueue)) { \
multiqueue_process_events(multiqueue); \
} else { \
loop_poll_events(loop, timeout); \
} \
} while (0)
struct signal_watcher;
typedef struct signal_watcher SignalWatcher;
typedef void (*signal_cb)(SignalWatcher *watcher, int signum, void *data);
typedef void (*signal_close_cb)(SignalWatcher *watcher, void *data);
struct signal_watcher {
uv_signal_t uv;
void *data;
signal_cb cb;
signal_close_cb close_cb;
MultiQueue *events;
};
struct time_watcher;
typedef struct time_watcher TimeWatcher;
typedef void (*time_cb)(TimeWatcher *watcher, void *data);
struct time_watcher {
uv_timer_t uv;
void *data;
time_cb cb, close_cb;
MultiQueue *events;
bool blockable;
};
struct wbuffer;
typedef struct wbuffer WBuffer;
typedef void (*wbuffer_data_finalizer)(void *data);
struct wbuffer {
size_t size, refcount;
char *data;
wbuffer_data_finalizer cb;
};
struct stream;
typedef struct stream Stream;
/// Type of function called when the Stream buffer is filled with data
///
/// @param stream The Stream instance
/// @param buf The associated RBuffer instance
/// @param count Number of bytes that was read.
/// @param data User-defined data
/// @param eof If the stream reached EOF.
typedef void (*stream_read_cb)(Stream *stream, RBuffer *buf, size_t count, void *data, bool eof);
/// Type of function called when the Stream has information about a write
/// request.
///
/// @param stream The Stream instance
/// @param data User-defined data
/// @param status 0 on success, anything else indicates failure
typedef void (*stream_write_cb)(Stream *stream, void *data, int status);
typedef void (*stream_close_cb)(Stream *stream, void *data);
struct stream {
bool closed;
bool did_eof;
union {
uv_pipe_t pipe;
uv_tcp_t tcp;
uv_idle_t idle;
#ifdef MSWIN
uv_tty_t tty;
#endif
} uv;
uv_stream_t *uvstream;
uv_buf_t uvbuf;
RBuffer *buffer;
uv_file fd;
stream_read_cb read_cb;
stream_write_cb write_cb;
void *cb_data;
stream_close_cb close_cb, internal_close_cb;
void *close_cb_data, *internal_data;
size_t fpos;
size_t curmem;
size_t maxmem;
size_t pending_reqs;
size_t num_bytes;
MultiQueue *events;
};
struct socket_watcher;
#define ADDRESS_MAX_SIZE 256
typedef struct socket_watcher SocketWatcher;
typedef void (*socket_cb)(SocketWatcher *watcher, int result, void *data);
typedef void (*socket_close_cb)(SocketWatcher *watcher, void *data);
struct socket_watcher {
// Pipe/socket path, or TCP address string
char addr[ADDRESS_MAX_SIZE];
// TCP server or unix socket (named pipe on Windows)
union {
struct {
uv_tcp_t handle;
struct addrinfo *addrinfo;
} tcp;
struct {
uv_pipe_t handle;
} pipe;
} uv;
uv_stream_t *stream;
void *data;
socket_cb cb;
socket_close_cb close_cb;
MultiQueue *events;
};

View File

@ -4,9 +4,9 @@
#include <uv.h>
#include "nvim/eval/typval.h"
#include "nvim/event/defs.h"
#include "nvim/event/libuv_process.h"
#include "nvim/event/process.h"
#include "nvim/event/stream.h"
#include "nvim/log.h"
#include "nvim/os/os.h"
#include "nvim/ui_client.h"

View File

@ -5,6 +5,7 @@
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
#include "nvim/log.h"
#include "nvim/memory.h"
#include "nvim/os/time.h"

View File

@ -44,45 +44,6 @@ typedef struct loop {
bool closing; ///< Set to true if loop_close() has been called
} Loop;
#define CREATE_EVENT(multiqueue, handler, ...) \
do { \
if (multiqueue) { \
multiqueue_put((multiqueue), (handler), __VA_ARGS__); \
} else { \
void *argv[] = { __VA_ARGS__ }; \
(handler)(argv); \
} \
} while (0)
// Poll for events until a condition or timeout
#define LOOP_PROCESS_EVENTS_UNTIL(loop, multiqueue, timeout, condition) \
do { \
int64_t remaining = timeout; \
uint64_t before = (remaining > 0) ? os_hrtime() : 0; \
while (!(condition)) { \
LOOP_PROCESS_EVENTS(loop, multiqueue, remaining); \
if (remaining == 0) { \
break; \
} else if (remaining > 0) { \
uint64_t now = os_hrtime(); \
remaining -= (int64_t)((now - before) / 1000000); \
before = now; \
if (remaining <= 0) { \
break; \
} \
} \
} \
} while (0)
#define LOOP_PROCESS_EVENTS(loop, multiqueue, timeout) \
do { \
if (multiqueue && !multiqueue_empty(multiqueue)) { \
multiqueue_process_events(multiqueue); \
} else { \
loop_poll_events(loop, timeout); \
} \
} while (0)
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/loop.h.generated.h"
#endif

View File

@ -1,17 +1,8 @@
#pragma once
#include <uv.h>
#include <stddef.h> // IWYU pragma: keep
#include "nvim/event/defs.h"
#include "nvim/lib/queue.h"
typedef struct multiqueue MultiQueue;
typedef void (*PutCallback)(MultiQueue *multiq, void *data);
#define multiqueue_put(q, h, ...) \
do { \
multiqueue_put_event(q, event_create(h, __VA_ARGS__)); \
} while (0)
#include "nvim/event/defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/multiqueue.h.generated.h"

View File

@ -6,7 +6,9 @@
#include "klib/klist.h"
#include "nvim/event/libuv_process.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/process.h"
#include "nvim/event/stream.h"
#include "nvim/globals.h"
#include "nvim/log.h"
#include "nvim/main.h"

View File

@ -5,6 +5,7 @@
#include <sys/types.h>
#include <uv.h>
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/rstream.h"
#include "nvim/event/stream.h"

View File

@ -1,6 +1,7 @@
#include <stddef.h>
#include <uv.h>
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/signal.h"

View File

@ -2,23 +2,10 @@
#include <uv.h>
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
struct signal_watcher;
typedef struct signal_watcher SignalWatcher;
typedef void (*signal_cb)(SignalWatcher *watcher, int signum, void *data);
typedef void (*signal_close_cb)(SignalWatcher *watcher, void *data);
struct signal_watcher {
uv_signal_t uv;
void *data;
signal_cb cb;
signal_close_cb close_cb;
MultiQueue *events;
};
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/signal.h.generated.h"
#endif

View File

@ -7,6 +7,7 @@
#include "nvim/ascii_defs.h"
#include "nvim/charset.h"
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/socket.h"
#include "nvim/event/stream.h"

View File

@ -2,39 +2,12 @@
#include <uv.h>
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/rstream.h"
#include "nvim/event/wstream.h"
struct socket_watcher;
#define ADDRESS_MAX_SIZE 256
typedef struct socket_watcher SocketWatcher;
typedef void (*socket_cb)(SocketWatcher *watcher, int result, void *data);
typedef void (*socket_close_cb)(SocketWatcher *watcher, void *data);
struct socket_watcher {
// Pipe/socket path, or TCP address string
char addr[ADDRESS_MAX_SIZE];
// TCP server or unix socket (named pipe on Windows)
union {
struct {
uv_tcp_t handle;
struct addrinfo *addrinfo;
} tcp;
struct {
uv_pipe_t handle;
} pipe;
} uv;
uv_stream_t *stream;
void *data;
socket_cb cb;
socket_close_cb close_cb;
MultiQueue *events;
};
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/socket.h.generated.h"
#endif

View File

@ -4,6 +4,7 @@
#include <uv.h>
#include <uv/version.h>
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/stream.h"
#include "nvim/log.h"

View File

@ -4,59 +4,11 @@
#include <stddef.h>
#include <uv.h>
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
#include "nvim/rbuffer_defs.h"
struct stream;
typedef struct stream Stream;
/// Type of function called when the Stream buffer is filled with data
///
/// @param stream The Stream instance
/// @param buf The associated RBuffer instance
/// @param count Number of bytes that was read.
/// @param data User-defined data
/// @param eof If the stream reached EOF.
typedef void (*stream_read_cb)(Stream *stream, RBuffer *buf, size_t count, void *data, bool eof);
/// Type of function called when the Stream has information about a write
/// request.
///
/// @param stream The Stream instance
/// @param data User-defined data
/// @param status 0 on success, anything else indicates failure
typedef void (*stream_write_cb)(Stream *stream, void *data, int status);
typedef void (*stream_close_cb)(Stream *stream, void *data);
struct stream {
bool closed;
bool did_eof;
union {
uv_pipe_t pipe;
uv_tcp_t tcp;
uv_idle_t idle;
#ifdef MSWIN
uv_tty_t tty;
#endif
} uv;
uv_stream_t *uvstream;
uv_buf_t uvbuf;
RBuffer *buffer;
uv_file fd;
stream_read_cb read_cb;
stream_write_cb write_cb;
void *cb_data;
stream_close_cb close_cb, internal_close_cb;
void *close_cb_data, *internal_data;
size_t fpos;
size_t curmem;
size_t maxmem;
size_t pending_reqs;
size_t num_bytes;
MultiQueue *events;
};
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/stream.h.generated.h"
#endif

View File

@ -1,7 +1,10 @@
#include <stdbool.h>
#include <stdint.h>
#include <uv.h>
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/time.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS

View File

@ -3,22 +3,10 @@
#include <stdbool.h>
#include <uv.h>
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
struct time_watcher;
typedef struct time_watcher TimeWatcher;
typedef void (*time_cb)(TimeWatcher *watcher, void *data);
struct time_watcher {
uv_timer_t uv;
void *data;
time_cb cb, close_cb;
MultiQueue *events;
bool blockable;
};
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/time.h.generated.h"
#endif

View File

@ -1,7 +1,9 @@
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
#include <uv.h>
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/stream.h"
#include "nvim/event/wstream.h"

View File

@ -5,20 +5,10 @@
#include <stdint.h>
#include <uv.h>
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/stream.h"
struct wbuffer;
typedef struct wbuffer WBuffer;
typedef void (*wbuffer_data_finalizer)(void *data);
struct wbuffer {
size_t size, refcount;
char *data;
wbuffer_data_finalizer cb;
};
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/wstream.h.generated.h"
#endif

View File

@ -19,7 +19,6 @@
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
#include "nvim/buffer.h"
#include "nvim/buffer_defs.h"
#include "nvim/buffer_updates.h"
#include "nvim/bufwrite.h"
#include "nvim/change.h"

View File

@ -1,35 +1,6 @@
#pragma once
#include "nvim/buffer_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h"
#include "nvim/ex_cmds_defs.h" // IWYU pragma: export
#include "nvim/os/time_defs.h"
#include "nvim/pos_defs.h" // IWYU pragma: keep
/// flags for do_ecmd()
enum {
ECMD_HIDE = 0x01, ///< don't free the current buffer
ECMD_SET_HELP = 0x02, ///< set b_help flag of (new) buffer before opening file
ECMD_OLDBUF = 0x04, ///< use existing buffer if it exists
ECMD_FORCEIT = 0x08, ///< ! used in Ex command
ECMD_ADDBUF = 0x10, ///< don't edit, just add to buffer list
ECMD_ALTBUF = 0x20, ///< like ECMD_ADDBUF and set the alternate file
ECMD_NOWINENTER = 0x40, ///< do not trigger BufWinEnter
};
/// for lnum argument in do_ecmd()
enum {
ECMD_LASTL = 0, ///< use last position in loaded file
ECMD_LAST = -1, ///< use last position in all files
ECMD_ONE = 1, ///< use first line
};
/// Previous :substitute replacement string definition
typedef struct {
char *sub; ///< Previous replacement string.
Timestamp timestamp; ///< Time when it was last set.
list_T *additional_elements; ///< Additional data left from ShaDa file.
} SubReplacementString;
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "ex_cmds.h.generated.h"

View File

@ -229,3 +229,28 @@ typedef struct {
bool bar;
} magic;
} CmdParseInfo;
/// flags for do_ecmd()
enum {
ECMD_HIDE = 0x01, ///< don't free the current buffer
ECMD_SET_HELP = 0x02, ///< set b_help flag of (new) buffer before opening file
ECMD_OLDBUF = 0x04, ///< use existing buffer if it exists
ECMD_FORCEIT = 0x08, ///< ! used in Ex command
ECMD_ADDBUF = 0x10, ///< don't edit, just add to buffer list
ECMD_ALTBUF = 0x20, ///< like ECMD_ADDBUF and set the alternate file
ECMD_NOWINENTER = 0x40, ///< do not trigger BufWinEnter
};
/// for lnum argument in do_ecmd()
enum {
ECMD_LASTL = 0, ///< use last position in loaded file
ECMD_LAST = -1, ///< use last position in all files
ECMD_ONE = 1, ///< use first line
};
/// Previous :substitute replacement string definition
typedef struct {
char *sub; ///< Previous replacement string.
Timestamp timestamp; ///< Time when it was last set.
list_T *additional_elements; ///< Additional data left from ShaDa file.
} SubReplacementString;

View File

@ -29,7 +29,7 @@
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
#include "nvim/eval/userfunc.h"
#include "nvim/event/loop.h"
#include "nvim/event/defs.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds2.h"
#include "nvim/ex_cmds_defs.h"

View File

@ -5,10 +5,9 @@
#include "klib/kvec.h"
#include "nvim/buffer_defs.h" // IWYU pragma: keep
#include "nvim/decoration_defs.h" // IWYU pragma: keep
#include "nvim/extmark_defs.h" // IWYU pragma: export
#include "nvim/macros_defs.h"
#include "nvim/marktree_defs.h" // IWYU pragma: keep
#include "nvim/marktree_defs.h"
#include "nvim/pos_defs.h"
EXTERN int curbuf_splice_pending INIT( = 0);

View File

@ -7,7 +7,7 @@
#include <string.h>
#include "nvim/ascii_defs.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/defs.h"
#include "nvim/getchar.h"
#include "nvim/gettext.h"
#include "nvim/globals.h"

View File

@ -1,50 +1,18 @@
#pragma once
#include <stdbool.h>
#include <stdio.h>
#include "auto/config.h"
#include "nvim/log_defs.h" // IWYU pragma: export
#include "nvim/macros_defs.h"
// USDT probes. Example invocation:
// NVIM_PROBE(nvim_foo_bar, 1, string.data);
#if defined(HAVE_SYS_SDT_H)
# include <sys/sdt.h> // NOLINT
# include <sys/sdt.h> // IWYU pragma: keep
# define NVIM_PROBE(name, n, ...) STAP_PROBE##n(neovim, name, __VA_ARGS__)
#else
# define NVIM_PROBE(name, n, ...)
#endif
#define LOGLVL_DBG 1
#define LOGLVL_INF 2
#define LOGLVL_WRN 3
#define LOGLVL_ERR 4
#define LOG(level, ...) logmsg((level), NULL, __func__, __LINE__, true, __VA_ARGS__)
#ifdef NVIM_LOG_DEBUG
# define DLOG(...) logmsg(LOGLVL_DBG, NULL, __func__, __LINE__, true, __VA_ARGS__)
# define DLOGN(...) logmsg(LOGLVL_DBG, NULL, __func__, __LINE__, false, __VA_ARGS__)
# define ILOG(...) logmsg(LOGLVL_INF, NULL, __func__, __LINE__, true, __VA_ARGS__)
# define ILOGN(...) logmsg(LOGLVL_INF, NULL, __func__, __LINE__, false, __VA_ARGS__)
#else
# define DLOG(...)
# define DLOGN(...)
# define ILOG(...)
# define ILOGN(...)
#endif
#define WLOG(...) logmsg(LOGLVL_WRN, NULL, __func__, __LINE__, true, __VA_ARGS__)
#define WLOGN(...) logmsg(LOGLVL_WRN, NULL, __func__, __LINE__, false, __VA_ARGS__)
#define ELOG(...) logmsg(LOGLVL_ERR, NULL, __func__, __LINE__, true, __VA_ARGS__)
#define ELOGN(...) logmsg(LOGLVL_ERR, NULL, __func__, __LINE__, false, __VA_ARGS__)
#ifdef HAVE_EXECINFO_BACKTRACE
# define LOG_CALLSTACK() log_callstack(__func__, __LINE__)
# define LOG_CALLSTACK_TO_FILE(fp) log_callstack_to_file(fp, __func__, __LINE__)
#endif
// uncrustify:off
#if NVIM_HAS_INCLUDE(<sanitizer/asan_interface.h>)
# include <sanitizer/asan_interface.h> // IWYU pragma: keep

36
src/nvim/log_defs.h Normal file
View File

@ -0,0 +1,36 @@
#pragma once
#include <stdbool.h>
#include <stdio.h>
#include "auto/config.h"
#include "nvim/macros_defs.h"
#define LOGLVL_DBG 1
#define LOGLVL_INF 2
#define LOGLVL_WRN 3
#define LOGLVL_ERR 4
#define LOG(level, ...) logmsg((level), NULL, __func__, __LINE__, true, __VA_ARGS__)
#ifdef NVIM_LOG_DEBUG
# define DLOG(...) logmsg(LOGLVL_DBG, NULL, __func__, __LINE__, true, __VA_ARGS__)
# define DLOGN(...) logmsg(LOGLVL_DBG, NULL, __func__, __LINE__, false, __VA_ARGS__)
# define ILOG(...) logmsg(LOGLVL_INF, NULL, __func__, __LINE__, true, __VA_ARGS__)
# define ILOGN(...) logmsg(LOGLVL_INF, NULL, __func__, __LINE__, false, __VA_ARGS__)
#else
# define DLOG(...)
# define DLOGN(...)
# define ILOG(...)
# define ILOGN(...)
#endif
#define WLOG(...) logmsg(LOGLVL_WRN, NULL, __func__, __LINE__, true, __VA_ARGS__)
#define WLOGN(...) logmsg(LOGLVL_WRN, NULL, __func__, __LINE__, false, __VA_ARGS__)
#define ELOG(...) logmsg(LOGLVL_ERR, NULL, __func__, __LINE__, true, __VA_ARGS__)
#define ELOGN(...) logmsg(LOGLVL_ERR, NULL, __func__, __LINE__, false, __VA_ARGS__)
#ifdef HAVE_EXECINFO_BACKTRACE
# define LOG_CALLSTACK() log_callstack(__func__, __LINE__)
# define LOG_CALLSTACK_TO_FILE(fp) log_callstack_to_file(fp, __func__, __LINE__)
#endif

View File

@ -27,7 +27,6 @@
#include "nvim/eval/userfunc.h"
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/time.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds_defs.h"

View File

@ -2,13 +2,13 @@
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "nvim/ascii_defs.h"
#include "nvim/buffer.h"
#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/diff.h"
@ -16,7 +16,6 @@
#include "nvim/eval/typval.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/extmark.h"
#include "nvim/extmark_defs.h"
#include "nvim/fold.h"
#include "nvim/gettext.h"
#include "nvim/globals.h"
@ -32,7 +31,9 @@
#include "nvim/os/fs.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
#include "nvim/os/time.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/quickfix.h"
#include "nvim/strings.h"
#include "nvim/textobject.h"

View File

@ -1,54 +1,10 @@
#pragma once
#include <stdbool.h>
#include <stddef.h>
#include "nvim/ascii_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/extmark_defs.h"
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
#include "nvim/func_attr.h"
#include "nvim/macros_defs.h"
#include "nvim/mark_defs.h" // IWYU pragma: export
#include "nvim/memory.h"
#include "nvim/os/time.h"
#include "nvim/pos_defs.h"
/// Set fmark using given value
#define SET_FMARK(fmarkp_, mark_, fnum_, view_) \
do { \
fmark_T *const fmarkp__ = fmarkp_; \
fmarkp__->mark = mark_; \
fmarkp__->fnum = fnum_; \
fmarkp__->timestamp = os_time(); \
fmarkp__->view = view_; \
fmarkp__->additional_data = NULL; \
} while (0)
/// Free and set fmark using given value
#define RESET_FMARK(fmarkp_, mark_, fnum_, view_) \
do { \
fmark_T *const fmarkp___ = fmarkp_; \
free_fmark(*fmarkp___); \
SET_FMARK(fmarkp___, mark_, fnum_, view_); \
} while (0)
/// Set given extended mark (regular mark + file name)
#define SET_XFMARK(xfmarkp_, mark_, fnum_, view_, fname_) \
do { \
xfmark_T *const xfmarkp__ = xfmarkp_; \
xfmarkp__->fname = fname_; \
SET_FMARK(&(xfmarkp__->fmark), mark_, fnum_, view_); \
} while (0)
/// Free and set given extended mark (regular mark + file name)
#define RESET_XFMARK(xfmarkp_, mark_, fnum_, view_, fname_) \
do { \
xfmark_T *const xfmarkp__ = xfmarkp_; \
free_xfmark(*xfmarkp__); \
xfmarkp__->fname = fname_; \
SET_FMARK(&(xfmarkp__->fmark), mark_, fnum_, view_); \
} while (0)
static inline int mark_global_index(char name)
REAL_FATTR_CONST;
@ -80,47 +36,6 @@ static inline int mark_local_index(const char name)
: -1))));
}
static inline bool lt(pos_T a, pos_T b)
REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE;
static inline bool equalpos(pos_T a, pos_T b)
REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE;
static inline bool ltoreq(pos_T a, pos_T b)
REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE;
static inline void clearpos(pos_T *a)
REAL_FATTR_ALWAYS_INLINE;
/// Return true if position a is before (less than) position b.
static inline bool lt(pos_T a, pos_T b)
{
if (a.lnum != b.lnum) {
return a.lnum < b.lnum;
} else if (a.col != b.col) {
return a.col < b.col;
} else {
return a.coladd < b.coladd;
}
}
/// Return true if position a and b are equal.
static inline bool equalpos(pos_T a, pos_T b)
{
return (a.lnum == b.lnum) && (a.col == b.col) && (a.coladd == b.coladd);
}
/// Return true if position a is less than or equal to b.
static inline bool ltoreq(pos_T a, pos_T b)
{
return lt(a, b) || equalpos(a, b);
}
/// Clear the pos_T structure pointed to by a.
static inline void clearpos(pos_T *a)
{
a->lnum = 0;
a->col = 0;
a->coladd = 0;
}
/// Global marks (marks with file number or name)
EXTERN xfmark_T namedfm[NGLOBALMARKS] INIT( = { 0 });

View File

@ -84,3 +84,79 @@ typedef struct xfilemark {
} xfmark_T;
#define INIT_XFMARK { INIT_FMARK, NULL }
/// Set fmark using given value
#define SET_FMARK(fmarkp_, mark_, fnum_, view_) \
do { \
fmark_T *const fmarkp__ = fmarkp_; \
fmarkp__->mark = mark_; \
fmarkp__->fnum = fnum_; \
fmarkp__->timestamp = os_time(); \
fmarkp__->view = view_; \
fmarkp__->additional_data = NULL; \
} while (0)
/// Free and set fmark using given value
#define RESET_FMARK(fmarkp_, mark_, fnum_, view_) \
do { \
fmark_T *const fmarkp___ = fmarkp_; \
free_fmark(*fmarkp___); \
SET_FMARK(fmarkp___, mark_, fnum_, view_); \
} while (0)
/// Set given extended mark (regular mark + file name)
#define SET_XFMARK(xfmarkp_, mark_, fnum_, view_, fname_) \
do { \
xfmark_T *const xfmarkp__ = xfmarkp_; \
xfmarkp__->fname = fname_; \
SET_FMARK(&(xfmarkp__->fmark), mark_, fnum_, view_); \
} while (0)
/// Free and set given extended mark (regular mark + file name)
#define RESET_XFMARK(xfmarkp_, mark_, fnum_, view_, fname_) \
do { \
xfmark_T *const xfmarkp__ = xfmarkp_; \
free_xfmark(*xfmarkp__); \
xfmarkp__->fname = fname_; \
SET_FMARK(&(xfmarkp__->fmark), mark_, fnum_, view_); \
} while (0)
static inline bool lt(pos_T a, pos_T b)
REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE;
/// Return true if position a is before (less than) position b.
static inline bool lt(pos_T a, pos_T b)
{
if (a.lnum != b.lnum) {
return a.lnum < b.lnum;
} else if (a.col != b.col) {
return a.col < b.col;
} else {
return a.coladd < b.coladd;
}
}
static inline bool equalpos(pos_T a, pos_T b)
REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE;
/// Return true if position a and b are equal.
static inline bool equalpos(pos_T a, pos_T b)
{
return (a.lnum == b.lnum) && (a.col == b.col) && (a.coladd == b.coladd);
}
static inline bool ltoreq(pos_T a, pos_T b)
REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE;
/// Return true if position a is less than or equal to b.
static inline bool ltoreq(pos_T a, pos_T b)
{
return lt(a, b) || equalpos(a, b);
}
static inline void clearpos(pos_T *a)
REAL_FATTR_ALWAYS_INLINE;
/// Clear the pos_T structure pointed to by a.
static inline void clearpos(pos_T *a)
{
a->lnum = 0;
a->col = 0;
a->coladd = 0;
}

View File

@ -3,12 +3,12 @@
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <sys/types.h> // IWYU pragma: keep
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
#include "nvim/func_attr.h"
#include "nvim/mbyte_defs.h" // IWYU pragma: export
#include "nvim/os/os_defs.h" // IWYU pragma: export
#include "nvim/types_defs.h" // IWYU pragma: keep
// Return byte length of character that starts with byte "b".

View File

@ -10,6 +10,8 @@
#include <string.h>
#include <sys/types.h>
#include "klib/kvec.h"
#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/buffer_defs.h"

View File

@ -1,53 +1,12 @@
#pragma once
#include <errno.h>
#include <stdbool.h>
#include <stddef.h> // IWYU pragma: keep
#include <stdio.h>
#include "klib/kvec.h"
#include "nvim/api/private/defs.h"
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
#include "nvim/grid_defs.h"
#include "nvim/macros_defs.h"
/// Types of dialogs passed to do_dialog().
enum {
VIM_GENERIC = 0,
VIM_ERROR = 1,
VIM_WARNING = 2,
VIM_INFO = 3,
VIM_QUESTION = 4,
VIM_LAST_TYPE = 4, ///< sentinel value
};
/// Return values for functions like vim_dialogyesno()
enum {
VIM_YES = 2,
VIM_NO = 3,
VIM_CANCEL = 4,
VIM_ALL = 5,
VIM_DISCARDALL = 6,
};
enum { MSG_HIST = 0x1000, }; ///< special attribute addition: Put message in history
typedef struct {
String text;
int attr;
} HlMessageChunk;
typedef kvec_t(HlMessageChunk) HlMessage;
/// Message history for `:messages`
typedef struct msg_hist {
struct msg_hist *next; ///< Next message.
char *msg; ///< Message text.
const char *kind; ///< Message kind (for msg_ext)
int attr; ///< Message highlighting.
bool multiline; ///< Multiline message.
HlMessage multiattr; ///< multiattr message.
} MessageHistoryEntry;
#include "nvim/message_defs.h" // IWYU pragma: export
/// First message
extern MessageHistoryEntry *first_msg_hist;
@ -79,14 +38,3 @@ EXTERN int msg_listdo_overwrite INIT( = 0);
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "message.h.generated.h"
#endif
// Prefer using semsg(), because perror() may send the output to the wrong
// destination and mess up the screen.
#define PERROR(msg) (void)semsg("%s: %s", (msg), strerror(errno))
#ifndef MSWIN
/// Headless (no UI) error message handler.
# define os_errmsg(str) fprintf(stderr, "%s", (str))
/// Headless (no UI) message handler.
# define os_msg(str) printf("%s", (str))
#endif

59
src/nvim/message_defs.h Normal file
View File

@ -0,0 +1,59 @@
#pragma once
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include "klib/kvec.h"
#include "nvim/api/private/defs.h"
#include "nvim/grid_defs.h"
#include "nvim/macros_defs.h"
/// Types of dialogs passed to do_dialog().
enum {
VIM_GENERIC = 0,
VIM_ERROR = 1,
VIM_WARNING = 2,
VIM_INFO = 3,
VIM_QUESTION = 4,
VIM_LAST_TYPE = 4, ///< sentinel value
};
/// Return values for functions like vim_dialogyesno()
enum {
VIM_YES = 2,
VIM_NO = 3,
VIM_CANCEL = 4,
VIM_ALL = 5,
VIM_DISCARDALL = 6,
};
enum { MSG_HIST = 0x1000, }; ///< special attribute addition: Put message in history
typedef struct {
String text;
int attr;
} HlMessageChunk;
typedef kvec_t(HlMessageChunk) HlMessage;
/// Message history for `:messages`
typedef struct msg_hist {
struct msg_hist *next; ///< Next message.
char *msg; ///< Message text.
const char *kind; ///< Message kind (for msg_ext)
int attr; ///< Message highlighting.
bool multiline; ///< Multiline message.
HlMessage multiattr; ///< multiattr message.
} MessageHistoryEntry;
// Prefer using semsg(), because perror() may send the output to the wrong
// destination and mess up the screen.
#define PERROR(msg) (void)semsg("%s: %s", (msg), strerror(errno))
#ifndef MSWIN
/// Headless (no UI) error message handler.
# define os_errmsg(str) fprintf(stderr, "%s", (str))
/// Headless (no UI) message handler.
# define os_msg(str) printf("%s", (str))
#endif

View File

@ -15,10 +15,9 @@
#include "nvim/api/ui.h"
#include "nvim/channel.h"
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/process.h"
#include "nvim/event/rstream.h"
#include "nvim/event/stream.h"
#include "nvim/event/wstream.h"
#include "nvim/globals.h"
#include "nvim/log.h"

View File

@ -3,11 +3,7 @@
#include <stdint.h> // IWYU pragma: keep
#include "nvim/api/private/defs.h" // IWYU pragma: keep
#include "nvim/channel.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/process.h"
#include "nvim/event/socket.h"
#include "nvim/event/wstream.h"
#include "nvim/event/defs.h"
#include "nvim/macros_defs.h"
#include "nvim/memory_defs.h" // IWYU pragma: keep
#include "nvim/msgpack_rpc/channel_defs.h" // IWYU pragma: export

View File

@ -6,6 +6,7 @@
#include "nvim/channel.h"
#include "nvim/eval.h"
#include "nvim/event/defs.h"
#include "nvim/event/socket.h"
#include "nvim/garray.h"
#include "nvim/log.h"

View File

@ -84,7 +84,6 @@
#include "nvim/regexp.h"
#include "nvim/runtime.h"
#include "nvim/search.h"
#include "nvim/sign_defs.h"
#include "nvim/spell.h"
#include "nvim/spellfile.h"
#include "nvim/spellsuggest.h"

View File

@ -131,6 +131,5 @@ typedef enum {
} OptReqScope;
#ifdef INCLUDE_GENERATED_DECLARATIONS
// Initialize the OptIndex enum.
# include "options_enum.generated.h"
# include "options_enum.generated.h" // IWYU pragma: export
#endif

View File

@ -8,6 +8,7 @@
#include "nvim/api/private/defs.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/rstream.h"

View File

@ -32,9 +32,9 @@
#include "auto/config.h"
#include "klib/klist.h"
#include "nvim/eval/typval.h"
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/process.h"
#include "nvim/event/stream.h"
#include "nvim/log.h"
#include "nvim/os/fs.h"
#include "nvim/os/os_defs.h"

View File

@ -11,6 +11,7 @@
#include "nvim/charset.h"
#include "nvim/eval.h"
#include "nvim/eval/typval_defs.h"
#include "nvim/event/defs.h"
#include "nvim/event/libuv_process.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
@ -30,6 +31,7 @@
#include "nvim/message.h"
#include "nvim/option_vars.h"
#include "nvim/os/fs.h"
#include "nvim/os/os_defs.h"
#include "nvim/os/shell.h"
#include "nvim/os/signal.h"
#include "nvim/os/time.h"

View File

@ -8,6 +8,7 @@
#include "nvim/autocmd.h"
#include "nvim/eval.h"
#include "nvim/event/defs.h"
#include "nvim/event/signal.h"
#include "nvim/globals.h"
#include "nvim/log.h"

View File

@ -7,7 +7,7 @@
#include <uv.h>
#include "auto/config.h"
#include "nvim/event/loop.h"
#include "nvim/event/defs.h"
#include "nvim/gettext.h"
#include "nvim/globals.h"
#include "nvim/log.h"

View File

@ -1,5 +1,5 @@
#pragma once
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "os/tty.h.generated.h" // IWYU pragma: export
# include "os/tty.h.generated.h"
#endif

View File

@ -2,7 +2,7 @@
#include <stdbool.h>
#include "nvim/buffer_defs.h"
#include "nvim/buffer_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
#include "nvim/grid_defs.h"
#include "nvim/macros_defs.h"

View File

@ -90,6 +90,7 @@
#include "nvim/option_vars.h"
#include "nvim/os/fs.h"
#include "nvim/os/input.h"
#include "nvim/os/os_defs.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/regexp.h"

View File

@ -35,6 +35,7 @@
#include "nvim/option_vars.h"
#include "nvim/os/fs.h"
#include "nvim/os/input.h"
#include "nvim/os/os_defs.h"
#include "nvim/pos_defs.h"
#include "nvim/profile.h"
#include "nvim/spell.h"

View File

@ -4,7 +4,7 @@
#include "nvim/buffer_defs.h" // IWYU pragma: keep
#include "nvim/macros_defs.h"
#include "nvim/option_defs.h"
#include "nvim/option_defs.h" // IWYU pragma: keep
#include "nvim/statusline_defs.h" // IWYU pragma: export
/// Array defining what should be done when tabline is clicked

View File

@ -43,6 +43,7 @@
#include "nvim/optionstr.h"
#include "nvim/os/fs.h"
#include "nvim/os/input.h"
#include "nvim/os/os_defs.h"
#include "nvim/os/time.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"

View File

@ -57,6 +57,7 @@
#include "nvim/drawscreen.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
#include "nvim/event/defs.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/time.h"
#include "nvim/ex_docmd.h"

View File

@ -1,5 +1,6 @@
#pragma once
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

View File

@ -7,6 +7,7 @@
#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/event/defs.h"
#include "nvim/event/stream.h"
#include "nvim/macros_defs.h"
#include "nvim/main.h"
#include "nvim/map_defs.h"

View File

@ -15,6 +15,7 @@
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/cursor_shape.h"
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/signal.h"
#include "nvim/event/stream.h"

View File

@ -14,6 +14,7 @@
#include "nvim/buffer.h"
#include "nvim/cursor_shape.h"
#include "nvim/drawscreen.h"
#include "nvim/event/multiqueue.h"
#include "nvim/ex_getln.h"
#include "nvim/gettext.h"
#include "nvim/globals.h"

View File

@ -10,7 +10,7 @@
#include "nvim/channel.h"
#include "nvim/eval.h"
#include "nvim/eval/typval_defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
#include "nvim/log.h"

View File

@ -56,7 +56,6 @@ typedef enum {
kCdCauseAuto, ///< On 'autochdir'.
} CdCause;
// bring lots of system header files
#include "nvim/os/os_defs.h" // IWYU pragma: keep
// return values for functions

View File

@ -56,6 +56,7 @@
#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/os/fs.h"
#include "nvim/os/os_defs.h"
#include "nvim/path.h"
#include "nvim/plines.h"
#include "nvim/pos_defs.h"