commit 66360675cf4d091b7460e4a8e1435c13216c1929 parent 9d2a6cd11e092de838939ce993e8d18f5c9584b7 Author: dundargoc <gocdundar@gmail.com> Date: Sun, 11 Sep 2022 17:12:44 +0200 build: allow IWYU to fix includes for all .c files Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers. Diffstat:
267 files changed, 3174 insertions(+), 863 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -186,6 +186,20 @@ if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG) string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") endif() +option(ENABLE_IWYU "Run include-what-you-use with the compiler." OFF) +if(ENABLE_IWYU) + find_program(IWYU_PRG NAMES include-what-you-use iwyu) + if(NOT IWYU_PRG) + message(FATAL_ERROR "ENABLE_IWYU is ON but include-what-you-use is not found!") + endif() + set(CMAKE_C_INCLUDE_WHAT_YOU_USE ${IWYU_PRG} + -Xiwyu --mapping_file=${PROJECT_SOURCE_DIR}/cmake.config/iwyu/mapping.imp + -Xiwyu --mapping_file=${PROJECT_SOURCE_DIR}/cmake.config/iwyu/gcc.libc.imp + -Xiwyu --mapping_file=${PROJECT_SOURCE_DIR}/cmake.config/iwyu/gcc.symbols.imp + -Xiwyu --no_default_mappings) + add_definitions(-DEXITFREE) +endif() + # gcc 4.0+ sets _FORTIFY_SOURCE=2 automatically. This currently # does not work with Neovim due to some uses of dynamically-sized structures. # https://github.com/neovim/neovim/issues/223 diff --git a/CMakePresets.json b/CMakePresets.json @@ -67,6 +67,17 @@ "inherits": [ "base" ] + }, + { + "name": "iwyu", + "displayName": "IWYU", + "description": "Run include-what-you-use with the compiler", + "cacheVariables": { + "ENABLE_IWYU": "ON" + }, + "inherits": [ + "base" + ] } ], "buildPresets": [ @@ -90,6 +101,10 @@ "lhs": "${hostSystemName}", "rhs": "Windows" } + }, + { + "name": "iwyu", + "configurePreset": "iwyu" } ] } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md @@ -247,9 +247,15 @@ You can lint a single file (but this will _not_ exclude legacy errors): For managing includes in C files, use [include-what-you-use]. - [Install include-what-you-use][include-what-you-use-install] -- Run with: +- To see which includes needs fixing just use the cmake preset `iwyu`: ``` - make CMAKE_EXTRA_FLAGS=-DCMAKE_C_INCLUDE_WHAT_YOU_USE=include-what-you-use | tee iwyu.txt + cmake --preset iwyu + cmake --build --preset iwyu + ``` +- There's also a make target that automatically fixes the suggestions from + IWYU: + ``` + make iwyu ``` See [#549][549] for more details. diff --git a/Makefile b/Makefile @@ -135,6 +135,12 @@ lintlua lintsh lintuncrustify lintc lintcfull check-single-includes generated-so test: functionaltest unittest +iwyu: build/.ran-cmake + cmake --preset iwyu + cmake --build --preset iwyu > build/iwyu.log + iwyu-fix-includes --only_re="src/nvim" --ignore_re="src/nvim/(auto|map.h|eval/encode.c)" --safe_headers < build/iwyu.log + cmake -B build -U ENABLE_IWYU + clean: +test -d build && $(BUILD_TOOL) -C build clean || true $(MAKE) -C src/nvim/testdir clean diff --git a/cmake.config/iwyu/gcc.libc.imp b/cmake.config/iwyu/gcc.libc.imp @@ -0,0 +1,226 @@ +# This was initially taken from the IWYU repository: +# github.com/include-what-you-use/include-what-you-use/blob/164b8fe7597805ae55f029ecf6580dc46a74c7ed/gcc.libc.imp +# It has useful mappings that are normally enabled by default, but there are +# other default mappings that conflict with our builds. The best solution seems +# to be to disable all defaults, import the defaults from the IWYU +# repo and modify the rules that conflict with our build. +# +# TODO(dundargoc): Check if there is a way to disable specific builtin maps as +# to avoid this file entirely. + +# Mappings for GNU libc +# ( cd /usr/include && grep '^ *# *include' {sys/,net/,}* | perl -nle 'm/^([^:]+).*<([^>]+)>/ && print qq@ { include: [ "<$2>", private, "<$1>", public ] },@' | grep bits/ | sort ) +# When I saw more than one mapping for these, I typically picked +# what I thought was the "best" one. +[ + { include: [ "<bits/a.out.h>", private, "<a.out.h>", public ] }, + { include: [ "<bits/auxv.h>", private, "<sys/auxv.h>", public ] }, + { include: [ "<bits/byteswap.h>", private, "<byteswap.h>", public ] }, + { include: [ "<bits/cmathcalls.h>", private, "<complex.h>", public ] }, + { include: [ "<bits/confname.h>", private, "<unistd.h>", private ] }, + { include: [ "<bits/dirent.h>", private, "<dirent.h>", public ] }, + { include: [ "<bits/dlfcn.h>", private, "<dlfcn.h>", public ] }, + { include: [ "<bits/elfclass.h>", private, "<link.h>", public ] }, + { include: [ "<bits/endian.h>", private, "<endian.h>", public ] }, + { include: [ "<bits/environments.h>", private, "<unistd.h>", private ] }, + { include: [ "<bits/epoll.h>", private, "<sys/epoll.h>", public ] }, + { include: [ "<bits/errno.h>", private, "<errno.h>", public ] }, + { include: [ "<bits/error.h>", private, "<error.h>", public ] }, + { include: [ "<bits/eventfd.h>", private, "<sys/eventfd.h>", public ] }, + { include: [ "<bits/fcntl.h>", private, "<fcntl.h>", public ] }, + { include: [ "<bits/fcntl2.h>", private, "<fcntl.h>", public ] }, + { include: [ "<bits/fenv.h>", private, "<fenv.h>", public ] }, + { include: [ "<bits/fenvinline.h>", private, "<fenv.h>", public ] }, + { include: [ "<bits/huge_val.h>", private, "<math.h>", public ] }, + { include: [ "<bits/huge_valf.h>", private, "<math.h>", public ] }, + { include: [ "<bits/huge_vall.h>", private, "<math.h>", public ] }, + { include: [ "<bits/hwcap.h>", private, "<sys/auxv.h>", public ] }, + { include: [ "<bits/inf.h>", private, "<math.h>", public ] }, + { include: [ "<bits/inotify.h>", private, "<sys/inotify.h>", public ] }, + { include: [ "<bits/ioctl-types.h>", private, "<sys/ioctl.h>", public ] }, + { include: [ "<bits/ioctls.h>", private, "<sys/ioctl.h>", public ] }, + { include: [ "<bits/ipc.h>", private, "<sys/ipc.h>", public ] }, + { include: [ "<bits/ipctypes.h>", private, "<sys/ipc.h>", public ] }, + { include: [ "<bits/libio-ldbl.h>", private, "<libio.h>", public ] }, + { include: [ "<bits/link.h>", private, "<link.h>", public ] }, + { include: [ "<bits/locale.h>", private, "<locale.h>", public ] }, + { include: [ "<bits/math-finite.h>", private, "<math.h>", public ] }, + { include: [ "<bits/mathcalls.h>", private, "<math.h>", public ] }, + { include: [ "<bits/mathdef.h>", private, "<math.h>", public ] }, + { include: [ "<bits/mathinline.h>", private, "<math.h>", public ] }, + { include: [ "<bits/mman.h>", private, "<sys/mman.h>", public ] }, + { include: [ "<bits/mman-shared.h>", private, "<sys/mman.h>", public ] }, + { include: [ "<bits/monetary-ldbl.h>", private, "<monetary.h>", public ] }, + { include: [ "<bits/mqueue.h>", private, "<mqueue.h>", public ] }, + { include: [ "<bits/mqueue2.h>", private, "<mqueue.h>", public ] }, + { include: [ "<bits/msq.h>", private, "<sys/msg.h>", public ] }, + { include: [ "<bits/nan.h>", private, "<math.h>", public ] }, + { include: [ "<bits/netdb.h>", private, "<netdb.h>", private ] }, + { include: [ "<bits/param.h>", private, "<sys/param.h>", public ] }, + { include: [ "<bits/poll.h>", private, "<sys/poll.h>", private ] }, + { include: [ "<bits/poll2.h>", private, "<sys/poll.h>", private ] }, + { include: [ "<bits/posix1_lim.h>", private, "<limits.h>", public ] }, + { include: [ "<bits/posix2_lim.h>", private, "<limits.h>", public ] }, + { include: [ "<bits/posix_opt.h>", private, "<unistd.h>", private ] }, + { include: [ "<bits/printf-ldbl.h>", private, "<printf.h>", public ] }, + { include: [ "<bits/pthreadtypes.h>", private, "<pthread.h>", private ] }, + { include: [ "<bits/resource.h>", private, "<sys/resource.h>", public ] }, + { include: [ "<bits/sched.h>", private, "<sched.h>", public ] }, + { include: [ "<bits/select.h>", private, "<sys/select.h>", public ] }, + { include: [ "<bits/select2.h>", private, "<sys/select.h>", public ] }, + { include: [ "<bits/sem.h>", private, "<sys/sem.h>", public ] }, + { include: [ "<bits/semaphore.h>", private, "<semaphore.h>", public ] }, + { include: [ "<bits/setjmp.h>", private, "<setjmp.h>", public ] }, + { include: [ "<bits/setjmp2.h>", private, "<setjmp.h>", public ] }, + { include: [ "<bits/shm.h>", private, "<sys/shm.h>", public ] }, + { include: [ "<bits/sigaction.h>", private, "<signal.h>", public ] }, + { include: [ "<bits/sigcontext.h>", private, "<signal.h>", public ] }, + { include: [ "<bits/siginfo.h>", private, "<signal.h>", public ] }, + { include: [ "<bits/signum.h>", private, "<signal.h>", public ] }, + { include: [ "<bits/sigset.h>", private, "<signal.h>", public ] }, + { include: [ "<bits/sigstack.h>", private, "<signal.h>", public ] }, + { include: [ "<bits/sigthread.h>", private, "<signal.h>", public ] }, + { include: [ "<bits/sockaddr.h>", private, "<sys/un.h>", public ] }, + { include: [ "<bits/socket.h>", private, "<sys/socket.h>", private ] }, + { include: [ "<bits/socket2.h>", private, "<sys/socket.h>", private ] }, + { include: [ "<bits/socket_type.h>", private, "<sys/socket.h>", private ] }, + { include: [ "<bits/stab.def>", private, "<stab.h>", public ] }, + { include: [ "<bits/stat.h>", private, "<sys/stat.h>", public ] }, + { include: [ "<bits/statfs.h>", private, "<sys/statfs.h>", public ] }, + { include: [ "<bits/statvfs.h>", private, "<sys/statvfs.h>", public ] }, + { include: [ "<bits/stdio-ldbl.h>", private, "<stdio.h>", public ] }, + { include: [ "<bits/stdio-lock.h>", private, "<libio.h>", public ] }, + { include: [ "<bits/stdio.h>", private, "<stdio.h>", public ] }, + { include: [ "<bits/stdio2.h>", private, "<stdio.h>", public ] }, + { include: [ "<bits/stdio_lim.h>", private, "<stdio.h>", public ] }, + { include: [ "<bits/stdlib-bsearch.h>", private, "<stdlib.h>", public ] }, + { include: [ "<bits/stdlib-float.h>", private, "<stdlib.h>", public ] }, + { include: [ "<bits/stdlib-ldbl.h>", private, "<stdlib.h>", public ] }, + { include: [ "<bits/stdlib.h>", private, "<stdlib.h>", public ] }, + { include: [ "<bits/string.h>", private, "<string.h>", public ] }, + { include: [ "<bits/string2.h>", private, "<string.h>", public ] }, + { include: [ "<bits/string3.h>", private, "<string.h>", public ] }, + { include: [ "<bits/stropts.h>", private, "<stropts.h>", public ] }, + { include: [ "<bits/struct_stat.h>", private, "<sys/stat.h>", public ] }, + { include: [ "<bits/struct_stat.h>", private, "<ftw.h>", public ] }, + { include: [ "<bits/sys_errlist.h>", private, "<stdio.h>", public ] }, + { include: [ "<bits/syscall.h>", private, "<sys/syscall.h>", public ] }, + { include: [ "<bits/sysctl.h>", private, "<sys/sysctl.h>", public ] }, + { include: [ "<bits/syslog-ldbl.h>", private, "<sys/syslog.h>", private ] }, + { include: [ "<bits/syslog-path.h>", private, "<sys/syslog.h>", private ] }, + { include: [ "<bits/syslog.h>", private, "<sys/syslog.h>", private ] }, + { include: [ "<bits/termios.h>", private, "<termios.h>", private ] }, + { include: [ "<bits/termios-c_lflag.h>", private, "<termios.h>", private ] }, + { include: [ "<bits/termios-struct.h>", private, "<termios.h>", private ] }, + { include: [ "<bits/termios-tcflow.h>", private, "<termios.h>", private ] }, + { include: [ "<bits/time.h>", private, "<time.h>", public ] }, + { include: [ "<bits/time.h>", private, "<sys/time.h>", public ] }, + { include: [ "<bits/timerfd.h>", private, "<sys/timerfd.h>", public ] }, + { include: [ "<bits/timex.h>", private, "<sys/timex.h>", public ] }, + { include: [ "<bits/types.h>", private, "<sys/types.h>", public ] }, + { include: [ "<bits/types/siginfo_t.h>", private, "<signal.h>", public ] }, + { include: [ "<bits/types/siginfo_t.h>", private, "<sys/wait.h>", public ] }, + { include: [ "<bits/uio.h>", private, "<sys/uio.h>", public ] }, + { include: [ "<bits/unistd.h>", private, "<unistd.h>", private ] }, + { include: [ "<bits/ustat.h>", private, "<sys/ustat.h>", private ] }, + { include: [ "<bits/utmp.h>", private, "<utmp.h>", public ] }, + { include: [ "<bits/utmpx.h>", private, "<utmpx.h>", public ] }, + { include: [ "<bits/utsname.h>", private, "<sys/utsname.h>", public ] }, + { include: [ "<bits/waitflags.h>", private, "<sys/wait.h>", public ] }, + { include: [ "<bits/waitstatus.h>", private, "<sys/wait.h>", public ] }, + { include: [ "<bits/wchar-ldbl.h>", private, "<wchar.h>", public ] }, + { include: [ "<bits/wchar.h>", private, "<wchar.h>", public ] }, + { include: [ "<bits/wchar2.h>", private, "<wchar.h>", public ] }, + { include: [ "<bits/wordsize.h>", private, "<limits.h>", public ] }, + { include: [ "<bits/xopen_lim.h>", private, "<limits.h>", public ] }, + { include: [ "<bits/xtitypes.h>", private, "<stropts.h>", public ] }, + # Sometimes libc tells you what mapping to do via an '#error': + # # error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead." + # or + # # error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead." + # ( cd /usr/include && grep -R '^ *# *error "Never use\|include' * | perl -nle 'm/<([^>]+).*directly.*<([^>]+)/ && print qq@ { include: [ "<$1>", private, "<$2>", public ] },@' | sort ) + { include: [ "<bits/a.out.h>", private, "<a.out.h>", public ] }, + { include: [ "<bits/byteswap-16.h>", private, "<byteswap.h>", public ] }, + { include: [ "<bits/byteswap.h>", private, "<byteswap.h>", public ] }, + { include: [ "<bits/cmathcalls.h>", private, "<complex.h>", public ] }, + { include: [ "<bits/confname.h>", private, "<unistd.h>", private ] }, + { include: [ "<bits/dirent.h>", private, "<dirent.h>", public ] }, + { include: [ "<bits/dlfcn.h>", private, "<dlfcn.h>", public ] }, + { include: [ "<bits/elfclass.h>", private, "<link.h>", public ] }, + { include: [ "<bits/endian.h>", private, "<endian.h>", public ] }, + { include: [ "<bits/epoll.h>", private, "<sys/epoll.h>", public ] }, + { include: [ "<bits/eventfd.h>", private, "<sys/eventfd.h>", public ] }, + { include: [ "<bits/fcntl-linux.h>", private, "<fcntl.h>", public ] }, + { include: [ "<bits/fcntl.h>", private, "<fcntl.h>", public ] }, + { include: [ "<bits/fenv.h>", private, "<fenv.h>", public ] }, + { include: [ "<bits/huge_val.h>", private, "<math.h>", public ] }, + { include: [ "<bits/huge_valf.h>", private, "<math.h>", public ] }, + { include: [ "<bits/huge_vall.h>", private, "<math.h>", public ] }, + { include: [ "<bits/in.h>", private, "<netinet/in.h>", private ] }, + { include: [ "<bits/inf.h>", private, "<math.h>", public ] }, + { include: [ "<bits/inotify.h>", private, "<sys/inotify.h>", public ] }, + { include: [ "<bits/ioctl-types.h>", private, "<sys/ioctl.h>", public ] }, + { include: [ "<bits/ioctls.h>", private, "<sys/ioctl.h>", public ] }, + { include: [ "<bits/ipc.h>", private, "<sys/ipc.h>", public ] }, + { include: [ "<bits/ipctypes.h>", private, "<sys/ipc.h>", public ] }, + { include: [ "<bits/locale.h>", private, "<locale.h>", public ] }, + { include: [ "<bits/math-finite.h>", private, "<math.h>", public ] }, + { include: [ "<bits/mathdef.h>", private, "<math.h>", public ] }, + { include: [ "<bits/mathinline.h>", private, "<math.h>", public ] }, + { include: [ "<bits/mman-linux.h>", private, "<sys/mman.h>", public ] }, + { include: [ "<bits/mman.h>", private, "<sys/mman.h>", public ] }, + { include: [ "<bits/mqueue.h>", private, "<mqueue.h>", public ] }, + { include: [ "<bits/msq.h>", private, "<sys/msg.h>", public ] }, + { include: [ "<bits/nan.h>", private, "<math.h>", public ] }, + { include: [ "<bits/param.h>", private, "<sys/param.h>", public ] }, + { include: [ "<bits/poll.h>", private, "<sys/poll.h>", private ] }, + { include: [ "<bits/predefs.h>", private, "<features.h>", public ] }, + { include: [ "<bits/resource.h>", private, "<sys/resource.h>", public ] }, + { include: [ "<bits/select.h>", private, "<sys/select.h>", public ] }, + { include: [ "<bits/semaphore.h>", private, "<semaphore.h>", public ] }, + { include: [ "<bits/sigcontext.h>", private, "<signal.h>", public ] }, + { include: [ "<bits/signalfd.h>", private, "<sys/signalfd.h>", public ] }, + { include: [ "<bits/stdlib-float.h>", private, "<stdlib.h>", public ] }, + { include: [ "<bits/string.h>", private, "<string.h>", public ] }, + { include: [ "<bits/string2.h>", private, "<string.h>", public ] }, + { include: [ "<bits/string3.h>", private, "<string.h>", public ] }, + { include: [ "<bits/timerfd.h>", private, "<sys/timerfd.h>", public ] }, + { include: [ "<bits/typesizes.h>", private, "<sys/types.h>", public ] }, + # Top-level #includes that just forward to another file: + # $ for i in /usr/include/*; do [ -f $i ] } && [ `wc -l < $i` = 1 ] } && echo $i; done + # (poll.h, syscall.h, syslog.h, ustat.h, wait.h). + # For each file, I looked at the list of canonical header files -- + # http://www.opengroup.org/onlinepubs/9699919799/idx/head.html -- + # to decide which of the two files is canonical. If neither is + # on the POSIX.1 1998 list, I just choose the top-level one. + { include: [ "<sys/poll.h>", private, "<poll.h>", public ] }, + { include: [ "<sys/syslog.h>", private, "<syslog.h>", public ] }, + { include: [ "<sys/ustat.h>", private, "<ustat.h>", public ] }, + { include: [ "<wait.h>", private, "<sys/wait.h>", public ] }, + # These are all files in bits/ that delegate to asm/ and linux/ to + # do all (or lots) of the work. Note these are private->private. + # $ for i in /usr/include/bits/*; do for dir in asm linux; do grep -H -e $dir/`basename $i` $i; done; done + { include: [ "<linux/errno.h>", private, "<bits/errno.h>", private ] }, + { include: [ "<asm/ioctls.h>", private, "<bits/ioctls.h>", private ] }, + { include: [ "<asm/socket.h>", private, "<bits/socket.h>", private ] }, + { include: [ "<linux/socket.h>", private, "<bits/socket.h>", private ] }, + # Some asm files have 32- and 64-bit variants: + # $ ls /usr/include/asm/*_{32,64}.h + { include: [ "<asm/posix_types_32.h>", private, "<asm/posix_types.h>", public ] }, + { include: [ "<asm/posix_types_64.h>", private, "<asm/posix_types.h>", public ] }, + { include: [ "<asm/unistd_32.h>", private, "<asm/unistd.h>", private ] }, + { include: [ "<asm/unistd_64.h>", private, "<asm/unistd.h>", private ] }, + # I don't know what grep would have found these. I found them + # via user report. + { include: [ "<asm/errno.h>", private, "<errno.h>", public ] }, + { include: [ "<asm/errno-base.h>", private, "<errno.h>", public ] }, + { include: [ "<asm/ptrace-abi.h>", private, "<asm/ptrace.h>", public ] }, + { include: [ "<asm/unistd.h>", private, "<sys/syscall.h>", public ] }, + { include: [ "<linux/limits.h>", private, "<limits.h>", public ] }, # PATH_MAX + { include: [ "<linux/prctl.h>", private, "<sys/prctl.h>", public ] }, + { include: [ "<sys/ucontext.h>", private, "<ucontext.h>", public ] }, + # Exports guaranteed by the C standard + { include: [ "<stdint.h>", public, "<inttypes.h>", public ] }, +] + +# vim: set ft=toml: diff --git a/cmake.config/iwyu/gcc.symbols.imp b/cmake.config/iwyu/gcc.symbols.imp @@ -0,0 +1,305 @@ +# This was initially taken from the IWYU repository: +# github.com/include-what-you-use/include-what-you-use/blob/164b8fe7597805ae55f029ecf6580dc46a74c7ed/gcc.symbols.imp +# It has useful mappings that are normally enabled by default, but there are +# other default mappings that conflict with our builds. The best solution seems +# to be to disable all defaults, import the defaults from the IWYU repo and +# modify the rules that conflict with our build. +# +# TODO(dundargoc): Check if there is a way to disable specific builtin maps as +# to avoid this file entirely. + +# For library symbols that can be defined in more than one header +# file, maps from symbol-name to legitimate header files. +# This list was generated via +# grep -R '__.*_defined' /usr/include | perl -nle 'm,/usr/include/([^:]*):#\s*\S+ __(.*)_defined, and print qq@ { symbol: [ "$2", public, "<$1>", public ] },@' | sort -u +# I ignored all entries that only appeared once on the list (eg uint32_t). +# I then added in NULL, which according to [diff.null] C.2.2.3, can +# be defined in <clocale>, <cstddef>, <cstdio>, <cstdlib>, +# <cstring>, <ctime>, or <cwchar>. We also allow their C +# equivalents. +# In each case, I ordered them so <sys/types.h> was first, if it was +# an option for this type. That's the preferred #include all else +# equal. The same goes for <stdint.h>. The visibility on the +# symbol-name is ignored; by convention we always set it to private. +[ + { symbol: [ "aiocb", private, "<aio.h>", public ] }, + { symbol: [ "blkcnt_t", private, "<sys/types.h>", public ] }, + { symbol: [ "blkcnt_t", private, "<sys/stat.h>", public ] }, + { symbol: [ "blksize_t", private, "<sys/types.h>", public ] }, + { symbol: [ "blksize_t", private, "<sys/stat.h>", public ] }, + { symbol: [ "cc_t", private, "<termios.h>", private ] }, + { symbol: [ "clock_t", private, "<sys/types.h>", public ] }, + { symbol: [ "clock_t", private, "<sys/time.h>", public ] }, + { symbol: [ "clock_t", private, "<time.h>", public ] }, + { symbol: [ "clockid_t", private, "<sys/types.h>", public ] }, + { symbol: [ "clockid_t", private, "<time.h>", public ] }, + { symbol: [ "daddr_t", private, "<sys/types.h>", public ] }, + { symbol: [ "daddr_t", private, "<rpc/types.h>", public ] }, + { symbol: [ "dev_t", private, "<sys/types.h>", public ] }, + { symbol: [ "dev_t", private, "<sys/stat.h>", public ] }, + { symbol: [ "div_t", private, "<stdlib.h>", public ] }, + { symbol: [ "double_t", private, "<math.h>", public ] }, + { symbol: [ "error_t", private, "<errno.h>", public ] }, + { symbol: [ "error_t", private, "<argp.h>", public ] }, + { symbol: [ "error_t", private, "<argz.h>", public ] }, + { symbol: [ "fd_set", private, "<sys/select.h>", public ] }, + { symbol: [ "fd_set", private, "<sys/time.h>", public ] }, + { symbol: [ "fenv_t", private, "<fenv.h>", public ] }, + { symbol: [ "fexcept_t", private, "<fenv.h>", public ] }, + { symbol: [ "FILE", private, "<stdio.h>", public ] }, + { symbol: [ "FILE", private, "<wchar.h>", public ] }, + { symbol: [ "float_t", private, "<math.h>", public ] }, + { symbol: [ "fsblkcnt_t", private, "<sys/types.h>", public ] }, + { symbol: [ "fsblkcnt_t", private, "<sys/statvfs.h>", public ] }, + { symbol: [ "fsfilcnt_t", private, "<sys/types.h>", public ] }, + { symbol: [ "fsfilcnt_t", private, "<sys/statvfs.h>", public ] }, + { symbol: [ "getopt", private, "<unistd.h>", private ] }, + { symbol: [ "gid_t", private, "<sys/types.h>", public ] }, + { symbol: [ "gid_t", private, "<grp.h>", public ] }, + { symbol: [ "gid_t", private, "<pwd.h>", public ] }, + { symbol: [ "gid_t", private, "<signal.h>", public ] }, + { symbol: [ "gid_t", private, "<stropts.h>", public ] }, + { symbol: [ "gid_t", private, "<sys/ipc.h>", public ] }, + { symbol: [ "gid_t", private, "<sys/stat.h>", public ] }, + { symbol: [ "gid_t", private, "<unistd.h>", private ] }, + { symbol: [ "htonl", private, "<arpa/inet.h>", private ] }, + { symbol: [ "htons", private, "<arpa/inet.h>", private ] }, + { symbol: [ "id_t", private, "<sys/types.h>", public ] }, + { symbol: [ "id_t", private, "<sys/resource.h>", public ] }, + { symbol: [ "imaxdiv_t", private, "<inttypes.h>", public ] }, + { symbol: [ "intmax_t", private, "<stdint.h>", public ] }, + { symbol: [ "uintmax_t", private, "<stdint.h>", public ] }, + { symbol: [ "ino64_t", private, "<sys/types.h>", public ] }, + { symbol: [ "ino64_t", private, "<dirent.h>", public ] }, + { symbol: [ "ino_t", private, "<sys/types.h>", public ] }, + { symbol: [ "ino_t", private, "<dirent.h>", public ] }, + { symbol: [ "ino_t", private, "<sys/stat.h>", public ] }, + { symbol: [ "int8_t", private, "<stdint.h>", public ] }, + { symbol: [ "int16_t", private, "<stdint.h>", public ] }, + { symbol: [ "int32_t", private, "<stdint.h>", public ] }, + { symbol: [ "int64_t", private, "<stdint.h>", public ] }, + { symbol: [ "uint8_t", private, "<stdint.h>", public ] }, + { symbol: [ "uint16_t", private, "<stdint.h>", public ] }, + { symbol: [ "uint32_t", private, "<stdint.h>", public ] }, + { symbol: [ "uint64_t", private, "<stdint.h>", public ] }, + { symbol: [ "intptr_t", private, "<stdint.h>", public ] }, + { symbol: [ "uintptr_t", private, "<stdint.h>", public ] }, + { symbol: [ "iovec", private, "<sys/uio.h>", public ] }, + { symbol: [ "iovec", private, "<sys/socket.h>", private ] }, + { symbol: [ "itimerspec", private, "<time.h>", public ] }, + { symbol: [ "itimerspec", private, "<sys/timerfd.h>", public ] }, + { symbol: [ "key_t", private, "<sys/types.h>", public ] }, + { symbol: [ "key_t", private, "<sys/ipc.h>", public ] }, + { symbol: [ "lconv", private, "<locale.h>", public ] }, + { symbol: [ "ldiv_t", private, "<stdlib.h>", public ] }, + { symbol: [ "lldiv_t", private, "<stdlib.h>", public ] }, + { symbol: [ "max_align_t", private, "<stddef.h>", public ] }, + { symbol: [ "mode_t", private, "<sys/types.h>", public ] }, + { symbol: [ "mode_t", private, "<fcntl.h>", public ] }, + { symbol: [ "mode_t", private, "<ndbm.h>", public ] }, + { symbol: [ "mode_t", private, "<spawn.h>", public ] }, + { symbol: [ "mode_t", private, "<sys/ipc.h>", public ] }, + { symbol: [ "mode_t", private, "<sys/mman.h>", public ] }, + { symbol: [ "mode_t", private, "<sys/stat.h>", public ] }, + { symbol: [ "nlink_t", private, "<sys/types.h>", public ] }, + { symbol: [ "nlink_t", private, "<sys/stat.h>", public ] }, + { symbol: [ "ntohl", private, "<arpa/inet.h>", private ] }, + { symbol: [ "ntohs", private, "<arpa/inet.h>", private ] }, + { symbol: [ "off64_t", private, "<sys/types.h>", public ] }, + { symbol: [ "off64_t", private, "<unistd.h>", private ] }, + { symbol: [ "off_t", private, "<sys/types.h>", public ] }, + { symbol: [ "off_t", private, "<aio.h>", public ] }, + { symbol: [ "off_t", private, "<fcntl.h>", public ] }, + { symbol: [ "off_t", private, "<stdio.h>", public ] }, + { symbol: [ "off_t", private, "<sys/mman.h>", public ] }, + { symbol: [ "off_t", private, "<sys/stat.h>", public ] }, + { symbol: [ "off_t", private, "<unistd.h>", private ] }, + { symbol: [ "optarg", private, "<unistd.h>", private ] }, + { symbol: [ "opterr", private, "<unistd.h>", private ] }, + { symbol: [ "optind", private, "<unistd.h>", private ] }, + { symbol: [ "optopt", private, "<unistd.h>", private ] }, + { symbol: [ "pid_t", private, "<sys/types.h>", public ] }, + { symbol: [ "pid_t", private, "<fcntl.h>", public ] }, + { symbol: [ "pid_t", private, "<sched.h>", public ] }, + { symbol: [ "pid_t", private, "<signal.h>", public ] }, + { symbol: [ "pid_t", private, "<spawn.h>", public ] }, + { symbol: [ "pid_t", private, "<sys/msg.h>", public ] }, + { symbol: [ "pid_t", private, "<sys/sem.h>", public ] }, + { symbol: [ "pid_t", private, "<sys/shm.h>", public ] }, + { symbol: [ "pid_t", private, "<sys/wait.h>", public ] }, + { symbol: [ "pid_t", private, "<termios.h>", private ] }, + { symbol: [ "pid_t", private, "<time.h>", public ] }, + { symbol: [ "pid_t", private, "<unistd.h>", private ] }, + { symbol: [ "pid_t", private, "<utmpx.h>", public ] }, + { symbol: [ "ptrdiff_t", private, "<stddef.h>", public ] }, + { symbol: [ "regex_t", private, "<regex.h>", public ] }, + { symbol: [ "regmatch_t", private, "<regex.h>", public ] }, + { symbol: [ "regoff_t", private, "<regex.h>", public ] }, + { symbol: [ "sigevent", private, "<signal.h>", public ] }, + { symbol: [ "sigevent", private, "<aio.h>", public ] }, + { symbol: [ "sigevent", private, "<mqueue.h>", public ] }, + { symbol: [ "sigevent", private, "<time.h>", public ] }, + { symbol: [ "siginfo_t", private, "<signal.h>", public ] }, + { symbol: [ "siginfo_t", private, "<sys/wait.h>", public ] }, + { symbol: [ "sigset_t", private, "<signal.h>", public ] }, + { symbol: [ "sigset_t", private, "<spawn.h>", public ] }, + { symbol: [ "sigset_t", private, "<sys/select.h>", public ] }, + { symbol: [ "sigval", private, "<signal.h>", public ] }, + { symbol: [ "sockaddr", private, "<sys/socket.h>", private ] }, + { symbol: [ "socklen_t", private, "<sys/socket.h>", private ] }, + { symbol: [ "socklen_t", private, "<netdb.h>", private ] }, + { symbol: [ "ssize_t", private, "<sys/types.h>", public ] }, + { symbol: [ "ssize_t", private, "<aio.h>", public ] }, + { symbol: [ "ssize_t", private, "<monetary.h>", public ] }, + { symbol: [ "ssize_t", private, "<mqueue.h>", public ] }, + { symbol: [ "ssize_t", private, "<stdio.h>", public ] }, + { symbol: [ "ssize_t", private, "<sys/msg.h>", public ] }, + { symbol: [ "ssize_t", private, "<sys/socket.h>", private ] }, + { symbol: [ "ssize_t", private, "<sys/uio.h>", public ] }, + { symbol: [ "ssize_t", private, "<unistd.h>", private ] }, + { symbol: [ "stat", private, "<sys/stat.h>", public ] }, + { symbol: [ "stat", private, "<ftw.h>", public ] }, + { symbol: [ "suseconds_t", private, "<sys/types.h>", public ] }, + { symbol: [ "suseconds_t", private, "<sys/select.h>", public ] }, + { symbol: [ "suseconds_t", private, "<sys/time.h>", public ] }, + { symbol: [ "time_t", private, "<time.h>", public ] }, + { symbol: [ "time_t", private, "<sched.h>", public ] }, + { symbol: [ "time_t", private, "<sys/msg.h>", public ] }, + { symbol: [ "time_t", private, "<sys/select.h>", public ] }, + { symbol: [ "time_t", private, "<sys/sem.h>", public ] }, + { symbol: [ "time_t", private, "<sys/shm.h>", public ] }, + { symbol: [ "time_t", private, "<sys/stat.h>", public ] }, + { symbol: [ "time_t", private, "<sys/time.h>", public ] }, + { symbol: [ "time_t", private, "<sys/types.h>", public ] }, + { symbol: [ "time_t", private, "<utime.h>", public ] }, + { symbol: [ "timer_t", private, "<sys/types.h>", public ] }, + { symbol: [ "timer_t", private, "<time.h>", public ] }, + { symbol: [ "timespec", private, "<time.h>", public ] }, + { symbol: [ "timespec", private, "<aio.h>", public ] }, + { symbol: [ "timespec", private, "<mqueue.h>", public ] }, + { symbol: [ "timespec", private, "<sched.h>", public ] }, + { symbol: [ "timespec", private, "<signal.h>", public ] }, + { symbol: [ "timespec", private, "<sys/select.h>", public ] }, + { symbol: [ "timespec", private, "<sys/stat.h>", public ] }, + { symbol: [ "timeval", private, "<sys/time.h>", public ] }, + { symbol: [ "timeval", private, "<sys/resource.h>", public ] }, + { symbol: [ "timeval", private, "<sys/select.h>", public ] }, + { symbol: [ "timeval", private, "<utmpx.h>", public ] }, + { symbol: [ "tm", private, "<time.h>", public ] }, + { symbol: [ "u_char", private, "<sys/types.h>", public ] }, + { symbol: [ "u_char", private, "<rpc/types.h>", public ] }, + { symbol: [ "uid_t", private, "<sys/types.h>", public ] }, + { symbol: [ "uid_t", private, "<pwd.h>", public ] }, + { symbol: [ "uid_t", private, "<signal.h>", public ] }, + { symbol: [ "uid_t", private, "<stropts.h>", public ] }, + { symbol: [ "uid_t", private, "<sys/ipc.h>", public ] }, + { symbol: [ "uid_t", private, "<sys/stat.h>", public ] }, + { symbol: [ "uid_t", private, "<unistd.h>", private ] }, + { symbol: [ "useconds_t", private, "<sys/types.h>", public ] }, + { symbol: [ "useconds_t", private, "<unistd.h>", private ] }, + { symbol: [ "wchar_t", private, "<stddef.h>", public ] }, + { symbol: [ "wchar_t", private, "<stdlib.h>", public ] }, + { symbol: [ "size_t", private, "<stddef.h>", public ] }, + { symbol: [ "size_t", private, "<aio.h>", public ] }, + { symbol: [ "size_t", private, "<glob.h>", public ] }, + { symbol: [ "size_t", private, "<grp.h>", public ] }, + { symbol: [ "size_t", private, "<iconv.h>", public ] }, + { symbol: [ "size_t", private, "<monetary.h>", public ] }, + { symbol: [ "size_t", private, "<mqueue.h>", public ] }, + { symbol: [ "size_t", private, "<ndbm.h>", public ] }, + { symbol: [ "size_t", private, "<pwd.h>", public ] }, + { symbol: [ "size_t", private, "<regex.h>", public ] }, + { symbol: [ "size_t", private, "<search.h>", public ] }, + { symbol: [ "size_t", private, "<signal.h>", public ] }, + { symbol: [ "size_t", private, "<stdio.h>", public ] }, + { symbol: [ "size_t", private, "<stdlib.h>", public ] }, + { symbol: [ "size_t", private, "<string.h>", public ] }, + { symbol: [ "size_t", private, "<strings.h>", public ] }, + { symbol: [ "size_t", private, "<sys/mman.h>", public ] }, + { symbol: [ "size_t", private, "<sys/msg.h>", public ] }, + { symbol: [ "size_t", private, "<sys/sem.h>", public ] }, + { symbol: [ "size_t", private, "<sys/shm.h>", public ] }, + { symbol: [ "size_t", private, "<sys/socket.h>", private ] }, + { symbol: [ "size_t", private, "<sys/types.h>", public ] }, + { symbol: [ "size_t", private, "<sys/uio.h>", public ] }, + { symbol: [ "size_t", private, "<time.h>", public ] }, + { symbol: [ "size_t", private, "<uchar.h>", public ] }, + { symbol: [ "size_t", private, "<unistd.h>", private ] }, + { symbol: [ "size_t", private, "<wchar.h>", public ] }, + { symbol: [ "size_t", private, "<wordexp.h>", public ] }, + # Macros that can be defined in more than one file, don't have the + # same __foo_defined guard that other types do, so the grep above + # doesn't discover them. Until I figure out a better way, I just + # add them in by hand as I discover them. + { symbol: [ "EOF", private, "<stdio.h>", public ] }, + { symbol: [ "EOF", private, "<libio.h>", public ] }, + { symbol: [ "FILE", private, "<stdio.h>", public ] }, + { symbol: [ "MAP_POPULATE", private, "<sys/mman.h>", public ] }, + { symbol: [ "MAP_POPULATE", private, "<linux/mman.h>", public ] }, + { symbol: [ "MAP_STACK", private, "<sys/mman.h>", public ] }, + { symbol: [ "MAP_STACK", private, "<linux/mman.h>", public ] }, + { symbol: [ "MAXHOSTNAMELEN", private, "<sys/param.h>", public ] }, + { symbol: [ "MAXHOSTNAMELEN", private, "<protocols/timed.h>", public ] }, + { symbol: [ "SIGABRT", private, "<signal.h>", public ] }, + { symbol: [ "SIGCHLD", private, "<signal.h>", public ] }, + { symbol: [ "SIGCHLD", private, "<linux/signal.h>", public ] }, + { symbol: [ "va_list", private, "<stdarg.h>", public ] }, + { symbol: [ "va_list", private, "<stdio.h>", public ] }, + { symbol: [ "va_list", private, "<wchar.h>", public ] }, + # These are symbols that could be defined in either stdlib.h or + # malloc.h, but we always want the stdlib location. + { symbol: [ "malloc", private, "<stdlib.h>", public ] }, + { symbol: [ "calloc", private, "<stdlib.h>", public ] }, + { symbol: [ "realloc", private, "<stdlib.h>", public ] }, + { symbol: [ "free", private, "<stdlib.h>", public ] }, + # Entries for NULL + { symbol: [ "NULL", private, "<stddef.h>", public ] }, # 'canonical' location for NULL + { symbol: [ "NULL", private, "<clocale>", public ] }, + { symbol: [ "NULL", private, "<cstddef>", public ] }, + { symbol: [ "NULL", private, "<cstdio>", public ] }, + { symbol: [ "NULL", private, "<cstdlib>", public ] }, + { symbol: [ "NULL", private, "<cstring>", public ] }, + { symbol: [ "NULL", private, "<ctime>", public ] }, + { symbol: [ "NULL", private, "<cwchar>", public ] }, + { symbol: [ "NULL", private, "<locale.h>", public ] }, + { symbol: [ "NULL", private, "<stdio.h>", public ] }, + { symbol: [ "NULL", private, "<stdlib.h>", public ] }, + { symbol: [ "NULL", private, "<string.h>", public ] }, + { symbol: [ "NULL", private, "<time.h>", public ] }, + { symbol: [ "NULL", private, "<unistd.h>", private ] }, + { symbol: [ "NULL", private, "<wchar.h>", public ] }, + + # Kludge time: almost all STL types take an allocator, but they + # almost always use the default value. Usually we detect that + # and don't try to do IWYU, but sometimes it passes through. + # For instance, when adding two strings, we end up calling + # template<_CharT,_Traits,_Alloc> ... operator+( + # basic_string<_CharT,_Traits,_Alloc>, ...) + # These look like normal template args to us, so we see they're + # used and declare an iwyu dependency, even though we don't need + # to #include the traits or alloc type ourselves. The surest way + # to deal with this is to just say that everyone provides + # std::allocator. We can add more here at need. + { symbol: [ "std::allocator", private, "<memory>", public ] }, + { symbol: [ "std::allocator", private, "<string>", public ] }, + { symbol: [ "std::allocator", private, "<vector>", public ] }, + { symbol: [ "std::allocator", private, "<map>", public ] }, + { symbol: [ "std::allocator", private, "<set>", public ] }, + # A similar kludge for std::char_traits. basic_string, + # basic_ostream and basic_istream have this as a default template + # argument, and sometimes it bleeds through when clang desugars the + # string/ostream/istream type. + { symbol: [ "std::char_traits", private, "<string>", public ] }, + { symbol: [ "std::char_traits", private, "<ostream>", public ] }, + { symbol: [ "std::char_traits", private, "<istream>", public ] }, + + { symbol: [ "std::size_t", private, "<cstddef>", public ] }, + { symbol: [ "std::size_t", private, "<cstdio>", public ] }, + { symbol: [ "std::size_t", private, "<cstdlib>", public ] }, + { symbol: [ "std::size_t", private, "<cstring>", public ] }, + { symbol: [ "std::size_t", private, "<ctime>", public ] }, + { symbol: [ "std::size_t", private, "<cuchar>", public ] }, + { symbol: [ "std::size_t", private, "<cwchar>", public ] } +] + +# vim: set ft=toml: diff --git a/cmake.config/iwyu/mapping.imp b/cmake.config/iwyu/mapping.imp @@ -0,0 +1,236 @@ +[ + # Generated to normal headers: header.h.generated.h -> nvim/header.h + { include: [ '"api/autocmd.h.generated.h"', private, '"nvim/api/autocmd.h"', public ] }, + { include: [ '"api/buffer.h.generated.h"', private, '"nvim/api/buffer.h"', public ] }, + { include: [ '"api/command.h.generated.h"', private, '"nvim/api/command.h"', public ] }, + { include: [ '"api/deprecated.h.generated.h"', private, '"nvim/api/deprecated.h"', public ] }, + { include: [ '"api/extmark.h.generated.h"', private, '"nvim/api/extmark.h"', public ] }, + { include: [ '"api/options.h.generated.h"', private, '"nvim/api/options.h"', public ] }, + { include: [ '"api/private/converter.h.generated.h"', private, '"nvim/api/private/converter.h"', public ] }, + { include: [ '"api/private/dispatch.h.generated.h"', private, '"nvim/api/private/dispatch.h"', public ] }, + { include: [ '"api/private/helpers.h.generated.h"', private, '"nvim/api/private/helpers.h"', public ] }, + { include: [ '"api/tabpage.h.generated.h"', private, '"nvim/api/tabpage.h"', public ] }, + { include: [ '"api/ui.h.generated.h"', private, '"nvim/api/ui.h"', public ] }, + { include: [ '"api/vim.h.generated.h"', private, '"nvim/api/vim.h"', public ] }, + { include: [ '"api/vimscript.h.generated.h"', private, '"nvim/api/vimscript.h"', public ] }, + { include: [ '"api/win_config.h.generated.h"', private, '"nvim/api/win_config.h"', public ] }, + { include: [ '"api/window.h.generated.h"', private, '"nvim/api/window.h"', public ] }, + { include: [ '"arabic.h.generated.h"', private, '"nvim/arabic.h"', public ] }, + { include: [ '"arglist.h.generated.h"', private, '"nvim/arglist.h"', public ] }, + { include: [ '"autocmd.h.generated.h"', private, '"nvim/autocmd.h"', public ] }, + { include: [ '"buffer.h.generated.h"', private, '"nvim/buffer.h"', public ] }, + { include: [ '"buffer_updates.h.generated.h"', private, '"nvim/buffer_updates.h"', public ] }, + { include: [ '"change.h.generated.h"', private, '"nvim/change.h"', public ] }, + { include: [ '"channel.h.generated.h"', private, '"nvim/channel.h"', public ] }, + { include: [ '"charset.h.generated.h"', private, '"nvim/charset.h"', public ] }, + { include: [ '"cmdexpand.h.generated.h"', private, '"nvim/cmdexpand.h"', public ] }, + { include: [ '"cmdhist.h.generated.h"', private, '"nvim/cmdhist.h"', public ] }, + { include: [ '"context.h.generated.h"', private, '"nvim/context.h"', public ] }, + { include: [ '"cursor.h.generated.h"', private, '"nvim/cursor.h"', public ] }, + { include: [ '"cursor_shape.h.generated.h"', private, '"nvim/cursor_shape.h"', public ] }, + { include: [ '"debugger.h.generated.h"', private, '"nvim/debugger.h"', public ] }, + { include: [ '"decoration.h.generated.h"', private, '"nvim/decoration.h"', public ] }, + { include: [ '"decoration_provider.h.generated.h"', private, '"nvim/decoration_provider.h"', public ] }, + { include: [ '"diff.h.generated.h"', private, '"nvim/diff.h"', public ] }, + { include: [ '"digraph.h.generated.h"', private, '"nvim/digraph.h"', public ] }, + { include: [ '"drawline.h.generated.h"', private, '"nvim/drawline.h"', public ] }, + { include: [ '"drawscreen.h.generated.h"', private, '"nvim/drawscreen.h"', public ] }, + { include: [ '"edit.h.generated.h"', private, '"nvim/edit.h"', public ] }, + { include: [ '"eval.h.generated.h"', private, '"nvim/eval.h"', public ] }, + { include: [ '"eval/decode.h.generated.h"', private, '"nvim/eval/decode.h"', public ] }, + { include: [ '"eval/encode.h.generated.h"', private, '"nvim/eval/encode.h"', public ] }, + { include: [ '"eval/executor.h.generated.h"', private, '"nvim/eval/executor.h"', public ] }, + { include: [ '"eval/funcs.h.generated.h"', private, '"nvim/eval/funcs.h"', public ] }, + { include: [ '"eval/typval.h.generated.h"', private, '"nvim/eval/typval.h"', public ] }, + { include: [ '"eval/userfunc.h.generated.h"', private, '"nvim/eval/userfunc.h"', public ] }, + { include: [ '"eval/vars.h.generated.h"', private, '"nvim/eval/vars.h"', public ] }, + { include: [ '"event/libuv_process.h.generated.h"', private, '"nvim/event/libuv_process.h"', public ] }, + { include: [ '"event/loop.h.generated.h"', private, '"nvim/event/loop.h"', public ] }, + { include: [ '"event/multiqueue.h.generated.h"', private, '"nvim/event/multiqueue.h"', public ] }, + { include: [ '"event/process.h.generated.h"', private, '"nvim/event/process.h"', public ] }, + { include: [ '"event/rstream.h.generated.h"', private, '"nvim/event/rstream.h"', public ] }, + { include: [ '"event/signal.h.generated.h"', private, '"nvim/event/signal.h"', public ] }, + { include: [ '"event/socket.h.generated.h"', private, '"nvim/event/socket.h"', public ] }, + { include: [ '"event/stream.h.generated.h"', private, '"nvim/event/stream.h"', public ] }, + { include: [ '"event/time.h.generated.h"', private, '"nvim/event/time.h"', public ] }, + { include: [ '"event/wstream.h.generated.h"', private, '"nvim/event/wstream.h"', public ] }, + { include: [ '"ex_cmds.h.generated.h"', private, '"nvim/ex_cmds.h"', public ] }, + { include: [ '"ex_cmds2.h.generated.h"', private, '"nvim/ex_cmds2.h"', public ] }, + { include: [ '"ex_docmd.h.generated.h"', private, '"nvim/ex_docmd.h"', public ] }, + { include: [ '"ex_eval.h.generated.h"', private, '"nvim/ex_eval.h"', public ] }, + { include: [ '"ex_getln.h.generated.h"', private, '"nvim/ex_getln.h"', public ] }, + { include: [ '"ex_session.h.generated.h"', private, '"nvim/ex_session.h"', public ] }, + { include: [ '"extmark.h.generated.h"', private, '"nvim/extmark.h"', public ] }, + { include: [ '"file_search.h.generated.h"', private, '"nvim/file_search.h"', public ] }, + { include: [ '"fileio.h.generated.h"', private, '"nvim/fileio.h"', public ] }, + { include: [ '"fold.h.generated.h"', private, '"nvim/fold.h"', public ] }, + { include: [ '"garray.h.generated.h"', private, '"nvim/garray.h"', public ] }, + { include: [ '"getchar.h.generated.h"', private, '"nvim/getchar.h"', public ] }, + { include: [ '"grid.h.generated.h"', private, '"nvim/grid.h"', public ] }, + { include: [ '"hardcopy.h.generated.h"', private, '"nvim/hardcopy.h"', public ] }, + { include: [ '"hashtab.h.generated.h"', private, '"nvim/hashtab.h"', public ] }, + { include: [ '"help.h.generated.h"', private, '"nvim/help.h"', public ] }, + { include: [ '"highlight.h.generated.h"', private, '"nvim/highlight.h"', public ] }, + { include: [ '"highlight_group.h.generated.h"', private, '"nvim/highlight_group.h"', public ] }, + { include: [ '"if_cscope.h.generated.h"', private, '"nvim/if_cscope.h"', public ] }, + { include: [ '"indent.h.generated.h"', private, '"nvim/indent.h"', public ] }, + { include: [ '"indent_c.h.generated.h"', private, '"nvim/indent_c.h"', public ] }, + { include: [ '"input.h.generated.h"', private, '"nvim/input.h"', public ] }, + { include: [ '"insexpand.h.generated.h"', private, '"nvim/insexpand.h"', public ] }, + { include: [ '"keycodes.h.generated.h"', private, '"nvim/keycodes.h"', public ] }, + { include: [ '"linematch.h.generated.h"', private, '"nvim/linematch.h"', public ] }, + { include: [ '"locale.h.generated.h"', private, '"nvim/locale.h"', public ] }, + { include: [ '"log.h.generated.h"', private, '"nvim/log.h"', public ] }, + { include: [ '"lua/converter.h.generated.h"', private, '"nvim/lua/converter.h"', public ] }, + { include: [ '"lua/executor.h.generated.h"', private, '"nvim/lua/executor.h"', public ] }, + { include: [ '"lua/spell.h.generated.h"', private, '"nvim/lua/spell.h"', public ] }, + { include: [ '"lua/stdlib.h.generated.h"', private, '"nvim/lua/stdlib.h"', public ] }, + { include: [ '"lua/treesitter.h.generated.h"', private, '"nvim/lua/treesitter.h"', public ] }, + { include: [ '"lua/xdiff.h.generated.h"', private, '"nvim/lua/xdiff.h"', public ] }, + { include: [ '"main.h.generated.h"', private, '"nvim/main.h"', public ] }, + { include: [ '"mapping.h.generated.h"', private, '"nvim/mapping.h"', public ] }, + { include: [ '"mark.h.generated.h"', private, '"nvim/mark.h"', public ] }, + { include: [ '"marktree.h.generated.h"', private, '"nvim/marktree.h"', public ] }, + { include: [ '"match.h.generated.h"', private, '"nvim/match.h"', public ] }, + { include: [ '"math.h.generated.h"', private, '"nvim/math.h"', public ] }, + { include: [ '"mbyte.h.generated.h"', private, '"nvim/mbyte.h"', public ] }, + { include: [ '"memfile.h.generated.h"', private, '"nvim/memfile.h"', public ] }, + { include: [ '"memline.h.generated.h"', private, '"nvim/memline.h"', public ] }, + { include: [ '"memory.h.generated.h"', private, '"nvim/memory.h"', public ] }, + { include: [ '"menu.h.generated.h"', private, '"nvim/menu.h"', public ] }, + { include: [ '"message.h.generated.h"', private, '"nvim/message.h"', public ] }, + { include: [ '"mouse.h.generated.h"', private, '"nvim/mouse.h"', public ] }, + { include: [ '"move.h.generated.h"', private, '"nvim/move.h"', public ] }, + { include: [ '"msgpack_rpc/channel.h.generated.h"', private, '"nvim/msgpack_rpc/channel.h"', public ] }, + { include: [ '"msgpack_rpc/helpers.h.generated.h"', private, '"nvim/msgpack_rpc/helpers.h"', public ] }, + { include: [ '"msgpack_rpc/server.h.generated.h"', private, '"nvim/msgpack_rpc/server.h"', public ] }, + { include: [ '"msgpack_rpc/unpacker.h.generated.h"', private, '"nvim/msgpack_rpc/unpacker.h"', public ] }, + { include: [ '"normal.h.generated.h"', private, '"nvim/normal.h"', public ] }, + { include: [ '"ops.h.generated.h"', private, '"nvim/ops.h"', public ] }, + { include: [ '"option.h.generated.h"', private, '"nvim/option.h"', public ] }, + { include: [ '"optionstr.h.generated.h"', private, '"nvim/optionstr.h"', public ] }, + { include: [ '"os/dl.h.generated.h"', private, '"nvim/os/dl.h"', public ] }, + { include: [ '"os/fileio.h.generated.h"', private, '"nvim/os/fileio.h"', public ] }, + { include: [ '"os/fs.h.generated.h"', private, '"nvim/os/fs.h"', public ] }, + { include: [ '"os/input.h.generated.h"', private, '"nvim/os/input.h"', public ] }, + { include: [ '"os/lang.h.generated.h"', private, '"nvim/os/lang.h"', public ] }, + { include: [ '"os/process.h.generated.h"', private, '"nvim/os/process.h"', public ] }, + { include: [ '"os/pty_process_unix.h.generated.h"', private, '"nvim/os/pty_process_unix.h"', private ] }, + { include: [ '"os/shell.h.generated.h"', private, '"nvim/os/shell.h"', public ] }, + { include: [ '"os/signal.h.generated.h"', private, '"nvim/os/signal.h"', public ] }, + { include: [ '"os/time.h.generated.h"', private, '"nvim/os/time.h"', public ] }, + { include: [ '"os_unix.h.generated.h"', private, '"nvim/os_unix.h"', public ] }, + { include: [ '"path.h.generated.h"', private, '"nvim/path.h"', public ] }, + { include: [ '"plines.h.generated.h"', private, '"nvim/plines.h"', public ] }, + { include: [ '"popupmenu.h.generated.h"', private, '"nvim/popupmenu.h"', public ] }, + { include: [ '"profile.h.generated.h"', private, '"nvim/profile.h"', public ] }, + { include: [ '"quickfix.h.generated.h"', private, '"nvim/quickfix.h"', public ] }, + { include: [ '"rbuffer.h.generated.h"', private, '"nvim/rbuffer.h"', public ] }, + { include: [ '"regexp.h.generated.h"', private, '"nvim/regexp.h"', public ] }, + { include: [ '"runtime.h.generated.h"', private, '"nvim/runtime.h"', public ] }, + { include: [ '"screen.h.generated.h"', private, '"nvim/screen.h"', public ] }, + { include: [ '"search.h.generated.h"', private, '"nvim/search.h"', public ] }, + { include: [ '"sha256.h.generated.h"', private, '"nvim/sha256.h"', public ] }, + { include: [ '"shada.h.generated.h"', private, '"nvim/shada.h"', public ] }, + { include: [ '"sign.h.generated.h"', private, '"nvim/sign.h"', public ] }, + { include: [ '"spell.h.generated.h"', private, '"nvim/spell.h"', public ] }, + { include: [ '"spellfile.h.generated.h"', private, '"nvim/spellfile.h"', public ] }, + { include: [ '"spellsuggest.h.generated.h"', private, '"nvim/spellsuggest.h"', public ] }, + { include: [ '"state.h.generated.h"', private, '"nvim/state.h"', public ] }, + { include: [ '"statusline.h.generated.h"', private, '"nvim/statusline.h"', public ] }, + { include: [ '"strings.h.generated.h"', private, '"nvim/strings.h"', public ] }, + { include: [ '"syntax.h.generated.h"', private, '"nvim/syntax.h"', public ] }, + { include: [ '"tag.h.generated.h"', private, '"nvim/tag.h"', public ] }, + { include: [ '"terminal.h.generated.h"', private, '"nvim/terminal.h"', public ] }, + { include: [ '"testing.h.generated.h"', private, '"nvim/testing.h"', public ] }, + { include: [ '"textformat.h.generated.h"', private, '"nvim/textformat.h"', public ] }, + { include: [ '"textobject.h.generated.h"', private, '"nvim/textobject.h"', public ] }, + { include: [ '"tui/input.h.generated.h"', private, '"nvim/tui/input.h"', public ] }, + { include: [ '"tui/terminfo.h.generated.h"', private, '"nvim/tui/terminfo.h"', public ] }, + { include: [ '"tui/tui.h.generated.h"', private, '"nvim/tui/tui.h"', public ] }, + { include: [ '"ugrid.h.generated.h"', private, '"nvim/ugrid.h"', public ] }, + { include: [ '"ui.h.generated.h"', private, '"nvim/ui.h"', public ] }, + { include: [ '"ui_bridge.h.generated.h"', private, '"nvim/ui_bridge.h"', public ] }, + { include: [ '"ui_client.h.generated.h"', private, '"nvim/ui_client.h"', public ] }, + { include: [ '"ui_compositor.h.generated.h"', private, '"nvim/ui_compositor.h"', public ] }, + { include: [ '"undo.h.generated.h"', private, '"nvim/undo.h"', public ] }, + { include: [ '"usercmd.h.generated.h"', private, '"nvim/usercmd.h"', public ] }, + { include: [ '"version.h.generated.h"', private, '"nvim/version.h"', public ] }, + { include: [ '"viml/parser/expressions.h.generated.h"', private, '"nvim/viml/parser/expressions.h"', public ] }, + { include: [ '"viml/parser/parser.h.generated.h"', private, '"nvim/viml/parser/parser.h"', public ] }, + { include: [ '"window.h.generated.h"', private, '"nvim/window.h"', public ] }, + + # Generated to normal headers with a different name: header.h.generated.h -> nvim/some_other_header.h + { include: [ '"api/private/dispatch_wrappers.h.generated.h"', private, '"nvim/api/private/dispatch.h"', public ] }, + { include: [ '"auevents_enum.generated.h"', private, '"nvim/autocmd.h"', public ] }, + { include: [ '"ex_cmds_enum.generated.h"', private, '"nvim/ex_cmds_defs.h"', public ] }, + { include: [ '"keysets.h.generated.h"', private, '"nvim/api/private/helpers.h"', public ] }, + { include: [ '"keysets_defs.generated.h"', private, '"nvim/api/private/defs.h"', public ] }, + { include: [ '"nvim/os/pty_process_unix.h"', private, '"nvim/os/pty_process.h"', public ] }, + { include: [ '"nvim/os/pty_process_win.h"', private, '"nvim/os/pty_process.h"', public ] }, + { include: [ '"nvim/os/unix_defs.h"', private, '"nvim/os/os_defs.h"', public ] }, + { include: [ '"nvim/os/win_defs.h"', private, '"nvim/os/os_defs.h"', public ] }, + { include: [ '"os/env.h.generated.h"', private, '"nvim/os/os.h"', public ] }, + { include: [ '"os/fs.h.generated.h"', private, '"nvim/os/os.h"', public ] }, + { include: [ '"os/mem.h.generated.h"', private, '"nvim/os/os.h"', public ] }, + { include: [ '"os/stdpaths.h.generated.h"', private, '"nvim/os/os.h"', public ] }, + { include: [ '"os/users.h.generated.h"', private, '"nvim/os/os.h"', public ] }, + { include: [ '"regexp_bt.h.generated.h"', private, '"nvim/regexp.h"', public ] }, + { include: [ '"ui_events_call.h.generated.h"', private, '"nvim/ui.h"', public ] }, + { include: [ '"ui_events_client.h.generated.h"', private, '"nvim/ui_client.h"', public ] }, + + # Def to normal headers: nvim/header_defs.h -> nvim/header.h + # + # This is a public to public mapping, meaning that while IWYU can use the + # headers on the left, it will use the headers on the right if possible. This + # isn't explicitly mentioned in the IWYU docs, this is just my interpretation + # of its behavior. + { include: [ '"nvim/buffer_defs.h"', public, '"nvim/buffer.h"', public ] }, + { include: [ '"nvim/ex_cmds_defs.h"', public, '"nvim/ex_cmds.h"', public ] }, + { include: [ '"nvim/ex_eval_defs.h"', public, '"nvim/ex_eval.h"', public ] }, + { include: [ '"nvim/extmark_defs.h"', public, '"nvim/extmark.h"', public ] }, + { include: [ '"nvim/grid_defs.h"', public, '"nvim/grid.h"', public ] }, + { include: [ '"nvim/highlight_defs.h"', public, '"nvim/highlight.h"', public ] }, + { include: [ '"nvim/map_defs.h"', public, '"nvim/map.h"', public ] }, + { include: [ '"nvim/mark_defs.h"', public, '"nvim/mark.h"', public ] }, + { include: [ '"nvim/mbyte_defs.h"', public, '"nvim/mbyte.h"', public ] }, + { include: [ '"nvim/memfile_defs.h"', public, '"nvim/memfile.h"', public ] }, + { include: [ '"nvim/memline_defs.h"', public, '"nvim/memline.h"', public ] }, + { include: [ '"nvim/menu_defs.h"', public, '"nvim/menu.h"', public ] }, + { include: [ '"nvim/msgpack/channel_defs.h"', public, '"nvim/msgpack/channel.h"', public ] }, + { include: [ '"nvim/option_defs.h"', public, '"nvim/option.h"', public ] }, + { include: [ '"nvim/os/fs_defs.h"', public, '"nvim/os/fs.h"', public ] }, + { include: [ '"nvim/os/os_defs.h"', public, '"nvim/os/os.h"', public ] }, + { include: [ '"nvim/regexp_defs.h"', public, '"nvim/regexp.h"', public ] }, + { include: [ '"nvim/sign_defs.h"', public, '"nvim/sign.h"', public ] }, + { include: [ '"nvim/spell_defs.h"', public, '"nvim/spell.h"', public ] }, + { include: [ '"nvim/statusline_defs.h"', public, '"nvim/statusline.h"', public ] }, + { include: [ '"nvim/syntax_defs.h"', public, '"nvim/syntax.h"', public ] }, + { include: [ '"nvim/tui/input_defs.h"', public, '"nvim/tui/input.h"', public ] }, + { include: [ '"nvim/undo_defs.h"', public, '"nvim/undo.h"', public ] }, + + # Third party headers + { include: [ "<bits/types/wint_t.h>", private, "<wchar.h>", public ] }, + { include: [ '<arpa/inet.h>', private, '<uv/unix.h>', private ] }, + { include: [ '<bits/termios-c_cc.h>', private, '<termios.h>', private ] }, + { include: [ '<bits/termios-c_cflag.h>', private, '<termios.h>', private ] }, + { include: [ '<bits/termios-c_iflag.h>', private, '<termios.h>', private ] }, + { include: [ '<bits/termios-c_oflag.h>', private, '<termios.h>', private ] }, + { include: [ '<libintl.h>', private, '"nvim/gettext.h"', public ] }, + { include: [ '<netdb.h>', private, '<uv/unix.h>', private ] }, + { include: [ '<netinet/in.h>', private, '<uv/unix.h>', private ] }, + { include: [ '<pthread.h>', private, '"nvim/os/unix_defs.h"', private ] }, + { include: [ '<sys/socket.h>', private, '<uv/unix.h>', private ] }, + { include: [ '<termios.h>', private, '"nvim/os/unix_defs.h"', private ] }, + { include: [ '<unistd.h>', private, '"nvim/os/unix_defs.h"', private ] }, + { include: [ '<uv/unix.h>', private, '<uv.h>', public ] }, + + # Symbols + { symbol: [ "MAX", private, '"nvim/macros.h"', public ] }, + { symbol: [ "MIN", private, '"nvim/macros.h"', public ] }, + { symbol: [ "SEEK_END", private, '<stdio.h>', public ] }, + { symbol: [ "SEEK_SET", private, '<stdio.h>', public ] }, + { symbol: [ "time_fd", private, '"nvim/globals.h"', public ] }, +] + +# vim: set ft=toml: diff --git a/src/nvim/api/autocmd.c b/src/nvim/api/autocmd.c @@ -1,8 +1,12 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <assert.h> #include <stdbool.h> +#include <stdint.h> #include <stdio.h> +#include <stdlib.h> +#include <string.h> #include "lauxlib.h" #include "nvim/api/autocmd.h" @@ -12,7 +16,12 @@ #include "nvim/autocmd.h" #include "nvim/buffer.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/ex_cmds_defs.h" +#include "nvim/globals.h" #include "nvim/lua/executor.h" +#include "nvim/memory.h" +#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/autocmd.c.generated.h" diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c @@ -3,25 +3,30 @@ // Some of this code was adapted from 'if_py_both.h' from the original // vim source + +#include <assert.h> #include <lauxlib.h> -#include <limits.h> #include <stdbool.h> +#include <stddef.h> #include <stdint.h> -#include <stdlib.h> +#include <string.h> +#include "klib/kvec.h" +#include "lua.h" #include "nvim/api/buffer.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" +#include "nvim/ascii.h" #include "nvim/autocmd.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/buffer_updates.h" #include "nvim/change.h" #include "nvim/cursor.h" -#include "nvim/decoration.h" #include "nvim/drawscreen.h" #include "nvim/ex_cmds.h" -#include "nvim/ex_docmd.h" #include "nvim/extmark.h" +#include "nvim/globals.h" #include "nvim/lua/executor.h" #include "nvim/mapping.h" #include "nvim/mark.h" @@ -29,9 +34,10 @@ #include "nvim/memory.h" #include "nvim/move.h" #include "nvim/ops.h" +#include "nvim/pos.h" +#include "nvim/types.h" #include "nvim/undo.h" #include "nvim/vim.h" -#include "nvim/window.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/buffer.c.generated.h" diff --git a/src/nvim/api/command.c b/src/nvim/api/command.c @@ -1,21 +1,36 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <inttypes.h> #include <stdbool.h> -#include <stdint.h> -#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include "klib/kvec.h" +#include "lauxlib.h" #include "nvim/api/command.h" -#include "nvim/api/private/converter.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" +#include "nvim/ascii.h" #include "nvim/autocmd.h" +#include "nvim/buffer_defs.h" +#include "nvim/decoration.h" +#include "nvim/ex_cmds.h" #include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" +#include "nvim/garray.h" +#include "nvim/globals.h" #include "nvim/lua/executor.h" +#include "nvim/macros.h" +#include "nvim/mbyte.h" +#include "nvim/memory.h" #include "nvim/ops.h" +#include "nvim/pos.h" #include "nvim/regexp.h" +#include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/usercmd.h" +#include "nvim/vim.h" #include "nvim/window.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/api/deprecated.c b/src/nvim/api/deprecated.c @@ -1,7 +1,6 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include <limits.h> #include <stdbool.h> #include <stdint.h> #include <stdlib.h> @@ -11,10 +10,15 @@ #include "nvim/api/extmark.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" -#include "nvim/api/vim.h" #include "nvim/api/vimscript.h" +#include "nvim/buffer_defs.h" +#include "nvim/decoration.h" #include "nvim/extmark.h" +#include "nvim/globals.h" #include "nvim/lua/executor.h" +#include "nvim/memory.h" +#include "nvim/pos.h" +#include "nvim/types.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/deprecated.c.generated.h" diff --git a/src/nvim/api/extmark.c b/src/nvim/api/extmark.c @@ -1,20 +1,29 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <assert.h> #include <stdbool.h> #include <stdint.h> -#include <stdlib.h> +#include <string.h> +#include "klib/kvec.h" +#include "lauxlib.h" #include "nvim/api/extmark.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" +#include "nvim/decoration.h" #include "nvim/decoration_provider.h" #include "nvim/drawscreen.h" #include "nvim/extmark.h" #include "nvim/highlight_group.h" -#include "nvim/lua/executor.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" +#include "nvim/memory.h" +#include "nvim/pos.h" +#include "nvim/strings.h" +#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/extmark.c.generated.h" diff --git a/src/nvim/api/extmark.h b/src/nvim/api/extmark.h @@ -3,7 +3,10 @@ #include "nvim/api/private/defs.h" #include "nvim/decoration.h" +#include "nvim/macros.h" #include "nvim/map.h" +#include "nvim/map_defs.h" +#include "nvim/types.h" EXTERN Map(String, handle_T) namespace_ids INIT(= MAP_INIT); EXTERN handle_T next_namespace_id INIT(= 1); diff --git a/src/nvim/api/options.c b/src/nvim/api/options.c @@ -1,20 +1,20 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include <assert.h> #include <inttypes.h> +#include <limits.h> #include <stdbool.h> -#include <stddef.h> -#include <stdlib.h> #include <string.h> #include "nvim/api/options.h" -#include "nvim/api/private/converter.h" +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/autocmd.h" -#include "nvim/buffer.h" +#include "nvim/buffer_defs.h" +#include "nvim/globals.h" +#include "nvim/memory.h" #include "nvim/option.h" -#include "nvim/option_defs.h" +#include "nvim/vim.h" #include "nvim/window.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/api/private/converter.c b/src/nvim/api/private/converter.c @@ -2,17 +2,24 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <assert.h> +#include <stdbool.h> #include <stddef.h> +#include <stdint.h> #include <stdlib.h> +#include "klib/kvec.h" #include "nvim/api/private/converter.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/assert.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/userfunc.h" -#include "nvim/lua/converter.h" +#include "nvim/garray.h" #include "nvim/lua/executor.h" +#include "nvim/memory.h" +#include "nvim/types.h" +#include "nvim/vim.h" /// Helper structure for vim_to_object typedef struct { diff --git a/src/nvim/api/private/dispatch.c b/src/nvim/api/private/dispatch.c @@ -1,38 +1,11 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include <assert.h> -#include <inttypes.h> -#include <msgpack.h> -#include <stdbool.h> +#include <stddef.h> -#include "nvim/api/deprecated.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/dispatch.h" #include "nvim/api/private/helpers.h" -#include "nvim/log.h" -#include "nvim/map.h" -#include "nvim/msgpack_rpc/helpers.h" -#include "nvim/vim.h" - -// =========================================================================== -// NEW API FILES MUST GO HERE. -// -// When creating a new API file, you must include it here, -// so that the dispatcher can find the C functions that you are creating! -// =========================================================================== -#include "nvim/api/autocmd.h" -#include "nvim/api/buffer.h" -#include "nvim/api/command.h" -#include "nvim/api/extmark.h" -#include "nvim/api/options.h" -#include "nvim/api/tabpage.h" -#include "nvim/api/ui.h" -#include "nvim/api/vim.h" -#include "nvim/api/vimscript.h" -#include "nvim/api/win_config.h" -#include "nvim/api/window.h" -#include "nvim/ui_client.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/private/dispatch_wrappers.generated.h" diff --git a/src/nvim/api/private/dispatch.h b/src/nvim/api/private/dispatch.h @@ -1,7 +1,12 @@ #ifndef NVIM_API_PRIVATE_DISPATCH_H #define NVIM_API_PRIVATE_DISPATCH_H +#include <stdbool.h> +#include <stdint.h> + #include "nvim/api/private/defs.h" +#include "nvim/memory.h" +#include "nvim/types.h" typedef Object (*ApiDispatchWrapper)(uint64_t channel_id, Array args, Arena *arena, Error *error); diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c @@ -3,8 +3,12 @@ #include <assert.h> #include <inttypes.h> +#include <limits.h> +#include <msgpack/unpack.h> +#include <stdarg.h> #include <stdbool.h> #include <stddef.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> @@ -12,28 +16,24 @@ #include "nvim/api/private/converter.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" -#include "nvim/api/vim.h" #include "nvim/ascii.h" -#include "nvim/assert.h" -#include "nvim/buffer.h" -#include "nvim/charset.h" -#include "nvim/eval.h" +#include "nvim/buffer_defs.h" #include "nvim/eval/typval.h" -#include "nvim/ex_cmds_defs.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_eval.h" -#include "nvim/extmark.h" +#include "nvim/garray.h" #include "nvim/highlight_group.h" #include "nvim/lua/executor.h" #include "nvim/map.h" -#include "nvim/map_defs.h" #include "nvim/mark.h" #include "nvim/memline.h" #include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/msgpack_rpc/helpers.h" +#include "nvim/pos.h" #include "nvim/ui.h" #include "nvim/version.h" #include "nvim/vim.h" -#include "nvim/window.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/private/funcs_metadata.generated.h" diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h @@ -1,11 +1,17 @@ #ifndef NVIM_API_PRIVATE_HELPERS_H #define NVIM_API_PRIVATE_HELPERS_H +#include <stdbool.h> +#include <stddef.h> + #include "klib/kvec.h" #include "nvim/api/private/defs.h" #include "nvim/decoration.h" #include "nvim/ex_eval_defs.h" #include "nvim/getchar.h" +#include "nvim/globals.h" +#include "nvim/macros.h" +#include "nvim/map.h" #include "nvim/memory.h" #include "nvim/vim.h" diff --git a/src/nvim/api/tabpage.c b/src/nvim/api/tabpage.c @@ -2,13 +2,14 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <stdbool.h> -#include <stdint.h> #include <stdlib.h> #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/api/tabpage.h" #include "nvim/api/vim.h" +#include "nvim/buffer_defs.h" +#include "nvim/globals.h" #include "nvim/memory.h" #include "nvim/window.h" diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c @@ -2,26 +2,34 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <assert.h> +#include <inttypes.h> +#include <msgpack/pack.h> #include <stdbool.h> -#include <stddef.h> #include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include "klib/kvec.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/api/ui.h" #include "nvim/channel.h" -#include "nvim/cursor_shape.h" +#include "nvim/event/loop.h" +#include "nvim/event/wstream.h" +#include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/highlight.h" +#include "nvim/main.h" #include "nvim/map.h" +#include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/msgpack_rpc/channel.h" +#include "nvim/msgpack_rpc/channel_defs.h" #include "nvim/msgpack_rpc/helpers.h" #include "nvim/option.h" -#include "nvim/popupmenu.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/vim.h" -#include "nvim/window.h" typedef struct { uint64_t channel_id; diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c @@ -5,9 +5,13 @@ #include <inttypes.h> #include <limits.h> #include <stdbool.h> +#include <stddef.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> +#include "klib/kvec.h" +#include "lauxlib.h" #include "nvim/api/buffer.h" #include "nvim/api/deprecated.h" #include "nvim/api/private/converter.h" @@ -15,55 +19,52 @@ #include "nvim/api/private/dispatch.h" #include "nvim/api/private/helpers.h" #include "nvim/api/vim.h" -#include "nvim/api/window.h" #include "nvim/ascii.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" -#include "nvim/buffer_defs.h" -#include "nvim/charset.h" +#include "nvim/channel.h" #include "nvim/context.h" -#include "nvim/decoration.h" -#include "nvim/decoration_provider.h" #include "nvim/drawscreen.h" -#include "nvim/edit.h" #include "nvim/eval.h" #include "nvim/eval/typval.h" -#include "nvim/eval/userfunc.h" -#include "nvim/ex_cmds_defs.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" -#include "nvim/file_search.h" -#include "nvim/fileio.h" #include "nvim/getchar.h" #include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/highlight.h" -#include "nvim/highlight_defs.h" #include "nvim/highlight_group.h" -#include "nvim/insexpand.h" +#include "nvim/keycodes.h" +#include "nvim/log.h" #include "nvim/lua/executor.h" +#include "nvim/macros.h" #include "nvim/mapping.h" #include "nvim/mark.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/move.h" #include "nvim/msgpack_rpc/channel.h" -#include "nvim/msgpack_rpc/helpers.h" +#include "nvim/msgpack_rpc/channel_defs.h" #include "nvim/msgpack_rpc/unpacker.h" #include "nvim/ops.h" #include "nvim/option.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.h" #include "nvim/runtime.h" #include "nvim/state.h" #include "nvim/statusline.h" +#include "nvim/strings.h" +#include "nvim/terminal.h" #include "nvim/types.h" #include "nvim/ui.h" #include "nvim/vim.h" -#include "nvim/viml/parser/expressions.h" -#include "nvim/viml/parser/parser.h" #include "nvim/window.h" #define LINE_BUFFER_MIN_SIZE 4096 diff --git a/src/nvim/api/vimscript.c b/src/nvim/api/vimscript.c @@ -2,26 +2,31 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <assert.h> -#include <limits.h> -#include <stdlib.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> +#include <string.h> +#include "klib/kvec.h" #include "nvim/api/private/converter.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/api/vimscript.h" #include "nvim/ascii.h" -#include "nvim/autocmd.h" +#include "nvim/buffer_defs.h" #include "nvim/eval.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/userfunc.h" #include "nvim/ex_docmd.h" -#include "nvim/ops.h" +#include "nvim/garray.h" +#include "nvim/globals.h" +#include "nvim/memory.h" +#include "nvim/pos.h" #include "nvim/runtime.h" -#include "nvim/strings.h" #include "nvim/vim.h" #include "nvim/viml/parser/expressions.h" #include "nvim/viml/parser/parser.h" -#include "nvim/window.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/vimscript.c.generated.h" diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c @@ -1,22 +1,27 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include <assert.h> -#include <inttypes.h> #include <stdbool.h> -#include <stddef.h> -#include <stdint.h> +#include <string.h> +#include "klib/kvec.h" #include "nvim/api/extmark.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/api/win_config.h" #include "nvim/ascii.h" #include "nvim/buffer_defs.h" +#include "nvim/decoration.h" #include "nvim/drawscreen.h" +#include "nvim/extmark_defs.h" +#include "nvim/globals.h" +#include "nvim/grid_defs.h" #include "nvim/highlight_group.h" +#include "nvim/macros.h" +#include "nvim/mbyte.h" +#include "nvim/memory.h" #include "nvim/option.h" -#include "nvim/strings.h" +#include "nvim/pos.h" #include "nvim/syntax.h" #include "nvim/ui.h" #include "nvim/window.h" diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c @@ -10,16 +10,17 @@ #include "nvim/api/private/helpers.h" #include "nvim/api/window.h" #include "nvim/ascii.h" -#include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/cursor.h" #include "nvim/drawscreen.h" #include "nvim/ex_docmd.h" +#include "nvim/gettext.h" #include "nvim/globals.h" #include "nvim/lua/executor.h" +#include "nvim/memline_defs.h" #include "nvim/move.h" -#include "nvim/option.h" -#include "nvim/syntax.h" -#include "nvim/vim.h" +#include "nvim/pos.h" +#include "nvim/types.h" #include "nvim/window.h" /// Gets the current buffer in a window diff --git a/src/nvim/arabic.c b/src/nvim/arabic.c @@ -21,9 +21,14 @@ /// Stand-Alone - unicode form-B isolated char denoted with a_s_* (NOT USED) #include <stdbool.h> +#include <stddef.h> +#include <stdint.h> #include "nvim/arabic.h" #include "nvim/ascii.h" +#include "nvim/macros.h" +#include "nvim/mbyte.h" +#include "nvim/option_defs.h" #include "nvim/vim.h" // Unicode values for Arabic characters. diff --git a/src/nvim/arglist.c b/src/nvim/arglist.c @@ -5,23 +5,36 @@ #include <assert.h> #include <stdbool.h> +#include <stdint.h> +#include <string.h> +#include "auto/config.h" #include "nvim/arglist.h" +#include "nvim/ascii.h" #include "nvim/buffer.h" #include "nvim/charset.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds.h" #include "nvim/ex_cmds2.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_getln.h" #include "nvim/fileio.h" #include "nvim/garray.h" +#include "nvim/gettext.h" #include "nvim/globals.h" +#include "nvim/macros.h" #include "nvim/mark.h" +#include "nvim/memline_defs.h" #include "nvim/memory.h" +#include "nvim/message.h" +#include "nvim/option_defs.h" #include "nvim/os/input.h" #include "nvim/path.h" +#include "nvim/pos.h" #include "nvim/regexp.h" -#include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/undo.h" #include "nvim/version.h" #include "nvim/vim.h" diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c @@ -2,9 +2,13 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // autocmd.c: Autocommand related functions -#include <signal.h> -#include "lauxlib.h" +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> + #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" #include "nvim/autocmd.h" @@ -12,26 +16,43 @@ #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/drawscreen.h" -#include "nvim/edit.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" #include "nvim/eval/userfunc.h" #include "nvim/eval/vars.h" +#include "nvim/event/defs.h" +#include "nvim/event/loop.h" #include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" #include "nvim/ex_getln.h" #include "nvim/fileio.h" +#include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" #include "nvim/grid.h" +#include "nvim/hashtab.h" +#include "nvim/highlight_defs.h" #include "nvim/insexpand.h" #include "nvim/lua/executor.h" +#include "nvim/main.h" #include "nvim/map.h" +#include "nvim/memline_defs.h" +#include "nvim/memory.h" +#include "nvim/message.h" +#include "nvim/option_defs.h" #include "nvim/optionstr.h" #include "nvim/os/input.h" +#include "nvim/os/os.h" +#include "nvim/os/time.h" +#include "nvim/path.h" #include "nvim/profile.h" #include "nvim/regexp.h" #include "nvim/runtime.h" +#include "nvim/screen.h" #include "nvim/search.h" #include "nvim/state.h" +#include "nvim/strings.h" +#include "nvim/ui.h" #include "nvim/ui_compositor.h" #include "nvim/vim.h" #include "nvim/window.h" diff --git a/src/nvim/autocmd.h b/src/nvim/autocmd.h @@ -1,8 +1,20 @@ #ifndef NVIM_AUTOCMD_H #define NVIM_AUTOCMD_H +#include <stdbool.h> +#include <stdint.h> + +#include "nvim/api/private/defs.h" #include "nvim/buffer_defs.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" +#include "nvim/macros.h" +#include "nvim/regexp_defs.h" +#include "nvim/types.h" + +struct AutoCmd_S; +struct AutoPatCmd_S; +struct AutoPat_S; // event_T definition #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c @@ -20,10 +20,16 @@ // #include <assert.h> +#include <ctype.h> #include <inttypes.h> #include <stdbool.h> +#include <stdlib.h> #include <string.h> +#include <sys/stat.h> +#include <time.h> +#include "auto/config.h" +#include "klib/kvec.h" #include "nvim/api/private/helpers.h" #include "nvim/arglist.h" #include "nvim/ascii.h" @@ -44,6 +50,7 @@ #include "nvim/eval/vars.h" #include "nvim/ex_cmds.h" #include "nvim/ex_cmds2.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" #include "nvim/ex_getln.h" @@ -53,21 +60,25 @@ #include "nvim/fold.h" #include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/hashtab.h" #include "nvim/help.h" -#include "nvim/highlight_group.h" #include "nvim/indent.h" #include "nvim/indent_c.h" #include "nvim/main.h" +#include "nvim/map.h" #include "nvim/mapping.h" #include "nvim/mark.h" -#include "nvim/mark_defs.h" #include "nvim/mbyte.h" +#include "nvim/memline_defs.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/move.h" +#include "nvim/normal.h" #include "nvim/option.h" #include "nvim/optionstr.h" +#include "nvim/os/fs_defs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/time.h" @@ -76,11 +87,14 @@ #include "nvim/quickfix.h" #include "nvim/regexp.h" #include "nvim/runtime.h" +#include "nvim/screen.h" #include "nvim/sign.h" #include "nvim/spell.h" #include "nvim/statusline.h" #include "nvim/strings.h" #include "nvim/syntax.h" +#include "nvim/terminal.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/usercmd.h" diff --git a/src/nvim/buffer.h b/src/nvim/buffer.h @@ -1,12 +1,20 @@ #ifndef NVIM_BUFFER_H #define NVIM_BUFFER_H +#include <assert.h> +#include <stdbool.h> +#include <stddef.h> + +#include "nvim/buffer_defs.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" #include "nvim/func_attr.h" +#include "nvim/grid_defs.h" // for StlClickRecord #include "nvim/macros.h" #include "nvim/memline.h" -#include "nvim/pos.h" // for linenr_T +#include "nvim/memline_defs.h" +#include "nvim/pos.h" // Values for buflist_getfile() enum getf_values { diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h @@ -3,7 +3,6 @@ #include <stdbool.h> #include <stdint.h> -// for FILE #include <stdio.h> typedef struct file_buffer buf_T; // Forward declaration @@ -16,36 +15,23 @@ typedef struct { int br_buf_free_count; } bufref_T; -// for garray_T +#include "klib/kvec.h" +#include "nvim/api/private/defs.h" +#include "nvim/eval/typval.h" #include "nvim/garray.h" -// for ScreenGrid #include "nvim/grid_defs.h" -// for HLF_COUNT -#include "nvim/highlight_defs.h" -// for pos_T, lpos_T and linenr_T -#include "nvim/pos.h" -// for the number window-local and buffer-local options -#include "nvim/option_defs.h" -// for jump list and tag stack sizes in a buffer and mark types -#include "nvim/mark_defs.h" -// for u_header_T -#include "nvim/undo_defs.h" -// for hashtab_T #include "nvim/hashtab.h" -// for dict_T -#include "nvim/eval/typval.h" -// for String -#include "nvim/api/private/defs.h" -// for Map(K, V) +#include "nvim/highlight_defs.h" #include "nvim/map.h" -// for kvec -#include "klib/kvec.h" -// for marktree +#include "nvim/mark_defs.h" #include "nvim/marktree.h" // for float window title #include "nvim/extmark_defs.h" // for click definitions +#include "nvim/option_defs.h" +#include "nvim/pos.h" #include "nvim/statusline_defs.h" +#include "nvim/undo_defs.h" #define GETFILE_SUCCESS(x) ((x) <= 0) #define MODIFIABLE(buf) (buf->b_p_ma) @@ -100,17 +86,12 @@ typedef struct wininfo_S wininfo_T; typedef struct frame_S frame_T; typedef uint64_t disptick_T; // display tick type -// for struct memline (it needs memfile_T) #include "nvim/memline_defs.h" - -// for regprog_T. Needs win_T and buf_T. +#include "nvim/os/fs_defs.h" #include "nvim/regexp_defs.h" -// for synstate_T (needs reg_extmatch_T, win_T, buf_T) -#include "nvim/syntax_defs.h" -// for sign_entry_T -#include "nvim/os/fs_defs.h" // for FileID #include "nvim/sign_defs.h" -#include "nvim/terminal.h" // for Terminal +#include "nvim/syntax_defs.h" +#include "nvim/terminal.h" // The taggy struct is used to store the information about a :tag command. typedef struct taggy { diff --git a/src/nvim/buffer_updates.c b/src/nvim/buffer_updates.c @@ -1,18 +1,31 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <inttypes.h> +#include <stdbool.h> +#include <stddef.h> + +#include "klib/kvec.h" +#include "lauxlib.h" #include "nvim/api/buffer.h" +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/assert.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/buffer_updates.h" #include "nvim/extmark.h" +#include "nvim/globals.h" +#include "nvim/log.h" #include "nvim/lua/executor.h" #include "nvim/memline.h" +#include "nvim/memory.h" #include "nvim/msgpack_rpc/channel.h" +#include "nvim/pos.h" +#include "nvim/types.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "buffer_updates.c.generated.h" +# include "buffer_updates.c.generated.h" // IWYU pragma: export #endif // Register a channel. Return True if the channel was added, or already added. diff --git a/src/nvim/buffer_updates.h b/src/nvim/buffer_updates.h @@ -1,8 +1,8 @@ #ifndef NVIM_BUFFER_UPDATES_H #define NVIM_BUFFER_UPDATES_H -#include "nvim/buffer_defs.h" // for buf_T -#include "nvim/extmark.h" // for bcount_t +#include "nvim/buffer_defs.h" +#include "nvim/extmark.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "buffer_updates.h.generated.h" diff --git a/src/nvim/change.c b/src/nvim/change.c @@ -3,8 +3,16 @@ /// change.c: functions related to changing text +#include <assert.h> +#include <stdbool.h> +#include <stdint.h> +#include <string.h> + +#include "nvim/ascii.h" #include "nvim/assert.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/buffer_updates.h" #include "nvim/change.h" #include "nvim/charset.h" @@ -13,22 +21,35 @@ #include "nvim/drawscreen.h" #include "nvim/edit.h" #include "nvim/eval.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/extmark.h" -#include "nvim/fileio.h" #include "nvim/fold.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/grid_defs.h" +#include "nvim/highlight_defs.h" #include "nvim/indent.h" #include "nvim/indent_c.h" #include "nvim/insexpand.h" +#include "nvim/macros.h" #include "nvim/mark.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" +#include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/move.h" #include "nvim/option.h" +#include "nvim/os/time.h" #include "nvim/plines.h" +#include "nvim/pos.h" +#include "nvim/screen.h" #include "nvim/search.h" #include "nvim/state.h" +#include "nvim/strings.h" #include "nvim/textformat.h" #include "nvim/ui.h" #include "nvim/undo.h" +#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "change.c.generated.h" diff --git a/src/nvim/change.h b/src/nvim/change.h @@ -1,8 +1,8 @@ #ifndef NVIM_CHANGE_H #define NVIM_CHANGE_H -#include "nvim/buffer_defs.h" // for buf_T -#include "nvim/pos.h" // for linenr_T +#include "nvim/buffer_defs.h" +#include "nvim/pos.h" // flags for open_line() #define OPENLINE_DELSPACES 0x01 // delete spaces after cursor diff --git a/src/nvim/channel.c b/src/nvim/channel.c @@ -1,24 +1,42 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <assert.h> +#include <inttypes.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> + +#include "lauxlib.h" #include "nvim/api/private/converter.h" +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" -#include "nvim/api/ui.h" #include "nvim/autocmd.h" +#include "nvim/buffer_defs.h" #include "nvim/channel.h" #include "nvim/eval.h" #include "nvim/eval/encode.h" +#include "nvim/eval/typval.h" +#include "nvim/event/loop.h" +#include "nvim/event/rstream.h" #include "nvim/event/socket.h" +#include "nvim/event/wstream.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/log.h" #include "nvim/lua/executor.h" +#include "nvim/main.h" +#include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/msgpack_rpc/channel.h" #include "nvim/msgpack_rpc/server.h" -#include "nvim/os/fs.h" +#include "nvim/os/os_defs.h" #include "nvim/os/shell.h" +#include "nvim/rbuffer.h" #ifdef MSWIN # include "nvim/os/os_win_console.h" # include "nvim/os/pty_conpty_win.h" #endif -#include "nvim/ascii.h" #include "nvim/path.h" static bool did_stdio = false; diff --git a/src/nvim/channel.h b/src/nvim/channel.h @@ -1,13 +1,26 @@ #ifndef NVIM_CHANNEL_H #define NVIM_CHANNEL_H +#include <stdbool.h> +#include <stdint.h> +#include <stdlib.h> + #include "nvim/eval/typval.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.h" +#include "nvim/macros.h" #include "nvim/main.h" +#include "nvim/map.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.h" #define CHAN_STDIO 1 #define CHAN_STDERR 2 diff --git a/src/nvim/charset.c b/src/nvim/charset.c @@ -6,28 +6,35 @@ /// Code related to character sets. #include <assert.h> +#include <errno.h> #include <inttypes.h> +#include <limits.h> +#include <stdlib.h> #include <string.h> -#include <wctype.h> +#include "auto/config.h" #include "nvim/ascii.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cursor.h" -#include "nvim/func_attr.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/garray.h" +#include "nvim/globals.h" +#include "nvim/grid_defs.h" #include "nvim/indent.h" -#include "nvim/main.h" +#include "nvim/keycodes.h" +#include "nvim/macros.h" #include "nvim/mark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/move.h" #include "nvim/option.h" -#include "nvim/os_unix.h" #include "nvim/path.h" #include "nvim/plines.h" +#include "nvim/pos.h" #include "nvim/state.h" -#include "nvim/strings.h" #include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/charset.h b/src/nvim/charset.h @@ -1,6 +1,8 @@ #ifndef NVIM_CHARSET_H #define NVIM_CHARSET_H +#include <stdbool.h> + #include "nvim/buffer_defs.h" #include "nvim/eval/typval.h" #include "nvim/option_defs.h" diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c @@ -3,9 +3,20 @@ // cmdexpand.c: functions for command-line completion +#include <assert.h> +#include <limits.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "auto/config.h" +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/arglist.h" #include "nvim/ascii.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" #include "nvim/charset.h" #include "nvim/cmdexpand.h" @@ -13,26 +24,39 @@ #include "nvim/drawscreen.h" #include "nvim/eval.h" #include "nvim/eval/funcs.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/userfunc.h" #include "nvim/ex_cmds.h" -#include "nvim/ex_cmds2.h" #include "nvim/ex_docmd.h" #include "nvim/ex_getln.h" #include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/grid.h" +#include "nvim/hashtab.h" #include "nvim/help.h" +#include "nvim/highlight_defs.h" #include "nvim/highlight_group.h" +#include "nvim/keycodes.h" #include "nvim/locale.h" +#include "nvim/log.h" #include "nvim/lua/executor.h" +#include "nvim/macros.h" #include "nvim/mapping.h" +#include "nvim/mbyte.h" +#include "nvim/memory.h" #include "nvim/menu.h" +#include "nvim/message.h" #include "nvim/option.h" #include "nvim/os/os.h" +#include "nvim/path.h" #include "nvim/popupmenu.h" +#include "nvim/pos.h" #include "nvim/profile.h" #include "nvim/regexp.h" -#include "nvim/screen.h" +#include "nvim/runtime.h" #include "nvim/search.h" #include "nvim/sign.h" #include "nvim/statusline.h" diff --git a/src/nvim/cmdhist.c b/src/nvim/cmdhist.c @@ -3,14 +3,30 @@ // cmdhist.c: Functions for the history of the command-line. +#include <assert.h> +#include <limits.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <string.h> + #include "nvim/ascii.h" #include "nvim/charset.h" #include "nvim/cmdhist.h" +#include "nvim/eval/typval.h" #include "nvim/ex_cmds.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_getln.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/macros.h" +#include "nvim/memory.h" +#include "nvim/message.h" +#include "nvim/option_defs.h" +#include "nvim/pos.h" #include "nvim/regexp.h" #include "nvim/strings.h" -#include "nvim/ui.h" +#include "nvim/types.h" #include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/cmdhist.h b/src/nvim/cmdhist.h @@ -2,6 +2,7 @@ #define NVIM_CMDHIST_H #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" #include "nvim/os/time.h" diff --git a/src/nvim/context.c b/src/nvim/context.c @@ -3,16 +3,28 @@ // Context: snapshot of the entire editor state as one big object/map +#include <assert.h> +#include <stdbool.h> +#include <stdio.h> + #include "nvim/api/private/converter.h" #include "nvim/api/private/helpers.h" -#include "nvim/api/vim.h" #include "nvim/api/vimscript.h" #include "nvim/context.h" #include "nvim/eval/encode.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/userfunc.h" #include "nvim/ex_docmd.h" +#include "nvim/gettext.h" +#include "nvim/hashtab.h" +#include "nvim/keycodes.h" +#include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/option.h" #include "nvim/shada.h" +#include "nvim/types.h" +#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "context.c.generated.h" diff --git a/src/nvim/context.h b/src/nvim/context.h @@ -2,6 +2,8 @@ #define NVIM_CONTEXT_H #include <msgpack.h> +#include <msgpack/sbuffer.h> +#include <stddef.h> #include "klib/kvec.h" #include "nvim/api/private/defs.h" diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c @@ -1,24 +1,31 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <assert.h> #include <inttypes.h> #include <stdbool.h> +#include <string.h> #include "nvim/ascii.h" #include "nvim/assert.h" +#include "nvim/buffer_defs.h" #include "nvim/change.h" #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/drawscreen.h" -#include "nvim/extmark.h" #include "nvim/fold.h" +#include "nvim/globals.h" +#include "nvim/macros.h" #include "nvim/mark.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/move.h" #include "nvim/option.h" #include "nvim/plines.h" +#include "nvim/pos.h" #include "nvim/state.h" +#include "nvim/types.h" #include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c @@ -1,15 +1,23 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include <assert.h> +#include <stdbool.h> #include <stdint.h> +#include <string.h> +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" #include "nvim/charset.h" #include "nvim/cursor_shape.h" #include "nvim/ex_getln.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/highlight_group.h" +#include "nvim/log.h" +#include "nvim/macros.h" +#include "nvim/memory.h" +#include "nvim/option_defs.h" #include "nvim/strings.h" #include "nvim/ui.h" #include "nvim/vim.h" diff --git a/src/nvim/debugger.c b/src/nvim/debugger.c @@ -5,17 +5,33 @@ /// /// Vim script debugger functions +#include <inttypes.h> +#include <stdbool.h> +#include <stdlib.h> +#include <string.h> + #include "nvim/ascii.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/debugger.h" #include "nvim/drawscreen.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/ex_getln.h" #include "nvim/fileio.h" +#include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" #include "nvim/globals.h" +#include "nvim/keycodes.h" +#include "nvim/macros.h" +#include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/os/os.h" +#include "nvim/path.h" #include "nvim/pos.h" #include "nvim/regexp.h" #include "nvim/runtime.h" diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c @@ -1,16 +1,17 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include "nvim/api/ui.h" +#include <assert.h> + #include "nvim/buffer.h" #include "nvim/decoration.h" #include "nvim/drawscreen.h" #include "nvim/extmark.h" #include "nvim/highlight.h" #include "nvim/highlight_group.h" -#include "nvim/lua/executor.h" -#include "nvim/move.h" -#include "nvim/vim.h" +#include "nvim/memory.h" +#include "nvim/pos.h" +#include "nvim/sign_defs.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "decoration.c.generated.h" diff --git a/src/nvim/decoration.h b/src/nvim/decoration.h @@ -1,9 +1,17 @@ #ifndef NVIM_DECORATION_H #define NVIM_DECORATION_H +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> + +#include "klib/kvec.h" #include "nvim/buffer_defs.h" #include "nvim/extmark_defs.h" +#include "nvim/macros.h" +#include "nvim/marktree.h" #include "nvim/pos.h" +#include "nvim/types.h" // actual Decoration data is in extmark_defs.h diff --git a/src/nvim/decoration_provider.c b/src/nvim/decoration_provider.c @@ -1,14 +1,23 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <assert.h> +#include <stdio.h> +#include <string.h> + #include "klib/kvec.h" +#include "lauxlib.h" #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/buffer_defs.h" #include "nvim/decoration_provider.h" +#include "nvim/globals.h" #include "nvim/highlight.h" +#include "nvim/log.h" #include "nvim/lua/executor.h" +#include "nvim/memory.h" +#include "nvim/pos.h" static kvec_t(DecorProvider) decor_providers = KV_INITIAL_VALUE; diff --git a/src/nvim/decoration_provider.h b/src/nvim/decoration_provider.h @@ -1,7 +1,12 @@ #ifndef NVIM_DECORATION_PROVIDER_H #define NVIM_DECORATION_PROVIDER_H +#include <stdbool.h> + +#include "klib/kvec.h" #include "nvim/buffer_defs.h" +#include "nvim/macros.h" +#include "nvim/types.h" typedef struct { NS ns_id; diff --git a/src/nvim/diff.c b/src/nvim/diff.c @@ -10,9 +10,15 @@ /// - Use the compiled-in xdiff library. /// - Let 'diffexpr' do the work, using files. +#include <assert.h> +#include <ctype.h> #include <inttypes.h> #include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "auto/config.h" #include "nvim/ascii.h" #include "nvim/autocmd.h" #include "nvim/buffer.h" @@ -23,10 +29,14 @@ #include "nvim/drawscreen.h" #include "nvim/eval.h" #include "nvim/ex_cmds.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" +#include "nvim/extmark_defs.h" #include "nvim/fileio.h" #include "nvim/fold.h" #include "nvim/garray.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/linematch.h" #include "nvim/mark.h" #include "nvim/mbyte.h" @@ -37,10 +47,13 @@ #include "nvim/normal.h" #include "nvim/option.h" #include "nvim/optionstr.h" +#include "nvim/os/fs_defs.h" #include "nvim/os/os.h" #include "nvim/os/shell.h" #include "nvim/path.h" +#include "nvim/pos.h" #include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/vim.h" diff --git a/src/nvim/diff.h b/src/nvim/diff.h @@ -1,7 +1,10 @@ #ifndef NVIM_DIFF_H #define NVIM_DIFF_H +#include <stdbool.h> + #include "nvim/ex_cmds_defs.h" +#include "nvim/macros.h" #include "nvim/pos.h" // Value set from 'diffopt'. diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c @@ -8,24 +8,34 @@ #include <assert.h> #include <inttypes.h> #include <stdbool.h> +#include <string.h> #include "nvim/ascii.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/digraph.h" #include "nvim/drawscreen.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/ex_getln.h" #include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/highlight_defs.h" +#include "nvim/keycodes.h" #include "nvim/mapping.h" #include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/normal.h" +#include "nvim/option_defs.h" #include "nvim/os/input.h" #include "nvim/runtime.h" #include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/vim.h" typedef int result_T; diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c @@ -5,37 +5,50 @@ // This is the middle level, drawscreen.c is the top and grid.c/screen.c the lower level. #include <assert.h> -#include <inttypes.h> +#include <limits.h> #include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> #include "nvim/arabic.h" +#include "nvim/ascii.h" #include "nvim/buffer.h" -#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/cursor_shape.h" #include "nvim/decoration.h" +#include "nvim/decoration_provider.h" #include "nvim/diff.h" #include "nvim/drawline.h" +#include "nvim/extmark_defs.h" #include "nvim/fold.h" +#include "nvim/garray.h" +#include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/highlight.h" #include "nvim/highlight_group.h" #include "nvim/indent.h" +#include "nvim/mark.h" #include "nvim/match.h" +#include "nvim/mbyte.h" +#include "nvim/memline.h" +#include "nvim/memory.h" #include "nvim/move.h" #include "nvim/option.h" #include "nvim/plines.h" +#include "nvim/pos.h" #include "nvim/quickfix.h" -#include "nvim/search.h" +#include "nvim/screen.h" #include "nvim/sign.h" #include "nvim/spell.h" #include "nvim/state.h" +#include "nvim/strings.h" #include "nvim/syntax.h" +#include "nvim/terminal.h" #include "nvim/types.h" -#include "nvim/undo.h" -#include "nvim/window.h" +#include "nvim/ui.h" +#include "nvim/vim.h" #define MB_FILLER_CHAR '<' // character used when a double-width character // doesn't fit. diff --git a/src/nvim/drawline.h b/src/nvim/drawline.h @@ -1,9 +1,15 @@ #ifndef NVIM_DRAWLINE_H #define NVIM_DRAWLINE_H +#include <stdbool.h> +#include <stdint.h> + +#include "klib/kvec.h" #include "nvim/decoration_provider.h" #include "nvim/fold.h" +#include "nvim/macros.h" #include "nvim/screen.h" +#include "nvim/types.h" // Maximum columns for terminal highlight attributes #define TERM_ATTRS_MAX 1024 diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c @@ -59,30 +59,47 @@ #include <stdbool.h> #include <string.h> +#include "klib/kvec.h" +#include "nvim/api/private/defs.h" +#include "nvim/ascii.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" -#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cmdexpand.h" +#include "nvim/decoration.h" +#include "nvim/decoration_provider.h" #include "nvim/diff.h" +#include "nvim/drawline.h" #include "nvim/drawscreen.h" #include "nvim/ex_getln.h" #include "nvim/extmark_defs.h" +#include "nvim/fold.h" +#include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/highlight.h" #include "nvim/highlight_group.h" #include "nvim/insexpand.h" #include "nvim/match.h" +#include "nvim/mbyte.h" +#include "nvim/memline.h" +#include "nvim/message.h" #include "nvim/move.h" +#include "nvim/normal.h" #include "nvim/option.h" #include "nvim/plines.h" #include "nvim/popupmenu.h" +#include "nvim/pos.h" #include "nvim/profile.h" #include "nvim/regexp.h" +#include "nvim/screen.h" #include "nvim/statusline.h" #include "nvim/syntax.h" +#include "nvim/terminal.h" +#include "nvim/types.h" +#include "nvim/ui.h" #include "nvim/ui_compositor.h" -#include "nvim/undo.h" #include "nvim/version.h" +#include "nvim/vim.h" #include "nvim/window.h" /// corner value flags for hsep_connected and vsep_connected diff --git a/src/nvim/drawscreen.h b/src/nvim/drawscreen.h @@ -1,7 +1,10 @@ #ifndef NVIM_DRAWSCREEN_H #define NVIM_DRAWSCREEN_H +#include <stdbool.h> + #include "nvim/drawline.h" +#include "nvim/macros.h" /// flags for update_screen() /// The higher the value, the higher the priority diff --git a/src/nvim/edit.c b/src/nvim/edit.c @@ -4,11 +4,14 @@ // edit.c: functions for Insert mode #include <assert.h> +#include <ctype.h> #include <inttypes.h> #include <stdbool.h> #include <string.h> +#include <sys/types.h> #include "nvim/ascii.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" #include "nvim/change.h" #include "nvim/charset.h" @@ -17,20 +20,23 @@ #include "nvim/drawscreen.h" #include "nvim/edit.h" #include "nvim/eval.h" -#include "nvim/event/loop.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" -#include "nvim/ex_getln.h" #include "nvim/extmark.h" #include "nvim/fileio.h" #include "nvim/fold.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/grid.h" +#include "nvim/highlight_defs.h" #include "nvim/highlight_group.h" #include "nvim/indent.h" #include "nvim/indent_c.h" #include "nvim/insexpand.h" #include "nvim/keycodes.h" -#include "nvim/main.h" +#include "nvim/macros.h" #include "nvim/mapping.h" #include "nvim/mark.h" #include "nvim/mbyte.h" @@ -43,19 +49,18 @@ #include "nvim/ops.h" #include "nvim/option.h" #include "nvim/os/input.h" -#include "nvim/os/time.h" -#include "nvim/path.h" #include "nvim/plines.h" #include "nvim/popupmenu.h" -#include "nvim/quickfix.h" +#include "nvim/pos.h" +#include "nvim/screen.h" #include "nvim/search.h" -#include "nvim/spell.h" #include "nvim/state.h" #include "nvim/strings.h" #include "nvim/syntax.h" #include "nvim/terminal.h" #include "nvim/textformat.h" #include "nvim/textobject.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/vim.h" diff --git a/src/nvim/eval.c b/src/nvim/eval.c @@ -3,12 +3,19 @@ // eval.c: Expression evaluation. +#include <assert.h> +#include <ctype.h> +#include <inttypes.h> #include <math.h> +#include <stdio.h> #include <stdlib.h> +#include <string.h> +#include "auto/config.h" +#include "nvim/api/private/defs.h" #include "nvim/ascii.h" -#include "nvim/autocmd.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/change.h" #include "nvim/channel.h" #include "nvim/charset.h" @@ -22,39 +29,60 @@ #include "nvim/eval/typval.h" #include "nvim/eval/userfunc.h" #include "nvim/eval/vars.h" +#include "nvim/event/loop.h" +#include "nvim/event/multiqueue.h" +#include "nvim/event/process.h" #include "nvim/ex_cmds.h" -#include "nvim/ex_cmds2.h" #include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" #include "nvim/ex_getln.h" #include "nvim/ex_session.h" +#include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/grid_defs.h" #include "nvim/highlight_group.h" #include "nvim/insexpand.h" +#include "nvim/keycodes.h" +#include "nvim/lib/queue.h" #include "nvim/locale.h" #include "nvim/lua/executor.h" +#include "nvim/macros.h" +#include "nvim/main.h" +#include "nvim/map.h" #include "nvim/mark.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" +#include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/move.h" +#include "nvim/msgpack_rpc/channel_defs.h" #include "nvim/ops.h" #include "nvim/option.h" #include "nvim/optionstr.h" -#include "nvim/os/input.h" +#include "nvim/os/fileio.h" +#include "nvim/os/fs_defs.h" +#include "nvim/os/os.h" #include "nvim/os/shell.h" +#include "nvim/os/stdpaths_defs.h" #include "nvim/path.h" +#include "nvim/pos.h" #include "nvim/profile.h" #include "nvim/quickfix.h" #include "nvim/regexp.h" #include "nvim/runtime.h" -#include "nvim/screen.h" #include "nvim/search.h" #include "nvim/sign.h" -#include "nvim/syntax.h" +#include "nvim/strings.h" #include "nvim/tag.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/ui_compositor.h" #include "nvim/undo.h" +#include "nvim/usercmd.h" #include "nvim/version.h" +#include "nvim/vim.h" #include "nvim/window.h" // TODO(ZyX-I): Remove DICT_MAXNEST, make users be non-recursive instead diff --git a/src/nvim/eval.h b/src/nvim/eval.h @@ -1,12 +1,17 @@ #ifndef NVIM_EVAL_H #define NVIM_EVAL_H +#include <stdbool.h> +#include <stddef.h> + #include "nvim/buffer_defs.h" #include "nvim/channel.h" -#include "nvim/event/time.h" // For TimeWatcher -#include "nvim/ex_cmds_defs.h" // For exarg_T -#include "nvim/os/fileio.h" // For FileDescriptor -#include "nvim/os/stdpaths_defs.h" // For XDGVarType +#include "nvim/eval/typval_defs.h" +#include "nvim/event/time.h" +#include "nvim/ex_cmds_defs.h" +#include "nvim/hashtab.h" +#include "nvim/os/fileio.h" +#include "nvim/os/stdpaths_defs.h" #define COPYID_INC 2 #define COPYID_MASK (~0x1) diff --git a/src/nvim/eval/decode.c b/src/nvim/eval/decode.c @@ -1,20 +1,31 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include <msgpack.h> +#include <assert.h> +#include <msgpack/object.h> +#include <stdbool.h> #include <stddef.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> #include "klib/kvec.h" #include "nvim/ascii.h" -#include "nvim/charset.h" // vim_str2nr +#include "nvim/charset.h" #include "nvim/eval.h" #include "nvim/eval/decode.h" #include "nvim/eval/encode.h" #include "nvim/eval/typval.h" -#include "nvim/globals.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/garray.h" +#include "nvim/gettext.h" +#include "nvim/hashtab.h" #include "nvim/macros.h" +#include "nvim/mbyte.h" +#include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/vim.h" // OK, FAIL +#include "nvim/types.h" +#include "nvim/vim.h" /// Helper structure for container_struct typedef struct { diff --git a/src/nvim/eval/encode.c b/src/nvim/eval/encode.c @@ -10,23 +10,28 @@ #include <assert.h> #include <inttypes.h> #include <math.h> -#include <msgpack.h> +#include <stdbool.h> #include <stddef.h> +#include <stdlib.h> +#include <string.h> #include "klib/kvec.h" +#include "msgpack/pack.h" #include "nvim/ascii.h" -#include "nvim/buffer_defs.h" -#include "nvim/charset.h" // vim_isprintc() #include "nvim/eval.h" #include "nvim/eval/encode.h" #include "nvim/eval/typval.h" #include "nvim/eval/typval_encode.h" #include "nvim/garray.h" +#include "nvim/gettext.h" +#include "nvim/hashtab.h" #include "nvim/macros.h" #include "nvim/math.h" #include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/message.h" +#include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/vim.h" // For _() const char *const encode_bool_var_names[] = { diff --git a/src/nvim/eval/encode.h b/src/nvim/eval/encode.h @@ -2,11 +2,14 @@ #define NVIM_EVAL_ENCODE_H #include <msgpack.h> +#include <msgpack/pack.h> #include <stddef.h> #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/garray.h" -#include "nvim/vim.h" // For STRLEN +#include "nvim/vim.h" /// Convert VimL value to msgpack string /// diff --git a/src/nvim/eval/executor.c b/src/nvim/eval/executor.c @@ -1,15 +1,23 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <inttypes.h> +#include <stdlib.h> + #include "nvim/eval.h" #include "nvim/eval/executor.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/garray.h" +#include "nvim/gettext.h" #include "nvim/globals.h" #include "nvim/message.h" +#include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "eval/executor.c.generated.h" +# include "eval/executor.c.generated.h" // IWYU pragma: export #endif char *e_listidx = N_("E684: list index out of range: %" PRId64); diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c @@ -1,25 +1,42 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <assert.h> +#include <fcntl.h> #include <float.h> +#include <inttypes.h> +#include <limits.h> #include <math.h> - +#include <msgpack/object.h> +#include <msgpack/pack.h> +#include <msgpack/unpack.h> +#include <signal.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> +#include <time.h> +#include <uv.h> + +#include "auto/config.h" #include "nvim/api/private/converter.h" +#include "nvim/api/private/defs.h" +#include "nvim/api/private/dispatch.h" #include "nvim/api/private/helpers.h" #include "nvim/api/vim.h" -#include "nvim/arglist.h" #include "nvim/ascii.h" #include "nvim/assert.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/change.h" #include "nvim/channel.h" #include "nvim/charset.h" #include "nvim/cmdexpand.h" -#include "nvim/cmdhist.h" #include "nvim/context.h" #include "nvim/cursor.h" #include "nvim/diff.h" -#include "nvim/digraph.h" #include "nvim/edit.h" #include "nvim/eval.h" #include "nvim/eval/decode.h" @@ -29,54 +46,71 @@ #include "nvim/eval/typval.h" #include "nvim/eval/userfunc.h" #include "nvim/eval/vars.h" +#include "nvim/event/loop.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" #include "nvim/ex_getln.h" #include "nvim/file_search.h" #include "nvim/fileio.h" -#include "nvim/fold.h" +#include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" #include "nvim/globals.h" +#include "nvim/grid_defs.h" +#include "nvim/hashtab.h" +#include "nvim/highlight_defs.h" #include "nvim/highlight_group.h" #include "nvim/indent.h" #include "nvim/indent_c.h" #include "nvim/input.h" -#include "nvim/insexpand.h" +#include "nvim/keycodes.h" #include "nvim/lua/executor.h" #include "nvim/macros.h" -#include "nvim/mapping.h" +#include "nvim/main.h" #include "nvim/mark.h" -#include "nvim/match.h" #include "nvim/math.h" +#include "nvim/mbyte.h" +#include "nvim/memfile_defs.h" #include "nvim/memline.h" +#include "nvim/memory.h" #include "nvim/menu.h" +#include "nvim/message.h" #include "nvim/mouse.h" #include "nvim/move.h" #include "nvim/msgpack_rpc/channel.h" +#include "nvim/msgpack_rpc/channel_defs.h" #include "nvim/msgpack_rpc/server.h" +#include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" #include "nvim/optionstr.h" #include "nvim/os/dl.h" +#include "nvim/os/fileio.h" +#include "nvim/os/fs_defs.h" +#include "nvim/os/os.h" +#include "nvim/os/pty_process.h" #include "nvim/os/shell.h" +#include "nvim/os/stdpaths_defs.h" +#include "nvim/os/time.h" #include "nvim/path.h" #include "nvim/plines.h" #include "nvim/popupmenu.h" +#include "nvim/pos.h" #include "nvim/profile.h" -#include "nvim/quickfix.h" #include "nvim/regexp.h" #include "nvim/runtime.h" -#include "nvim/screen.h" #include "nvim/search.h" #include "nvim/sha256.h" -#include "nvim/sign.h" #include "nvim/spell.h" #include "nvim/spellsuggest.h" #include "nvim/state.h" +#include "nvim/strings.h" #include "nvim/syntax.h" #include "nvim/tag.h" -#include "nvim/testing.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/version.h" @@ -105,6 +139,7 @@ typedef enum { PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH # include "funcs.generated.h" + PRAGMA_DIAG_POP PRAGMA_DIAG_POP #endif diff --git a/src/nvim/eval/funcs.h b/src/nvim/eval/funcs.h @@ -1,9 +1,14 @@ #ifndef NVIM_EVAL_FUNCS_H #define NVIM_EVAL_FUNCS_H +#include <stdbool.h> +#include <stdint.h> + #include "nvim/api/private/dispatch.h" #include "nvim/buffer_defs.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/types.h" /// Prototype of C function that implements VimL function typedef void (*VimLFunc)(typval_T *args, typval_T *rvar, EvalFuncData data); diff --git a/src/nvim/eval/gc.c b/src/nvim/eval/gc.c @@ -1,11 +1,12 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <stddef.h> + #include "nvim/eval/gc.h" -#include "nvim/eval/typval.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "eval/gc.c.generated.h" +# include "eval/gc.c.generated.h" // IWYU pragma: export #endif /// Head of list of all dictionaries diff --git a/src/nvim/eval/gc.h b/src/nvim/eval/gc.h @@ -2,6 +2,7 @@ #define NVIM_EVAL_GC_H #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" extern dict_T *gc_first_dict; extern list_T *gc_first_list; diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c @@ -28,9 +28,9 @@ #include "nvim/lua/executor.h" #include "nvim/macros.h" #include "nvim/mbyte.h" +#include "nvim/mbyte_defs.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/os/fileio.h" #include "nvim/os/input.h" #include "nvim/pos.h" #include "nvim/types.h" @@ -3150,6 +3150,7 @@ static inline void _nothing_conv_dict_end(typval_T *const tv, dict_T **const dic #define TYPVAL_ENCODE_FIRST_ARG_TYPE const void *const #define TYPVAL_ENCODE_FIRST_ARG_NAME ignored #include "nvim/eval/typval_encode.c.h" + #undef TYPVAL_ENCODE_SCOPE #undef TYPVAL_ENCODE_NAME #undef TYPVAL_ENCODE_FIRST_ARG_TYPE diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h @@ -4,14 +4,19 @@ #include <assert.h> #include <stdbool.h> #include <stddef.h> +#include <stdint.h> #include <string.h> #include "nvim/eval/typval_defs.h" #include "nvim/func_attr.h" +#include "nvim/garray.h" #include "nvim/gettext.h" +#include "nvim/hashtab.h" +#include "nvim/lib/queue.h" #include "nvim/macros.h" #include "nvim/mbyte_defs.h" #include "nvim/message.h" +#include "nvim/types.h" #ifdef LOG_LIST_ACTIONS # include "nvim/memory.h" diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c @@ -3,28 +3,48 @@ // User defined function support +#include <assert.h> +#include <ctype.h> +#include <inttypes.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "lauxlib.h" #include "nvim/ascii.h" +#include "nvim/autocmd.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/debugger.h" -#include "nvim/edit.h" #include "nvim/eval.h" #include "nvim/eval/encode.h" #include "nvim/eval/funcs.h" +#include "nvim/eval/typval.h" #include "nvim/eval/userfunc.h" #include "nvim/eval/vars.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" #include "nvim/ex_getln.h" -#include "nvim/fileio.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" #include "nvim/globals.h" #include "nvim/insexpand.h" +#include "nvim/keycodes.h" #include "nvim/lua/executor.h" +#include "nvim/macros.h" +#include "nvim/mbyte.h" +#include "nvim/memline_defs.h" +#include "nvim/memory.h" +#include "nvim/message.h" +#include "nvim/option_defs.h" #include "nvim/os/input.h" +#include "nvim/path.h" #include "nvim/profile.h" #include "nvim/regexp.h" #include "nvim/runtime.h" #include "nvim/search.h" +#include "nvim/strings.h" #include "nvim/ui.h" #include "nvim/vim.h" diff --git a/src/nvim/eval/userfunc.h b/src/nvim/eval/userfunc.h @@ -1,8 +1,18 @@ #ifndef NVIM_EVAL_USERFUNC_H #define NVIM_EVAL_USERFUNC_H +#include <stdbool.h> +#include <stddef.h> + #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" +#include "nvim/garray.h" +#include "nvim/hashtab.h" +#include "nvim/pos.h" +#include "nvim/types.h" + +struct funccal_entry; // From user function to hashitem and back. #define UF2HIKEY(fp) ((fp)->uf_name) diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c @@ -3,24 +3,42 @@ // eval/vars.c: functions for dealing with variables +#include <assert.h> +#include <ctype.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> +#include <string.h> + #include "nvim/ascii.h" #include "nvim/autocmd.h" -#include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/drawscreen.h" #include "nvim/eval.h" #include "nvim/eval/encode.h" #include "nvim/eval/funcs.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/userfunc.h" #include "nvim/eval/vars.h" #include "nvim/ex_cmds.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/hashtab.h" +#include "nvim/macros.h" +#include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/ops.h" #include "nvim/option.h" -#include "nvim/screen.h" +#include "nvim/os/os.h" #include "nvim/search.h" +#include "nvim/strings.h" +#include "nvim/types.h" +#include "nvim/vim.h" #include "nvim/window.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/eval/vars.h b/src/nvim/eval/vars.h @@ -1,7 +1,7 @@ #ifndef NVIM_EVAL_VARS_H #define NVIM_EVAL_VARS_H -#include "nvim/ex_cmds_defs.h" // For exarg_T +#include "nvim/ex_cmds_defs.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval/vars.h.generated.h" diff --git a/src/nvim/event/libuv_process.c b/src/nvim/event/libuv_process.c @@ -1,14 +1,14 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include <assert.h> +#include <stdint.h> #include <uv.h> +#include "nvim/eval/typval.h" #include "nvim/event/libuv_process.h" #include "nvim/event/loop.h" #include "nvim/event/process.h" -#include "nvim/event/rstream.h" -#include "nvim/event/wstream.h" +#include "nvim/event/stream.h" #include "nvim/log.h" #include "nvim/macros.h" #include "nvim/os/os.h" diff --git a/src/nvim/event/libuv_process.h b/src/nvim/event/libuv_process.h @@ -3,6 +3,7 @@ #include <uv.h> +#include "nvim/event/loop.h" #include "nvim/event/process.h" typedef struct libuv_process { diff --git a/src/nvim/event/loop.c b/src/nvim/event/loop.c @@ -1,13 +1,16 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include <stdarg.h> +#include <stdbool.h> #include <stdint.h> +#include <stdlib.h> #include <uv.h> +#include "nvim/event/defs.h" #include "nvim/event/loop.h" -#include "nvim/event/process.h" #include "nvim/log.h" +#include "nvim/memory.h" +#include "nvim/os/time.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "event/loop.c.generated.h" diff --git a/src/nvim/event/multiqueue.c b/src/nvim/event/multiqueue.c @@ -46,14 +46,14 @@ // other sources and focus on a specific channel. #include <assert.h> -#include <stdarg.h> #include <stdbool.h> -#include <stdint.h> +#include <stddef.h> #include <uv.h> +#include "nvim/event/defs.h" #include "nvim/event/multiqueue.h" +#include "nvim/lib/queue.h" #include "nvim/memory.h" -#include "nvim/os/time.h" typedef struct multiqueue_item MultiQueueItem; struct multiqueue_item { diff --git a/src/nvim/event/process.c b/src/nvim/event/process.c @@ -2,20 +2,23 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <assert.h> +#include <inttypes.h> +#include <signal.h> #include <stdlib.h> #include <uv.h> +#include "klib/klist.h" #include "nvim/event/libuv_process.h" #include "nvim/event/loop.h" #include "nvim/event/process.h" -#include "nvim/event/rstream.h" -#include "nvim/event/wstream.h" #include "nvim/globals.h" #include "nvim/log.h" #include "nvim/macros.h" #include "nvim/os/process.h" #include "nvim/os/pty_process.h" #include "nvim/os/shell.h" +#include "nvim/os/time.h" +#include "nvim/rbuffer.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "event/process.c.generated.h" diff --git a/src/nvim/event/process.h b/src/nvim/event/process.h @@ -1,11 +1,20 @@ #ifndef NVIM_EVENT_PROCESS_H #define NVIM_EVENT_PROCESS_H +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> + #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/event/loop.h" +#include "nvim/event/multiqueue.h" #include "nvim/event/rstream.h" +#include "nvim/event/stream.h" #include "nvim/event/wstream.h" +struct process; + typedef enum { kProcessTypeUv, kProcessTypePty, diff --git a/src/nvim/event/rstream.c b/src/nvim/event/rstream.c @@ -3,17 +3,18 @@ #include <assert.h> #include <stdbool.h> +#include <stddef.h> #include <stdint.h> -#include <stdlib.h> #include <uv.h> -#include "nvim/ascii.h" #include "nvim/event/loop.h" #include "nvim/event/rstream.h" +#include "nvim/event/stream.h" #include "nvim/log.h" +#include "nvim/macros.h" #include "nvim/main.h" -#include "nvim/memory.h" -#include "nvim/vim.h" +#include "nvim/os/os_defs.h" +#include "nvim/rbuffer.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "event/rstream.c.generated.h" diff --git a/src/nvim/event/signal.c b/src/nvim/event/signal.c @@ -1,6 +1,7 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <stddef.h> #include <uv.h> #include "nvim/event/loop.h" diff --git a/src/nvim/event/signal.h b/src/nvim/event/signal.h @@ -4,6 +4,9 @@ #include <uv.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); diff --git a/src/nvim/event/socket.c b/src/nvim/event/socket.c @@ -2,23 +2,24 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <assert.h> -#include <stdint.h> +#include <inttypes.h> +#include <stdbool.h> +#include <stdio.h> +#include <string.h> #include <uv.h> #include "nvim/ascii.h" #include "nvim/charset.h" #include "nvim/event/loop.h" -#include "nvim/event/rstream.h" #include "nvim/event/socket.h" -#include "nvim/event/wstream.h" +#include "nvim/event/stream.h" +#include "nvim/gettext.h" #include "nvim/log.h" #include "nvim/macros.h" #include "nvim/main.h" #include "nvim/memory.h" #include "nvim/os/os.h" #include "nvim/path.h" -#include "nvim/strings.h" -#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "event/socket.c.generated.h" diff --git a/src/nvim/event/socket.h b/src/nvim/event/socket.h @@ -4,9 +4,12 @@ #include <uv.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; diff --git a/src/nvim/event/stream.c b/src/nvim/event/stream.c @@ -3,9 +3,11 @@ #include <assert.h> #include <stdbool.h> -#include <stdio.h> +#include <stddef.h> #include <uv.h> +#include <uv/version.h> +#include "nvim/event/loop.h" #include "nvim/event/stream.h" #include "nvim/log.h" #include "nvim/macros.h" diff --git a/src/nvim/event/stream.h b/src/nvim/event/stream.h @@ -6,8 +6,11 @@ #include <uv.h> #include "nvim/event/loop.h" +#include "nvim/event/multiqueue.h" #include "nvim/rbuffer.h" +struct stream; + typedef struct stream Stream; /// Type of function called when the Stream buffer is filled with data /// diff --git a/src/nvim/event/time.h b/src/nvim/event/time.h @@ -1,9 +1,13 @@ #ifndef NVIM_EVENT_TIME_H #define NVIM_EVENT_TIME_H +#include <stdbool.h> #include <uv.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); diff --git a/src/nvim/event/wstream.c b/src/nvim/event/wstream.c @@ -3,15 +3,13 @@ #include <assert.h> #include <stdbool.h> -#include <stdint.h> -#include <stdlib.h> #include <uv.h> #include "nvim/event/loop.h" +#include "nvim/event/stream.h" #include "nvim/event/wstream.h" -#include "nvim/log.h" +#include "nvim/macros.h" #include "nvim/memory.h" -#include "nvim/vim.h" #define DEFAULT_MAXMEM 1024 * 1024 * 2000 diff --git a/src/nvim/event/wstream.h b/src/nvim/event/wstream.h @@ -2,12 +2,15 @@ #define NVIM_EVENT_WSTREAM_H #include <stdbool.h> +#include <stddef.h> #include <stdint.h> #include <uv.h> #include "nvim/event/loop.h" #include "nvim/event/stream.h" +struct wbuffer; + typedef struct wbuffer WBuffer; typedef void (*wbuffer_data_finalizer)(void *data); diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c @@ -4,20 +4,27 @@ // ex_cmds.c: some functions for command line commands #include <assert.h> +#include <ctype.h> #include <float.h> #include <inttypes.h> #include <math.h> #include <stdbool.h> +#include <stddef.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> +#include <time.h> -#include "nvim/api/buffer.h" -#include "nvim/api/private/defs.h" +#include "auto/config.h" +#include "klib/kvec.h" #include "nvim/arglist.h" #include "nvim/ascii.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/buffer_updates.h" #include "nvim/change.h" +#include "nvim/channel.h" #include "nvim/charset.h" #include "nvim/cmdhist.h" #include "nvim/cursor.h" @@ -27,22 +34,26 @@ #include "nvim/drawscreen.h" #include "nvim/edit.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" #include "nvim/ex_cmds.h" #include "nvim/ex_cmds2.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" #include "nvim/ex_getln.h" #include "nvim/extmark.h" #include "nvim/fileio.h" #include "nvim/fold.h" -#include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/grid_defs.h" #include "nvim/help.h" -#include "nvim/highlight.h" +#include "nvim/highlight_defs.h" #include "nvim/highlight_group.h" #include "nvim/indent.h" #include "nvim/input.h" -#include "nvim/log.h" +#include "nvim/macros.h" #include "nvim/main.h" #include "nvim/mark.h" #include "nvim/mbyte.h" @@ -55,21 +66,22 @@ #include "nvim/ops.h" #include "nvim/option.h" #include "nvim/optionstr.h" +#include "nvim/os/fs_defs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/shell.h" #include "nvim/os/time.h" -#include "nvim/os_unix.h" #include "nvim/path.h" #include "nvim/plines.h" #include "nvim/profile.h" #include "nvim/quickfix.h" #include "nvim/regexp.h" +#include "nvim/screen.h" #include "nvim/search.h" #include "nvim/spell.h" #include "nvim/strings.h" -#include "nvim/syntax.h" -#include "nvim/tag.h" +#include "nvim/terminal.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/vim.h" diff --git a/src/nvim/ex_cmds.h b/src/nvim/ex_cmds.h @@ -5,6 +5,7 @@ #include "nvim/buffer_defs.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" #include "nvim/os/time.h" #include "nvim/pos.h" diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c @@ -6,9 +6,9 @@ /// Some more functions for command line commands #include <assert.h> -#include <fcntl.h> #include <inttypes.h> #include <stdbool.h> +#include <stdio.h> #include <string.h> #include "nvim/arglist.h" @@ -16,30 +16,33 @@ #include "nvim/autocmd.h" #include "nvim/buffer.h" #include "nvim/change.h" -#include "nvim/charset.h" +#include "nvim/channel.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/vars.h" #include "nvim/ex_cmds.h" #include "nvim/ex_cmds2.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" -#include "nvim/ex_eval.h" #include "nvim/ex_getln.h" #include "nvim/fileio.h" +#include "nvim/gettext.h" #include "nvim/globals.h" +#include "nvim/highlight_defs.h" +#include "nvim/macros.h" #include "nvim/mark.h" -#include "nvim/mbyte.h" +#include "nvim/memline_defs.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/move.h" #include "nvim/normal.h" -#include "nvim/ops.h" #include "nvim/option.h" -#include "nvim/os/fs_defs.h" -#include "nvim/os_unix.h" +#include "nvim/os/os_defs.h" #include "nvim/path.h" +#include "nvim/pos.h" #include "nvim/quickfix.h" #include "nvim/runtime.h" -#include "nvim/strings.h" #include "nvim/undo.h" #include "nvim/vim.h" #include "nvim/window.h" diff --git a/src/nvim/ex_cmds_defs.h b/src/nvim/ex_cmds_defs.h @@ -6,7 +6,7 @@ #include "nvim/eval/typval.h" #include "nvim/normal.h" -#include "nvim/pos.h" // for linenr_T +#include "nvim/pos.h" #include "nvim/regexp_defs.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c @@ -4,58 +4,57 @@ // ex_docmd.c: functions for executing an Ex command line. #include <assert.h> +#include <ctype.h> #include <inttypes.h> +#include <limits.h> #include <stdbool.h> +#include <stddef.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> +#include "auto/config.h" #include "nvim/arglist.h" #include "nvim/ascii.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" #include "nvim/change.h" #include "nvim/charset.h" #include "nvim/cmdexpand.h" -#include "nvim/cmdhist.h" #include "nvim/cursor.h" #include "nvim/debugger.h" -#include "nvim/diff.h" #include "nvim/digraph.h" #include "nvim/drawscreen.h" #include "nvim/edit.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/userfunc.h" -#include "nvim/eval/vars.h" -#include "nvim/event/rstream.h" -#include "nvim/event/wstream.h" +#include "nvim/event/loop.h" #include "nvim/ex_cmds.h" #include "nvim/ex_cmds2.h" #include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" #include "nvim/ex_getln.h" -#include "nvim/ex_session.h" #include "nvim/file_search.h" #include "nvim/fileio.h" #include "nvim/fold.h" -#include "nvim/func_attr.h" #include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" #include "nvim/globals.h" -#include "nvim/hardcopy.h" -#include "nvim/help.h" +#include "nvim/highlight_defs.h" #include "nvim/highlight_group.h" #include "nvim/input.h" #include "nvim/keycodes.h" -#include "nvim/locale.h" -#include "nvim/lua/executor.h" +#include "nvim/macros.h" #include "nvim/main.h" -#include "nvim/mapping.h" #include "nvim/mark.h" -#include "nvim/match.h" #include "nvim/mbyte.h" +#include "nvim/memfile_defs.h" #include "nvim/memline.h" #include "nvim/memory.h" -#include "nvim/menu.h" #include "nvim/message.h" #include "nvim/mouse.h" #include "nvim/move.h" @@ -65,29 +64,25 @@ #include "nvim/optionstr.h" #include "nvim/os/input.h" #include "nvim/os/os.h" -#include "nvim/os/time.h" -#include "nvim/os_unix.h" +#include "nvim/os/shell.h" #include "nvim/path.h" #include "nvim/popupmenu.h" +#include "nvim/pos.h" #include "nvim/profile.h" #include "nvim/quickfix.h" #include "nvim/regexp.h" +#include "nvim/runtime.h" +#include "nvim/screen.h" #include "nvim/search.h" #include "nvim/shada.h" -#include "nvim/sign.h" -#include "nvim/spell.h" -#include "nvim/spellfile.h" #include "nvim/state.h" #include "nvim/statusline.h" #include "nvim/strings.h" -#include "nvim/syntax.h" #include "nvim/tag.h" -#include "nvim/terminal.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/undo.h" -#include "nvim/undo_defs.h" #include "nvim/usercmd.h" -#include "nvim/version.h" #include "nvim/vim.h" #include "nvim/window.h" diff --git a/src/nvim/ex_docmd.h b/src/nvim/ex_docmd.h @@ -1,6 +1,9 @@ #ifndef NVIM_EX_DOCMD_H #define NVIM_EX_DOCMD_H +#include <stdbool.h> + +#include "nvim/buffer_defs.h" #include "nvim/ex_cmds_defs.h" #include "nvim/globals.h" diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c @@ -10,19 +10,30 @@ #include <inttypes.h> #include <limits.h> #include <stdbool.h> +#include <stdio.h> +#include <string.h> #include "nvim/ascii.h" #include "nvim/charset.h" #include "nvim/debugger.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/userfunc.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" +#include "nvim/ex_eval_defs.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/memory.h" #include "nvim/message.h" +#include "nvim/option_defs.h" +#include "nvim/pos.h" #include "nvim/regexp.h" #include "nvim/runtime.h" #include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/ex_eval.h b/src/nvim/ex_eval.h @@ -1,7 +1,7 @@ #ifndef NVIM_EX_EVAL_H #define NVIM_EX_EVAL_H -#include "nvim/ex_cmds_defs.h" // for exarg_T +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_eval_defs.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/ex_eval_defs.h b/src/nvim/ex_eval_defs.h @@ -1,7 +1,7 @@ #ifndef NVIM_EX_EVAL_DEFS_H #define NVIM_EX_EVAL_DEFS_H -#include "nvim/pos.h" // for linenr_T +#include "nvim/pos.h" /// There is no CSF_IF, the lack of CSF_WHILE, CSF_FOR and CSF_TRY means ":if" /// was used. diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c @@ -5,44 +5,45 @@ #include <assert.h> #include <inttypes.h> +#include <limits.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> +#include <time.h> #include "klib/kvec.h" #include "nvim/api/extmark.h" +#include "nvim/api/private/defs.h" +#include "nvim/api/private/helpers.h" #include "nvim/api/vim.h" #include "nvim/arabic.h" #include "nvim/ascii.h" -#include "nvim/assert.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" #include "nvim/charset.h" #include "nvim/cmdexpand.h" #include "nvim/cmdhist.h" #include "nvim/cursor.h" -#include "nvim/cursor_shape.h" #include "nvim/digraph.h" #include "nvim/drawscreen.h" #include "nvim/edit.h" #include "nvim/eval.h" -#include "nvim/event/loop.h" +#include "nvim/eval/typval.h" #include "nvim/ex_cmds.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" #include "nvim/ex_getln.h" -#include "nvim/fileio.h" -#include "nvim/func_attr.h" +#include "nvim/extmark.h" #include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" #include "nvim/globals.h" #include "nvim/grid.h" -#include "nvim/highlight.h" #include "nvim/highlight_defs.h" #include "nvim/highlight_group.h" -#include "nvim/indent.h" #include "nvim/keycodes.h" -#include "nvim/log.h" -#include "nvim/main.h" +#include "nvim/macros.h" #include "nvim/mapping.h" #include "nvim/mark.h" #include "nvim/mbyte.h" @@ -51,15 +52,18 @@ #include "nvim/message.h" #include "nvim/mouse.h" #include "nvim/move.h" +#include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" #include "nvim/optionstr.h" #include "nvim/os/input.h" -#include "nvim/os/time.h" +#include "nvim/os/os.h" #include "nvim/path.h" #include "nvim/popupmenu.h" +#include "nvim/pos.h" #include "nvim/profile.h" #include "nvim/regexp.h" +#include "nvim/screen.h" #include "nvim/search.h" #include "nvim/state.h" #include "nvim/strings.h" diff --git a/src/nvim/ex_getln.h b/src/nvim/ex_getln.h @@ -1,10 +1,16 @@ #ifndef NVIM_EX_GETLN_H #define NVIM_EX_GETLN_H +#include <stdbool.h> + +#include "klib/kvec.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" #include "nvim/types.h" +struct cmdline_info; + /// Command-line colors: one chunk /// /// Defines a region which has the same highlighting. diff --git a/src/nvim/ex_session.c b/src/nvim/ex_session.c @@ -9,32 +9,36 @@ #include <assert.h> #include <inttypes.h> +#include <limits.h> #include <stdbool.h> -#include <stdlib.h> +#include <stdio.h> #include <string.h> #include "nvim/arglist.h" #include "nvim/ascii.h" #include "nvim/buffer.h" -#include "nvim/cursor.h" -#include "nvim/edit.h" #include "nvim/eval.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/ex_getln.h" #include "nvim/ex_session.h" #include "nvim/file_search.h" #include "nvim/fileio.h" #include "nvim/fold.h" +#include "nvim/garray.h" +#include "nvim/gettext.h" #include "nvim/globals.h" -#include "nvim/keycodes.h" +#include "nvim/macros.h" #include "nvim/mapping.h" -#include "nvim/move.h" +#include "nvim/mark_defs.h" +#include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/option.h" -#include "nvim/os/input.h" #include "nvim/os/os.h" -#include "nvim/os/time.h" #include "nvim/path.h" +#include "nvim/pos.h" #include "nvim/runtime.h" +#include "nvim/types.h" #include "nvim/vim.h" #include "nvim/window.h" diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c @@ -29,20 +29,21 @@ // code for redrawing the line with the deleted decoration. #include <assert.h> +#include <sys/types.h> -#include "klib/kbtree.h" -#include "nvim/api/extmark.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/buffer_updates.h" -#include "nvim/charset.h" #include "nvim/decoration.h" #include "nvim/extmark.h" +#include "nvim/extmark_defs.h" #include "nvim/globals.h" #include "nvim/map.h" +#include "nvim/marktree.h" #include "nvim/memline.h" +#include "nvim/memory.h" #include "nvim/pos.h" #include "nvim/undo.h" -#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "extmark.c.generated.h" diff --git a/src/nvim/extmark.h b/src/nvim/extmark.h @@ -1,11 +1,18 @@ #ifndef NVIM_EXTMARK_H #define NVIM_EXTMARK_H +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> + +#include "klib/kvec.h" #include "nvim/buffer_defs.h" #include "nvim/decoration.h" #include "nvim/extmark_defs.h" +#include "nvim/macros.h" #include "nvim/marktree.h" #include "nvim/pos.h" +#include "nvim/types.h" EXTERN int extmark_splice_pending INIT(= 0); diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c @@ -47,25 +47,30 @@ #include <inttypes.h> #include <limits.h> #include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> #include "nvim/ascii.h" #include "nvim/autocmd.h" -#include "nvim/charset.h" +#include "nvim/buffer_defs.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/file_search.h" -#include "nvim/fileio.h" +#include "nvim/gettext.h" #include "nvim/globals.h" +#include "nvim/macros.h" +#include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" #include "nvim/os/fs_defs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" -#include "nvim/os_unix.h" #include "nvim/path.h" #include "nvim/strings.h" -#include "nvim/tag.h" +#include "nvim/types.h" #include "nvim/vim.h" #include "nvim/window.h" diff --git a/src/nvim/file_search.h b/src/nvim/file_search.h @@ -1,10 +1,10 @@ #ifndef NVIM_FILE_SEARCH_H #define NVIM_FILE_SEARCH_H -#include <stdlib.h> // for size_t +#include <stdlib.h> -#include "nvim/globals.h" // for CdScope -#include "nvim/types.h" // for char_u +#include "nvim/globals.h" +#include "nvim/types.h" // Flags for find_file_*() functions. #define FINDFILE_FILE 0 // only files diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c @@ -6,62 +6,68 @@ #include <assert.h> #include <errno.h> #include <fcntl.h> +#include <iconv.h> #include <inttypes.h> +#include <limits.h> #include <stdbool.h> +#include <stdio.h> #include <string.h> +#include <sys/stat.h> +#include <uv.h> -#include "nvim/api/private/helpers.h" +#include "auto/config.h" #include "nvim/ascii.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/buffer_updates.h" #include "nvim/change.h" -#include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/diff.h" #include "nvim/drawscreen.h" #include "nvim/edit.h" #include "nvim/eval.h" -#include "nvim/eval/typval.h" -#include "nvim/eval/userfunc.h" #include "nvim/ex_cmds.h" -#include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" #include "nvim/fileio.h" #include "nvim/fold.h" -#include "nvim/func_attr.h" #include "nvim/garray.h" #include "nvim/getchar.h" -#include "nvim/hashtab.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/highlight_defs.h" #include "nvim/iconv.h" #include "nvim/input.h" +#include "nvim/log.h" +#include "nvim/macros.h" #include "nvim/mbyte.h" #include "nvim/memfile.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/move.h" -#include "nvim/normal.h" #include "nvim/option.h" #include "nvim/optionstr.h" +#include "nvim/os/fs_defs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" -#include "nvim/os/os_defs.h" #include "nvim/os/time.h" #include "nvim/os_unix.h" #include "nvim/path.h" -#include "nvim/quickfix.h" +#include "nvim/pos.h" #include "nvim/regexp.h" -#include "nvim/search.h" +#include "nvim/screen.h" #include "nvim/sha256.h" #include "nvim/shada.h" -#include "nvim/state.h" #include "nvim/strings.h" #include "nvim/types.h" #include "nvim/ui.h" -#include "nvim/ui_compositor.h" #include "nvim/undo.h" #include "nvim/vim.h" -#include "nvim/window.h" + +#ifdef OPEN_CHR_FILES +# include "nvim/charset.h" +#endif #define BUFSIZE 8192 // size of normal write buffer #define SMBUFSIZE 256 // size of emergency write buffer diff --git a/src/nvim/fileio.h b/src/nvim/fileio.h @@ -3,6 +3,7 @@ #include "nvim/buffer_defs.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/garray.h" #include "nvim/os/os.h" diff --git a/src/nvim/fold.c b/src/nvim/fold.c @@ -5,10 +5,15 @@ // fold.c: code for folding +#include <assert.h> #include <inttypes.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> #include "nvim/ascii.h" +#include "nvim/buffer_defs.h" #include "nvim/buffer_updates.h" #include "nvim/change.h" #include "nvim/charset.h" @@ -16,14 +21,17 @@ #include "nvim/diff.h" #include "nvim/drawscreen.h" #include "nvim/eval.h" -#include "nvim/ex_docmd.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_session.h" #include "nvim/extmark.h" #include "nvim/fold.h" -#include "nvim/func_attr.h" #include "nvim/garray.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/indent.h" #include "nvim/mark.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" @@ -35,6 +43,7 @@ #include "nvim/search.h" #include "nvim/strings.h" #include "nvim/syntax.h" +#include "nvim/types.h" #include "nvim/undo.h" #include "nvim/vim.h" diff --git a/src/nvim/fold.h b/src/nvim/fold.h @@ -5,6 +5,7 @@ #include "nvim/buffer_defs.h" #include "nvim/garray.h" +#include "nvim/macros.h" #include "nvim/pos.h" #include "nvim/types.h" diff --git a/src/nvim/garray.c b/src/nvim/garray.c @@ -5,22 +5,17 @@ /// /// Functions for handling growing arrays. -#include <inttypes.h> #include <string.h> -#include "nvim/ascii.h" #include "nvim/garray.h" #include "nvim/log.h" #include "nvim/memory.h" #include "nvim/path.h" #include "nvim/strings.h" -#include "nvim/vim.h" - -// #include "nvim/globals.h" -#include "nvim/memline.h" +#include "nvim/types.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "garray.c.generated.h" +# include "garray.c.generated.h" // IWYU pragma: export #endif /// Clear an allocated growing array. diff --git a/src/nvim/garray.h b/src/nvim/garray.h @@ -1,9 +1,11 @@ #ifndef NVIM_GARRAY_H #define NVIM_GARRAY_H -#include <stddef.h> // for size_t +#include <stdbool.h> +#include <stddef.h> #include "nvim/log.h" +#include "nvim/memory.h" #include "nvim/types.h" /// Structure used for growing arrays. diff --git a/src/nvim/generators/gen_api_dispatch.lua b/src/nvim/generators/gen_api_dispatch.lua @@ -189,6 +189,35 @@ funcs_metadata_output:close() -- start building the dispatch wrapper output local output = io.open(dispatch_outputf, 'wb') + +-- =========================================================================== +-- NEW API FILES MUST GO HERE. +-- +-- When creating a new API file, you must include it here, +-- so that the dispatcher can find the C functions that you are creating! +-- =========================================================================== +output:write([[ +#include "nvim/log.h" +#include "nvim/map.h" +#include "nvim/msgpack_rpc/helpers.h" +#include "nvim/vim.h" + +#include "nvim/api/autocmd.h" +#include "nvim/api/buffer.h" +#include "nvim/api/command.h" +#include "nvim/api/deprecated.h" +#include "nvim/api/extmark.h" +#include "nvim/api/options.h" +#include "nvim/api/tabpage.h" +#include "nvim/api/ui.h" +#include "nvim/api/vim.h" +#include "nvim/api/vimscript.h" +#include "nvim/api/win_config.h" +#include "nvim/api/window.h" +#include "nvim/ui_client.h" + +]]) + local function real_type(type) local rv = type local rmatch = string.match(type, "Dict%(([_%w]+)%)") diff --git a/src/nvim/generators/gen_eval.lua b/src/nvim/generators/gen_eval.lua @@ -27,6 +27,31 @@ local hashy = require'generators.hashy' local hashpipe = io.open(funcsfname, 'wb') +hashpipe:write([[ +#include "nvim/arglist.h" +#include "nvim/cmdexpand.h" +#include "nvim/cmdhist.h" +#include "nvim/digraph.h" +#include "nvim/eval/funcs.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/vars.h" +#include "nvim/ex_docmd.h" +#include "nvim/ex_getln.h" +#include "nvim/fold.h" +#include "nvim/getchar.h" +#include "nvim/insexpand.h" +#include "nvim/mapping.h" +#include "nvim/match.h" +#include "nvim/mbyte.h" +#include "nvim/menu.h" +#include "nvim/move.h" +#include "nvim/quickfix.h" +#include "nvim/search.h" +#include "nvim/sign.h" +#include "nvim/testing.h" + +]]) + local funcs = require('eval').funcs for _, func in pairs(funcs) do if func.float_func then diff --git a/src/nvim/generators/gen_ex_cmds.lua b/src/nvim/generators/gen_ex_cmds.lua @@ -49,6 +49,43 @@ enumfile:write([[ typedef enum CMD_index { ]]) defsfile:write(string.format([[ +#include "nvim/arglist.h" +#include "nvim/autocmd.h" +#include "nvim/buffer.h" +#include "nvim/cmdhist.h" +#include "nvim/debugger.h" +#include "nvim/diff.h" +#include "nvim/digraph.h" +#include "nvim/eval.h" +#include "nvim/eval/userfunc.h" +#include "nvim/eval/vars.h" +#include "nvim/ex_cmds.h" +#include "nvim/ex_cmds2.h" +#include "nvim/ex_docmd.h" +#include "nvim/ex_eval.h" +#include "nvim/ex_session.h" +#include "nvim/hardcopy.h" +#include "nvim/help.h" +#include "nvim/locale.h" +#include "nvim/lua/executor.h" +#include "nvim/mapping.h" +#include "nvim/mark.h" +#include "nvim/match.h" +#include "nvim/menu.h" +#include "nvim/message.h" +#include "nvim/ops.h" +#include "nvim/option.h" +#include "nvim/profile.h" +#include "nvim/quickfix.h" +#include "nvim/runtime.h" +#include "nvim/sign.h" +#include "nvim/spell.h" +#include "nvim/spellfile.h" +#include "nvim/syntax.h" +#include "nvim/undo.h" +#include "nvim/usercmd.h" +#include "nvim/version.h" + static const int command_count = %u; static CommandDefinition cmdnames[%u] = { ]], #defs, #defs)) diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c @@ -7,11 +7,15 @@ #include <assert.h> #include <inttypes.h> #include <stdbool.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> +#include "lauxlib.h" +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" -#include "nvim/assert.h" #include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cursor.h" @@ -19,16 +23,21 @@ #include "nvim/edit.h" #include "nvim/eval.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/event/loop.h" +#include "nvim/event/multiqueue.h" #include "nvim/ex_cmds.h" #include "nvim/ex_docmd.h" #include "nvim/ex_getln.h" #include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/input.h" #include "nvim/insexpand.h" #include "nvim/keycodes.h" #include "nvim/lua/executor.h" +#include "nvim/macros.h" #include "nvim/main.h" #include "nvim/mapping.h" #include "nvim/mbyte.h" @@ -44,8 +53,11 @@ #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/plines.h" +#include "nvim/pos.h" +#include "nvim/screen.h" #include "nvim/state.h" #include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/vim.h" diff --git a/src/nvim/grid.c b/src/nvim/grid.c @@ -11,9 +11,19 @@ // // The grid_*() functions write to the screen and handle updating grid->lines[]. +#include <assert.h> +#include <limits.h> +#include <stdlib.h> + #include "nvim/arabic.h" +#include "nvim/buffer_defs.h" +#include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/highlight.h" +#include "nvim/log.h" +#include "nvim/message.h" +#include "nvim/option_defs.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/vim.h" diff --git a/src/nvim/grid.h b/src/nvim/grid.h @@ -2,11 +2,14 @@ #define NVIM_GRID_H #include <stdbool.h> +#include <string.h> #include "nvim/ascii.h" #include "nvim/buffer_defs.h" #include "nvim/grid_defs.h" +#include "nvim/macros.h" #include "nvim/mbyte.h" +#include "nvim/memory.h" /// By default, all windows are drawn on a single rectangular grid, represented by /// this ScreenGrid instance. In multigrid mode each window will have its own diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c @@ -4,20 +4,28 @@ // hardcopy.c: printing to paper #include <assert.h> -#include <inttypes.h> +#include <ctype.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> #include "nvim/ascii.h" #include "nvim/buffer.h" #include "nvim/charset.h" #include "nvim/eval.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/fileio.h" #include "nvim/garray.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/hardcopy.h" +#include "nvim/highlight_defs.h" #include "nvim/highlight_group.h" #include "nvim/indent.h" +#include "nvim/macros.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" @@ -25,7 +33,9 @@ #include "nvim/option.h" #include "nvim/os/input.h" #include "nvim/os/os.h" +#include "nvim/os/time.h" #include "nvim/path.h" +#include "nvim/pos.h" #include "nvim/runtime.h" #include "nvim/statusline.h" #include "nvim/strings.h" diff --git a/src/nvim/hardcopy.h b/src/nvim/hardcopy.h @@ -2,11 +2,11 @@ #define NVIM_HARDCOPY_H #include <stdint.h> -#include <stdlib.h> // for size_t +#include <stdlib.h> -#include "nvim/ex_cmds_defs.h" // for exarg_T -#include "nvim/globals.h" // for TriState -#include "nvim/types.h" // for char_u +#include "nvim/ex_cmds_defs.h" +#include "nvim/globals.h" +#include "nvim/types.h" // Structure to hold printing color and font attributes. typedef struct { diff --git a/src/nvim/help.c b/src/nvim/help.c @@ -3,26 +3,39 @@ // help.c: functions for Vim help +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> +#include "nvim/ascii.h" #include "nvim/buffer.h" #include "nvim/charset.h" #include "nvim/cmdexpand.h" #include "nvim/ex_cmds.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/fileio.h" #include "nvim/garray.h" +#include "nvim/gettext.h" #include "nvim/globals.h" #include "nvim/help.h" +#include "nvim/macros.h" +#include "nvim/mbyte.h" +#include "nvim/memline.h" #include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/option.h" #include "nvim/optionstr.h" #include "nvim/os/input.h" +#include "nvim/os/os.h" #include "nvim/path.h" +#include "nvim/pos.h" +#include "nvim/runtime.h" #include "nvim/strings.h" #include "nvim/syntax.h" #include "nvim/tag.h" +#include "nvim/types.h" #include "nvim/vim.h" #include "nvim/window.h" diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c @@ -3,18 +3,31 @@ // highlight.c: low level code for UI and syntax highlighting +#include <assert.h> +#include <inttypes.h> +#include <limits.h> +#include <string.h> + +#include "klib/kvec.h" +#include "lauxlib.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/decoration_provider.h" #include "nvim/drawscreen.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/highlight.h" #include "nvim/highlight_defs.h" #include "nvim/highlight_group.h" +#include "nvim/log.h" #include "nvim/lua/executor.h" +#include "nvim/macros.h" #include "nvim/map.h" +#include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" #include "nvim/popupmenu.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/vim.h" diff --git a/src/nvim/highlight.h b/src/nvim/highlight.h @@ -6,6 +6,7 @@ #include "nvim/api/private/defs.h" #include "nvim/buffer_defs.h" #include "nvim/highlight_defs.h" +#include "nvim/option_defs.h" #include "nvim/ui.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c @@ -3,23 +3,45 @@ // highlight_group.c: code for managing highlight groups +#include <ctype.h> #include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" +#include "nvim/ascii.h" #include "nvim/autocmd.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cursor_shape.h" +#include "nvim/decoration_provider.h" #include "nvim/drawscreen.h" #include "nvim/eval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/vars.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" -#include "nvim/fold.h" +#include "nvim/garray.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/grid_defs.h" #include "nvim/highlight.h" #include "nvim/highlight_group.h" #include "nvim/lua/executor.h" -#include "nvim/match.h" +#include "nvim/macros.h" +#include "nvim/map.h" +#include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/option.h" +#include "nvim/os/time.h" #include "nvim/runtime.h" +#include "nvim/strings.h" +#include "nvim/types.h" +#include "nvim/ui.h" +#include "nvim/vim.h" /// \addtogroup SG_SET /// @{ diff --git a/src/nvim/indent.c b/src/nvim/indent.c @@ -2,8 +2,10 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <assert.h> -#include <inttypes.h> +#include <limits.h> #include <stdbool.h> +#include <stdlib.h> +#include <string.h> #include "nvim/ascii.h" #include "nvim/assert.h" @@ -13,21 +15,28 @@ #include "nvim/cursor.h" #include "nvim/edit.h" #include "nvim/eval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/extmark.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/indent.h" #include "nvim/indent_c.h" #include "nvim/mark.h" #include "nvim/memline.h" #include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/move.h" #include "nvim/option.h" #include "nvim/plines.h" +#include "nvim/pos.h" #include "nvim/regexp.h" #include "nvim/screen.h" #include "nvim/search.h" #include "nvim/strings.h" #include "nvim/textformat.h" +#include "nvim/types.h" #include "nvim/undo.h" +#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "indent.c.generated.h" diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c @@ -1,21 +1,29 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include <assert.h> #include <inttypes.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdlib.h> +#include <string.h> #include "nvim/ascii.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/edit.h" +#include "nvim/globals.h" #include "nvim/indent.h" #include "nvim/indent_c.h" +#include "nvim/macros.h" #include "nvim/mark.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/option.h" +#include "nvim/pos.h" #include "nvim/search.h" #include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/vim.h" // Find result cache for cpp_baseclass diff --git a/src/nvim/input.c b/src/nvim/input.c @@ -4,21 +4,29 @@ // input.c: high level functions for prompting the user or input // like yes/no or number prompts. -#include <inttypes.h> #include <stdbool.h> +#include <string.h> +#include "nvim/ascii.h" +#include "nvim/event/multiqueue.h" #include "nvim/func_attr.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/highlight_defs.h" #include "nvim/input.h" +#include "nvim/keycodes.h" #include "nvim/mbyte.h" #include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/mouse.h" #include "nvim/os/input.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "input.c.generated.h" +# include "input.c.generated.h" // IWYU pragma: export #endif /// Ask for a reply from the user, 'y' or 'n' diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c @@ -4,11 +4,15 @@ // insexpand.c: functions for Insert mode completion #include <assert.h> -#include <inttypes.h> +#include <limits.h> #include <stdbool.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> #include "nvim/ascii.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" #include "nvim/change.h" #include "nvim/charset.h" @@ -18,37 +22,48 @@ #include "nvim/edit.h" #include "nvim/eval.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/userfunc.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" #include "nvim/ex_getln.h" #include "nvim/fileio.h" +#include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/highlight_defs.h" #include "nvim/indent.h" #include "nvim/indent_c.h" #include "nvim/insexpand.h" #include "nvim/keycodes.h" +#include "nvim/macros.h" +#include "nvim/mark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/move.h" #include "nvim/option.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/time.h" #include "nvim/path.h" #include "nvim/popupmenu.h" +#include "nvim/pos.h" #include "nvim/regexp.h" +#include "nvim/screen.h" #include "nvim/search.h" #include "nvim/spell.h" #include "nvim/state.h" #include "nvim/strings.h" #include "nvim/tag.h" #include "nvim/textformat.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/vim.h" -#include "nvim/window.h" // Definitions used for CTRL-X submode. // Note: If you change CTRL-X submode, you must also maintain ctrl_x_msgs[] diff --git a/src/nvim/insexpand.h b/src/nvim/insexpand.h @@ -1,6 +1,9 @@ #ifndef NVIM_INSEXPAND_H #define NVIM_INSEXPAND_H +#include <stdbool.h> + +#include "nvim/macros.h" #include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/keycodes.c b/src/nvim/keycodes.c @@ -4,16 +4,25 @@ #include <assert.h> #include <inttypes.h> #include <limits.h> +#include <stdbool.h> +#include <stdio.h> +#include <string.h> #include "nvim/ascii.h" #include "nvim/charset.h" -#include "nvim/edit.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/vars.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/keycodes.h" +#include "nvim/log.h" +#include "nvim/macros.h" +#include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/mouse.h" #include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/keycodes.h b/src/nvim/keycodes.h @@ -1,6 +1,10 @@ #ifndef NVIM_KEYCODES_H #define NVIM_KEYCODES_H +#include <stddef.h> + +#include "nvim/ascii.h" +#include "nvim/option_defs.h" #include "nvim/strings.h" // Keycode definitions for special keys. diff --git a/src/nvim/linematch.c b/src/nvim/linematch.c @@ -1,4 +1,10 @@ +#include <assert.h> +#include <stdbool.h> +#include <stddef.h> +#include <string.h> + #include "nvim/linematch.h" +#include "nvim/macros.h" #include "nvim/memory.h" #include "nvim/vim.h" diff --git a/src/nvim/locale.c b/src/nvim/locale.c @@ -3,8 +3,10 @@ // locale.c: functions for language/locale configuration -#include "auto/config.h" +#include <stdbool.h> +#include <stdio.h> +#include "auto/config.h" #ifdef HAVE_LOCALE_H # include <locale.h> #endif @@ -13,8 +15,11 @@ #include "nvim/buffer.h" #include "nvim/charset.h" #include "nvim/eval.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/garray.h" +#include "nvim/gettext.h" #include "nvim/locale.h" +#include "nvim/macros.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" @@ -23,6 +28,7 @@ #include "nvim/path.h" #include "nvim/profile.h" #include "nvim/types.h" +#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "locale.c.generated.h" diff --git a/src/nvim/log.c b/src/nvim/log.c @@ -9,21 +9,27 @@ // #include <assert.h> +#include <errno.h> #include <inttypes.h> #include <stdarg.h> #include <stdbool.h> #include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> #include <uv.h> #include "auto/config.h" +#include "nvim/ascii.h" #include "nvim/eval.h" +#include "nvim/globals.h" #include "nvim/log.h" -#include "nvim/main.h" +#include "nvim/memory.h" #include "nvim/message.h" #include "nvim/os/os.h" +#include "nvim/os/stdpaths_defs.h" #include "nvim/os/time.h" #include "nvim/path.h" -#include "nvim/types.h" /// Cached location of the expanded log file path decided by log_path_init(). static char log_file_path[MAXPATHL + 1] = { 0 }; diff --git a/src/nvim/log.h b/src/nvim/log.h @@ -11,6 +11,7 @@ // NVIM_PROBE(nvim_foo_bar, 1, string.data); #if defined(HAVE_SYS_SDT_H) # include <sys/sdt.h> // NOLINT + # define NVIM_PROBE(name, n, ...) STAP_PROBE##n(neovim, name, __VA_ARGS__) #else # define NVIM_PROBE(name, n, ...) diff --git a/src/nvim/lua/converter.c b/src/nvim/lua/converter.c @@ -4,14 +4,14 @@ #include <assert.h> #include <lauxlib.h> #include <lua.h> -#include <lualib.h> #include <stdbool.h> +#include <stddef.h> #include <stdint.h> +#include <stdlib.h> +#include <string.h> #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" -#include "nvim/assert.h" -#include "nvim/func_attr.h" #include "nvim/memory.h" // FIXME: vim.h is not actually needed, but otherwise it states MAXPATHL is // redefined @@ -19,12 +19,16 @@ #include "nvim/ascii.h" #include "nvim/eval/decode.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/eval/typval_encode.h" #include "nvim/eval/userfunc.h" -#include "nvim/globals.h" +#include "nvim/garray.h" +#include "nvim/gettext.h" #include "nvim/lua/converter.h" #include "nvim/lua/executor.h" #include "nvim/macros.h" #include "nvim/message.h" +#include "nvim/types.h" #include "nvim/vim.h" /// Determine, which keys lua table contains @@ -565,6 +569,7 @@ static bool typval_conv_special = false; #define TYPVAL_ENCODE_FIRST_ARG_TYPE lua_State *const #define TYPVAL_ENCODE_FIRST_ARG_NAME lstate #include "nvim/eval/typval_encode.c.h" + #undef TYPVAL_ENCODE_SCOPE #undef TYPVAL_ENCODE_NAME #undef TYPVAL_ENCODE_FIRST_ARG_TYPE diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c @@ -1,18 +1,22 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <assert.h> +#include <inttypes.h> #include <lauxlib.h> #include <lua.h> #include <lualib.h> +#include <stddef.h> +#include <string.h> #include <tree_sitter/api.h> +#include <uv.h> +#include "klib/kvec.h" #include "luv/luv.h" #include "nvim/api/extmark.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" -#include "nvim/api/vim.h" #include "nvim/ascii.h" -#include "nvim/assert.h" #include "nvim/buffer_defs.h" #include "nvim/change.h" #include "nvim/cursor.h" @@ -20,28 +24,37 @@ #include "nvim/eval.h" #include "nvim/eval/funcs.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #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" #include "nvim/ex_getln.h" -#include "nvim/extmark.h" -#include "nvim/func_attr.h" #include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/keycodes.h" #include "nvim/lua/converter.h" #include "nvim/lua/executor.h" #include "nvim/lua/stdlib.h" #include "nvim/lua/treesitter.h" #include "nvim/macros.h" -#include "nvim/map.h" +#include "nvim/main.h" #include "nvim/memline.h" +#include "nvim/memory.h" #include "nvim/message.h" #include "nvim/msgpack_rpc/channel.h" +#include "nvim/option_defs.h" #include "nvim/os/os.h" +#include "nvim/path.h" +#include "nvim/pos.h" #include "nvim/profile.h" #include "nvim/runtime.h" -#include "nvim/screen.h" +#include "nvim/strings.h" #include "nvim/ui.h" #include "nvim/ui_compositor.h" #include "nvim/undo.h" diff --git a/src/nvim/lua/executor.h b/src/nvim/lua/executor.h @@ -3,13 +3,17 @@ #include <lauxlib.h> #include <lua.h> +#include <stdbool.h> #include "nvim/api/private/defs.h" +#include "nvim/api/private/helpers.h" #include "nvim/assert.h" #include "nvim/eval/typval.h" #include "nvim/ex_cmds_defs.h" #include "nvim/func_attr.h" #include "nvim/lua/converter.h" +#include "nvim/macros.h" +#include "nvim/types.h" #include "nvim/usercmd.h" // Generated by msgpack-gen.lua diff --git a/src/nvim/lua/spell.c b/src/nvim/lua/spell.c @@ -1,15 +1,25 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <assert.h> #include <lauxlib.h> +#include <limits.h> #include <lua.h> - +#include <stdbool.h> +#include <stddef.h> + +#include "nvim/ascii.h" +#include "nvim/buffer_defs.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/highlight_defs.h" #include "nvim/lua/spell.h" +#include "nvim/message.h" #include "nvim/spell.h" -#include "nvim/vim.h" +#include "nvim/types.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "lua/spell.c.generated.h" +# include "lua/spell.c.generated.h" // IWYU pragma: export #endif int nlua_spell_check(lua_State *lstate) diff --git a/src/nvim/lua/stdlib.c b/src/nvim/lua/stdlib.c @@ -1,50 +1,39 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <assert.h> #include <lauxlib.h> #include <lua.h> -#include <lualib.h> - +#include <stdarg.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> +#include <string.h> +#include <sys/types.h> + +#include "auto/config.h" #include "cjson/lua_cjson.h" -#include "luv/luv.h" #include "mpack/lmpack.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" -#include "nvim/api/vim.h" #include "nvim/ascii.h" -#include "nvim/assert.h" #include "nvim/buffer_defs.h" -#include "nvim/change.h" -#include "nvim/cursor.h" #include "nvim/eval.h" -#include "nvim/eval/userfunc.h" -#include "nvim/event/loop.h" -#include "nvim/event/time.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_eval.h" -#include "nvim/ex_getln.h" -#include "nvim/extmark.h" -#include "nvim/func_attr.h" -#include "nvim/garray.h" -#include "nvim/getchar.h" #include "nvim/globals.h" #include "nvim/lua/converter.h" -#include "nvim/lua/executor.h" #include "nvim/lua/spell.h" #include "nvim/lua/stdlib.h" -#include "nvim/lua/treesitter.h" #include "nvim/lua/xdiff.h" -#include "nvim/macros.h" #include "nvim/map.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" -#include "nvim/message.h" -#include "nvim/msgpack_rpc/channel.h" -#include "nvim/os/os.h" +#include "nvim/memory.h" +#include "nvim/pos.h" #include "nvim/regexp.h" -#include "nvim/regexp_defs.h" -#include "nvim/screen.h" #include "nvim/types.h" -#include "nvim/undo.h" -#include "nvim/version.h" #include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c @@ -6,23 +6,28 @@ // trees and nodes, and could be broken out as a reusable lua package #include <assert.h> -#include <inttypes.h> #include <lauxlib.h> +#include <limits.h> #include <lua.h> -#include <lualib.h> #include <stdbool.h> #include <stdint.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> #include <uv.h> #include "klib/kvec.h" #include "nvim/api/private/helpers.h" -#include "nvim/buffer.h" -#include "nvim/log.h" +#include "nvim/buffer_defs.h" +#include "nvim/globals.h" #include "nvim/lua/treesitter.h" +#include "nvim/macros.h" #include "nvim/map.h" #include "nvim/memline.h" +#include "nvim/memory.h" +#include "nvim/pos.h" +#include "nvim/strings.h" +#include "nvim/types.h" #include "tree_sitter/api.h" #define TS_META_PARSER "treesitter_parser" diff --git a/src/nvim/lua/xdiff.c b/src/nvim/lua/xdiff.c @@ -1,19 +1,20 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include <errno.h> #include <lauxlib.h> #include <lua.h> -#include <lualib.h> -#include <stdio.h> -#include <stdlib.h> +#include <stdbool.h> #include <string.h> +#include "luaconf.h" +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/linematch.h" #include "nvim/lua/converter.h" #include "nvim/lua/executor.h" #include "nvim/lua/xdiff.h" +#include "nvim/macros.h" +#include "nvim/memory.h" #include "nvim/vim.h" #include "xdiff/xdiff.h" diff --git a/src/nvim/main.c b/src/nvim/main.c @@ -3,41 +3,52 @@ #define EXTERN #include <assert.h> -#include <msgpack.h> +#include <limits.h> +#include <msgpack/pack.h> #include <stdbool.h> #include <stdint.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> +#include <time.h> +#include "auto/config.h" #include "nvim/arglist.h" #include "nvim/ascii.h" #include "nvim/autocmd.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/channel.h" -#include "nvim/charset.h" #include "nvim/decoration.h" #include "nvim/decoration_provider.h" #include "nvim/diff.h" #include "nvim/drawscreen.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/event/multiqueue.h" +#include "nvim/event/stream.h" #include "nvim/ex_cmds.h" -#include "nvim/ex_cmds2.h" #include "nvim/ex_docmd.h" #include "nvim/ex_getln.h" #include "nvim/fileio.h" #include "nvim/fold.h" #include "nvim/garray.h" +#include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/hashtab.h" #include "nvim/highlight.h" #include "nvim/highlight_group.h" -#include "nvim/iconv.h" +#include "nvim/keycodes.h" #include "nvim/locale.h" #include "nvim/log.h" #include "nvim/lua/executor.h" +#include "nvim/macros.h" #include "nvim/main.h" -#include "nvim/mapping.h" #include "nvim/mark.h" -#include "nvim/mbyte.h" +#include "nvim/memfile_defs.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" @@ -46,24 +57,27 @@ #include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_defs.h" #include "nvim/optionstr.h" #include "nvim/os/fileio.h" #include "nvim/os/input.h" #include "nvim/os/os.h" -#include "nvim/os/os_defs.h" +#include "nvim/os/pty_process.h" +#include "nvim/os/stdpaths_defs.h" #include "nvim/os/time.h" -#include "nvim/os_unix.h" #include "nvim/path.h" #include "nvim/popupmenu.h" +#include "nvim/pos.h" #include "nvim/profile.h" #include "nvim/quickfix.h" #include "nvim/runtime.h" #include "nvim/shada.h" #include "nvim/sign.h" -#include "nvim/state.h" #include "nvim/statusline.h" #include "nvim/strings.h" #include "nvim/syntax.h" +#include "nvim/terminal.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/ui_client.h" #include "nvim/ui_compositor.h" @@ -73,8 +87,8 @@ #ifdef MSWIN # include "nvim/os/os_win_console.h" #endif +#include "nvim/api/extmark.h" #include "nvim/api/private/defs.h" -#include "nvim/api/private/dispatch.h" #include "nvim/api/private/helpers.h" #include "nvim/api/ui.h" #include "nvim/event/loop.h" @@ -83,10 +97,6 @@ #include "nvim/msgpack_rpc/helpers.h" #include "nvim/msgpack_rpc/server.h" #include "nvim/os/signal.h" -#ifndef MSWIN -# include "nvim/os/pty_process_unix.h" -#endif -#include "nvim/api/extmark.h" // values for "window_layout" enum { diff --git a/src/nvim/main.h b/src/nvim/main.h @@ -1,6 +1,8 @@ #ifndef NVIM_MAIN_H #define NVIM_MAIN_H +#include <stdbool.h> + #include "nvim/event/loop.h" // Maximum number of commands from + or -c arguments. diff --git a/src/nvim/map.c b/src/nvim/map.c @@ -8,17 +8,16 @@ // khash.h does not make its own copy of the key or value. // -#include <lauxlib.h> -#include <lua.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> +#include "auto/config.h" #include "klib/khash.h" +#include "nvim/gettext.h" #include "nvim/map.h" #include "nvim/map_defs.h" #include "nvim/memory.h" -#include "nvim/vim.h" #define cstr_t_hash kh_str_hash_func #define cstr_t_eq kh_str_hash_equal diff --git a/src/nvim/map.h b/src/nvim/map.h @@ -2,12 +2,17 @@ #define NVIM_MAP_H #include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include "klib/khash.h" #include "nvim/api/private/defs.h" #include "nvim/extmark_defs.h" +#include "nvim/gettext.h" #include "nvim/highlight_defs.h" #include "nvim/map_defs.h" #include "nvim/tui/input_defs.h" +#include "nvim/types.h" #include "nvim/ui_client.h" #if defined(__NetBSD__) diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c @@ -5,32 +5,40 @@ #include <assert.h> #include <inttypes.h> +#include <limits.h> #include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> #include "nvim/api/private/converter.h" +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" -#include "nvim/assert.h" #include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/eval.h" #include "nvim/eval/typval.h" -#include "nvim/ex_docmd.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_session.h" -#include "nvim/func_attr.h" #include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/highlight_defs.h" #include "nvim/keycodes.h" #include "nvim/lua/executor.h" +#include "nvim/macros.h" #include "nvim/mapping.h" #include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option.h" +#include "nvim/option_defs.h" +#include "nvim/pos.h" #include "nvim/regexp.h" #include "nvim/runtime.h" -#include "nvim/ui.h" +#include "nvim/strings.h" #include "nvim/vim.h" /// List used for abbreviations. diff --git a/src/nvim/mapping.h b/src/nvim/mapping.h @@ -1,6 +1,10 @@ #ifndef NVIM_MAPPING_H #define NVIM_MAPPING_H +#include <stdbool.h> +#include <stddef.h> + +#include "lauxlib.h" #include "nvim/buffer_defs.h" #include "nvim/ex_cmds_defs.h" #include "nvim/types.h" diff --git a/src/nvim/mark.c b/src/nvim/mark.c @@ -4,20 +4,26 @@ // mark.c: functions for setting marks and jumping to them #include <assert.h> -#include <inttypes.h> #include <limits.h> +#include <stdio.h> #include <string.h> #include "nvim/ascii.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/diff.h" #include "nvim/edit.h" -#include "nvim/eval.h" -#include "nvim/ex_cmds.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.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" +#include "nvim/highlight_defs.h" #include "nvim/mark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" @@ -25,16 +31,16 @@ #include "nvim/message.h" #include "nvim/move.h" #include "nvim/normal.h" -#include "nvim/option.h" +#include "nvim/option_defs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" -#include "nvim/os/time.h" #include "nvim/path.h" #include "nvim/quickfix.h" #include "nvim/sign.h" #include "nvim/strings.h" #include "nvim/textobject.h" -#include "nvim/ui.h" +#include "nvim/types.h" +#include "nvim/undo_defs.h" #include "nvim/vim.h" // This file contains routines to maintain and manipulate marks. diff --git a/src/nvim/mark.h b/src/nvim/mark.h @@ -1,9 +1,12 @@ #ifndef NVIM_MARK_H #define NVIM_MARK_H +#include <stdbool.h> +#include <stddef.h> + #include "nvim/ascii.h" #include "nvim/buffer_defs.h" -#include "nvim/ex_cmds_defs.h" // for exarg_T +#include "nvim/ex_cmds_defs.h" #include "nvim/extmark_defs.h" #include "nvim/func_attr.h" #include "nvim/macros.h" diff --git a/src/nvim/marktree.c b/src/nvim/marktree.c @@ -48,10 +48,15 @@ // at the repo root. #include <assert.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> #include "klib/kvec.h" #include "nvim/garray.h" #include "nvim/marktree.h" +#include "nvim/memory.h" +#include "nvim/pos.h" #define T MT_BRANCH_FACTOR #define ILEN (sizeof(mtnode_t) + (2 * T) * sizeof(void *)) diff --git a/src/nvim/marktree.h b/src/nvim/marktree.h @@ -2,14 +2,19 @@ #define NVIM_MARKTREE_H #include <assert.h> +#include <stdbool.h> +#include <stddef.h> #include <stdint.h> #include "nvim/assert.h" #include "nvim/garray.h" #include "nvim/map.h" +#include "nvim/map_defs.h" #include "nvim/pos.h" #include "nvim/types.h" +struct mtnode_s; + #define MT_MAX_DEPTH 20 #define MT_BRANCH_FACTOR 10 diff --git a/src/nvim/match.c b/src/nvim/match.c @@ -3,22 +3,39 @@ // match.c: functions for highlighting matches +#include <assert.h> +#include <inttypes.h> #include <stdbool.h> +#include <stdio.h> +#include <string.h> +#include "nvim/ascii.h" #include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/drawscreen.h" #include "nvim/eval.h" #include "nvim/eval/funcs.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/fold.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/highlight.h" #include "nvim/highlight_group.h" +#include "nvim/macros.h" #include "nvim/match.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" +#include "nvim/memory.h" +#include "nvim/message.h" +#include "nvim/option_defs.h" +#include "nvim/pos.h" #include "nvim/profile.h" #include "nvim/regexp.h" -#include "nvim/runtime.h" +#include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/math.c b/src/nvim/math.c @@ -10,7 +10,7 @@ #include "nvim/math.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "math.c.generated.h" +# include "math.c.generated.h" // IWYU pragma: export #endif int xfpclassify(double d) diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c @@ -25,36 +25,55 @@ /// Vim scripts may contain an ":scriptencoding" command. This has an effect /// for some commands, like ":menutrans". -#include <inttypes.h> +#include <assert.h> +#include <ctype.h> +#include <errno.h> +#include <iconv.h> #include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> #include <wchar.h> #include <wctype.h> -#include "nvim/ascii.h" -#include "nvim/vim.h" -#ifdef HAVE_LOCALE_H -# include <locale.h> -#endif +#include "auto/config.h" #include "nvim/arabic.h" +#include "nvim/ascii.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/drawscreen.h" -#include "nvim/eval.h" -#include "nvim/fileio.h" -#include "nvim/func_attr.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/grid_defs.h" #include "nvim/iconv.h" +#include "nvim/keycodes.h" +#include "nvim/macros.h" #include "nvim/mark.h" #include "nvim/mbyte.h" +#include "nvim/mbyte_defs.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" +#include "nvim/option_defs.h" #include "nvim/os/os.h" -#include "nvim/path.h" +#include "nvim/os/os_defs.h" +#include "nvim/pos.h" #include "nvim/screen.h" -#include "nvim/spell.h" #include "nvim/strings.h" +#include "nvim/types.h" +#include "nvim/vim.h" + +#ifdef HAVE_LOCALE_H +# include <locale.h> +#endif + +#ifdef __STDC_ISO_10646__ +# include <stdc-predef.h> +#endif typedef struct { int rangeStart; @@ -68,11 +87,12 @@ struct interval { long last; }; +// uncrustify:off #ifdef INCLUDE_GENERATED_DECLARATIONS # include "mbyte.c.generated.h" - # include "unicode_tables.generated.h" #endif +// uncrustify:on static char e_list_item_nr_is_not_list[] = N_("E1109: List item %d is not a List"); diff --git a/src/nvim/mbyte.h b/src/nvim/mbyte.h @@ -8,8 +8,8 @@ #include "nvim/eval/typval.h" #include "nvim/func_attr.h" #include "nvim/mbyte_defs.h" -#include "nvim/os/os_defs.h" // For indirect -#include "nvim/types.h" // for char_u +#include "nvim/os/os_defs.h" +#include "nvim/types.h" // Return byte length of character that starts with byte "b". // Returns 1 for a single-byte character. diff --git a/src/nvim/memfile.c b/src/nvim/memfile.c @@ -43,19 +43,26 @@ #include <inttypes.h> #include <limits.h> #include <stdbool.h> +#include <stdio.h> #include <string.h> -#include "nvim/ascii.h" #include "nvim/assert.h" +#include "nvim/buffer_defs.h" #include "nvim/fileio.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/macros.h" #include "nvim/memfile.h" +#include "nvim/memfile_defs.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" +#include "nvim/os/fs_defs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" -#include "nvim/os_unix.h" #include "nvim/path.h" +#include "nvim/pos.h" +#include "nvim/types.h" #include "nvim/vim.h" #define MEMFILE_PAGE_SIZE 4096 /// default page size diff --git a/src/nvim/memline.c b/src/nvim/memline.c @@ -39,19 +39,31 @@ #include <fcntl.h> #include <inttypes.h> #include <stdbool.h> +#include <stdio.h> #include <string.h> +#include <time.h> +#include <uv.h> +#include "auto/config.h" +#include "klib/kvec.h" #include "nvim/ascii.h" #include "nvim/autocmd.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/change.h" #include "nvim/cursor.h" #include "nvim/drawscreen.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/fileio.h" -#include "nvim/func_attr.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/highlight_defs.h" #include "nvim/input.h" +#include "nvim/macros.h" #include "nvim/main.h" #include "nvim/mark.h" #include "nvim/mbyte.h" @@ -60,19 +72,21 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/os/fs_defs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/process.h" -#include "nvim/os_unix.h" +#include "nvim/os/time.h" #include "nvim/path.h" -#include "nvim/sha256.h" +#include "nvim/pos.h" +#include "nvim/screen.h" #include "nvim/spell.h" #include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/version.h" #include "nvim/vim.h" -#include "nvim/window.h" #ifndef UNIX // it's in os/unix_defs.h for Unix # include <time.h> diff --git a/src/nvim/memline.h b/src/nvim/memline.h @@ -1,8 +1,8 @@ #ifndef NVIM_MEMLINE_H #define NVIM_MEMLINE_H -#include "nvim/buffer_defs.h" // for buf_T -#include "nvim/pos.h" // for pos_T, linenr_T, colnr_T +#include "nvim/buffer_defs.h" +#include "nvim/pos.h" #include "nvim/types.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/memory.c b/src/nvim/memory.c @@ -7,17 +7,23 @@ #include <inttypes.h> #include <stdbool.h> #include <stdint.h> +#include <stdlib.h> #include <string.h> +#include <time.h> #include "nvim/api/extmark.h" #include "nvim/arglist.h" +#include "nvim/ascii.h" #include "nvim/context.h" #include "nvim/decoration_provider.h" #include "nvim/eval.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/highlight.h" #include "nvim/highlight_group.h" #include "nvim/insexpand.h" #include "nvim/lua/executor.h" +#include "nvim/main.h" #include "nvim/mapping.h" #include "nvim/memfile.h" #include "nvim/memory.h" @@ -25,6 +31,7 @@ #include "nvim/sign.h" #include "nvim/ui.h" #include "nvim/ui_compositor.h" +#include "nvim/usercmd.h" #include "nvim/vim.h" #ifdef UNIT_TESTING @@ -653,7 +660,6 @@ char *arena_memdupz(Arena *arena, const char *buf, size_t size) # include "nvim/autocmd.h" # include "nvim/buffer.h" -# include "nvim/charset.h" # include "nvim/cmdhist.h" # include "nvim/diff.h" # include "nvim/edit.h" @@ -662,23 +668,16 @@ char *arena_memdupz(Arena *arena, const char *buf, size_t size) # include "nvim/ex_docmd.h" # include "nvim/ex_getln.h" # include "nvim/file_search.h" -# include "nvim/fold.h" # include "nvim/getchar.h" # include "nvim/grid.h" # include "nvim/mark.h" -# include "nvim/mbyte.h" -# include "nvim/memline.h" -# include "nvim/move.h" # include "nvim/ops.h" # include "nvim/option.h" # include "nvim/os/os.h" -# include "nvim/os_unix.h" -# include "nvim/path.h" # include "nvim/quickfix.h" # include "nvim/regexp.h" # include "nvim/search.h" # include "nvim/spell.h" -# include "nvim/syntax.h" # include "nvim/tag.h" # include "nvim/window.h" diff --git a/src/nvim/memory.h b/src/nvim/memory.h @@ -1,10 +1,10 @@ #ifndef NVIM_MEMORY_H #define NVIM_MEMORY_H -#include <stdbool.h> // for bool -#include <stddef.h> // for size_t -#include <stdint.h> // for uint8_t -#include <time.h> // for time_t +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> +#include <time.h> #include "nvim/macros.h" diff --git a/src/nvim/menu.c b/src/nvim/menu.c @@ -5,29 +5,40 @@ // GUI/Motif support by Robert Webb #include <assert.h> -#include <inttypes.h> +#include <stdbool.h> #include <string.h> #include "nvim/ascii.h" #include "nvim/autocmd.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/eval.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/highlight_defs.h" #include "nvim/keycodes.h" +#include "nvim/macros.h" +#include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/menu.h" +#include "nvim/menu_defs.h" #include "nvim/message.h" +#include "nvim/option_defs.h" #include "nvim/popupmenu.h" -#include "nvim/screen.h" +#include "nvim/pos.h" #include "nvim/state.h" #include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/ui.h" +#include "nvim/undo_defs.h" #include "nvim/vim.h" -#include "nvim/window.h" #define MENUDEPTH 10 // maximum depth of menus diff --git a/src/nvim/menu.h b/src/nvim/menu.h @@ -1,11 +1,11 @@ #ifndef NVIM_MENU_H #define NVIM_MENU_H -#include <stdbool.h> // for bool +#include <stdbool.h> -#include "nvim/ex_cmds_defs.h" // for exarg_T +#include "nvim/ex_cmds_defs.h" #include "nvim/menu_defs.h" -#include "nvim/types.h" // for char_u and expand_T +#include "nvim/types.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "menu.h.generated.h" diff --git a/src/nvim/menu_defs.h b/src/nvim/menu_defs.h @@ -1,7 +1,7 @@ #ifndef NVIM_MENU_DEFS_H #define NVIM_MENU_DEFS_H -#include <stdbool.h> // for bool +#include <stdbool.h> /// Indices into vimmenu_T->strings[] and vimmenu_T->noremap[] for each mode /// \addtogroup MENU_INDEX diff --git a/src/nvim/message.c b/src/nvim/message.c @@ -7,41 +7,50 @@ #include <inttypes.h> #include <stdarg.h> #include <stdbool.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" -#include "nvim/assert.h" +#include "nvim/buffer_defs.h" +#include "nvim/channel.h" #include "nvim/charset.h" #include "nvim/drawscreen.h" #include "nvim/eval.h" -#include "nvim/ex_docmd.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/event/defs.h" +#include "nvim/event/loop.h" +#include "nvim/event/multiqueue.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_eval.h" -#include "nvim/ex_getln.h" #include "nvim/fileio.h" -#include "nvim/func_attr.h" #include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/highlight.h" #include "nvim/indent.h" #include "nvim/input.h" #include "nvim/keycodes.h" +#include "nvim/log.h" #include "nvim/main.h" #include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/mouse.h" -#include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" #include "nvim/os/input.h" #include "nvim/os/os.h" -#include "nvim/os/time.h" +#include "nvim/pos.h" #include "nvim/regexp.h" #include "nvim/runtime.h" +#include "nvim/screen.h" #include "nvim/strings.h" -#include "nvim/syntax.h" #include "nvim/ui.h" #include "nvim/ui_compositor.h" #include "nvim/vim.h" diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c @@ -1,33 +1,46 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <assert.h> #include <stdbool.h> +#include <stdlib.h> +#include <string.h> #include "nvim/ascii.h" #include "nvim/buffer.h" #include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cursor.h" -#include "nvim/diff.h" #include "nvim/drawscreen.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_docmd.h" #include "nvim/fold.h" #include "nvim/getchar.h" +#include "nvim/globals.h" #include "nvim/grid.h" +#include "nvim/keycodes.h" +#include "nvim/macros.h" +#include "nvim/mark.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/menu.h" +#include "nvim/message.h" #include "nvim/mouse.h" #include "nvim/move.h" +#include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" -#include "nvim/os_unix.h" #include "nvim/plines.h" +#include "nvim/pos.h" +#include "nvim/screen.h" #include "nvim/search.h" #include "nvim/state.h" #include "nvim/statusline.h" #include "nvim/strings.h" #include "nvim/syntax.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/ui_compositor.h" #include "nvim/vim.h" diff --git a/src/nvim/move.c b/src/nvim/move.c @@ -11,8 +11,9 @@ // The 'scrolloff' option makes this a bit complicated. #include <assert.h> -#include <inttypes.h> +#include <limits.h> #include <stdbool.h> +#include <stddef.h> #include "nvim/ascii.h" #include "nvim/buffer.h" @@ -23,19 +24,26 @@ #include "nvim/edit.h" #include "nvim/eval.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/fold.h" #include "nvim/getchar.h" +#include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/highlight.h" +#include "nvim/macros.h" #include "nvim/mbyte.h" -#include "nvim/memline.h" +#include "nvim/memline_defs.h" #include "nvim/mouse.h" #include "nvim/move.h" #include "nvim/option.h" #include "nvim/plines.h" #include "nvim/popupmenu.h" +#include "nvim/pos.h" +#include "nvim/screen.h" #include "nvim/search.h" #include "nvim/strings.h" +#include "nvim/types.h" +#include "nvim/vim.h" #include "nvim/window.h" typedef struct { diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c @@ -1,36 +1,42 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <assert.h> #include <inttypes.h> -#include <msgpack.h> +#include <msgpack/object.h> +#include <msgpack/pack.h> +#include <msgpack/sbuffer.h> +#include <msgpack/unpack.h> #include <stdbool.h> -#include <string.h> +#include <stdio.h> +#include <stdlib.h> #include <uv.h> #include "klib/kvec.h" +#include "nvim/api/private/defs.h" +#include "nvim/api/private/dispatch.h" #include "nvim/api/private/helpers.h" #include "nvim/api/ui.h" -#include "nvim/api/vim.h" -#include "nvim/ascii.h" #include "nvim/channel.h" -#include "nvim/eval.h" -#include "nvim/event/libuv_process.h" +#include "nvim/event/defs.h" #include "nvim/event/loop.h" #include "nvim/event/rstream.h" -#include "nvim/event/socket.h" +#include "nvim/event/stream.h" #include "nvim/event/wstream.h" +#include "nvim/globals.h" #include "nvim/log.h" #include "nvim/main.h" #include "nvim/map.h" #include "nvim/memory.h" -#include "nvim/message.h" #include "nvim/msgpack_rpc/channel.h" +#include "nvim/msgpack_rpc/channel_defs.h" #include "nvim/msgpack_rpc/helpers.h" #include "nvim/msgpack_rpc/unpacker.h" #include "nvim/os/input.h" -#include "nvim/os_unix.h" +#include "nvim/rbuffer.h" +#include "nvim/types.h" #include "nvim/ui.h" -#include "nvim/vim.h" +#include "nvim/ui_client.h" #if MIN_LOG_LEVEL > LOGLVL_DBG # define log_client_msg(...) diff --git a/src/nvim/msgpack_rpc/channel.h b/src/nvim/msgpack_rpc/channel.h @@ -6,8 +6,10 @@ #include "nvim/api/private/defs.h" #include "nvim/channel.h" +#include "nvim/event/multiqueue.h" #include "nvim/event/process.h" #include "nvim/event/socket.h" +#include "nvim/macros.h" #include "nvim/vim.h" #define METHOD_MAXLEN 512 diff --git a/src/nvim/msgpack_rpc/helpers.c b/src/nvim/msgpack_rpc/helpers.c @@ -1,21 +1,25 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include <inttypes.h> -#include <msgpack.h> +#include <msgpack/object.h> +#include <msgpack/sbuffer.h> +#include <msgpack/unpack.h> +#include <msgpack/zone.h> #include <stdbool.h> +#include <stddef.h> +#include <stdint.h> #include "klib/kvec.h" -#include "nvim/api/private/dispatch.h" +#include "msgpack/pack.h" #include "nvim/api/private/helpers.h" #include "nvim/assert.h" -#include "nvim/log.h" +#include "nvim/event/wstream.h" #include "nvim/memory.h" #include "nvim/msgpack_rpc/helpers.h" -#include "nvim/vim.h" +#include "nvim/types.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "keysets.generated.h" +# include "keysets.generated.h" // IWYU pragma: export # include "msgpack_rpc/helpers.c.generated.h" #endif diff --git a/src/nvim/msgpack_rpc/server.c b/src/nvim/msgpack_rpc/server.c @@ -1,25 +1,22 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include <assert.h> #include <inttypes.h> -#include <stdlib.h> +#include <stdbool.h> +#include <stdio.h> #include <string.h> +#include <uv.h> -#include "nvim/ascii.h" +#include "nvim/channel.h" #include "nvim/eval.h" #include "nvim/event/socket.h" -#include "nvim/fileio.h" #include "nvim/garray.h" #include "nvim/log.h" #include "nvim/main.h" #include "nvim/memory.h" -#include "nvim/msgpack_rpc/channel.h" #include "nvim/msgpack_rpc/server.h" #include "nvim/os/os.h" -#include "nvim/path.h" -#include "nvim/strings.h" -#include "nvim/vim.h" +#include "nvim/os/stdpaths_defs.h" #define MAX_CONNECTIONS 32 #define ENV_LISTEN "NVIM_LISTEN_ADDRESS" // deprecated diff --git a/src/nvim/msgpack_rpc/unpacker.c b/src/nvim/msgpack_rpc/unpacker.c @@ -1,9 +1,17 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <assert.h> +#include <stdbool.h> +#include <stdlib.h> + +#include "klib/kvec.h" +#include "mpack/conv.h" #include "nvim/api/private/helpers.h" -#include "nvim/log.h" +#include "nvim/ascii.h" +#include "nvim/macros.h" #include "nvim/memory.h" +#include "nvim/msgpack_rpc/channel_defs.h" #include "nvim/msgpack_rpc/helpers.h" #include "nvim/msgpack_rpc/unpacker.h" #include "nvim/ui_client.h" diff --git a/src/nvim/msgpack_rpc/unpacker.h b/src/nvim/msgpack_rpc/unpacker.h @@ -7,10 +7,14 @@ #include "mpack/mpack_core.h" #include "mpack/object.h" +#include "nvim/api/private/defs.h" #include "nvim/api/private/dispatch.h" #include "nvim/api/private/helpers.h" +#include "nvim/grid_defs.h" #include "nvim/memory.h" #include "nvim/msgpack_rpc/channel_defs.h" +#include "nvim/types.h" +#include "nvim/ui_client.h" struct Unpacker { mpack_parser_t parser; diff --git a/src/nvim/normal.c b/src/nvim/normal.c @@ -8,14 +8,21 @@ // #include <assert.h> +#include <ctype.h> #include <inttypes.h> +#include <limits.h> #include <stdbool.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> +#include <time.h> +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/change.h" #include "nvim/charset.h" #include "nvim/cmdhist.h" @@ -25,8 +32,6 @@ #include "nvim/drawscreen.h" #include "nvim/edit.h" #include "nvim/eval.h" -#include "nvim/eval/userfunc.h" -#include "nvim/event/loop.h" #include "nvim/ex_cmds.h" #include "nvim/ex_cmds2.h" #include "nvim/ex_docmd.h" @@ -34,15 +39,16 @@ #include "nvim/fileio.h" #include "nvim/fold.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" #include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/help.h" -#include "nvim/indent.h" +#include "nvim/highlight_defs.h" #include "nvim/keycodes.h" -#include "nvim/log.h" -#include "nvim/main.h" +#include "nvim/macros.h" #include "nvim/mapping.h" #include "nvim/mark.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" @@ -56,6 +62,7 @@ #include "nvim/plines.h" #include "nvim/profile.h" #include "nvim/quickfix.h" +#include "nvim/screen.h" #include "nvim/search.h" #include "nvim/spell.h" #include "nvim/spellfile.h" @@ -66,6 +73,7 @@ #include "nvim/tag.h" #include "nvim/textformat.h" #include "nvim/textobject.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/vim.h" diff --git a/src/nvim/normal.h b/src/nvim/normal.h @@ -3,7 +3,7 @@ #include <stdbool.h> -#include "nvim/buffer_defs.h" // for win_T +#include "nvim/buffer_defs.h" #include "nvim/pos.h" // Values for find_ident_under_cursor() diff --git a/src/nvim/ops.c b/src/nvim/ops.c @@ -5,13 +5,18 @@ // op_change, op_yank, do_put, do_join #include <assert.h> +#include <ctype.h> #include <inttypes.h> +#include <limits.h> #include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> -#include "klib/kvec.h" +#include "nvim/api/private/defs.h" #include "nvim/ascii.h" #include "nvim/assert.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" #include "nvim/change.h" #include "nvim/charset.h" @@ -20,16 +25,19 @@ #include "nvim/edit.h" #include "nvim/eval.h" #include "nvim/eval/typval.h" -#include "nvim/ex_cmds.h" #include "nvim/ex_cmds2.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_getln.h" #include "nvim/extmark.h" #include "nvim/fold.h" +#include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" #include "nvim/globals.h" +#include "nvim/highlight_defs.h" #include "nvim/indent.h" #include "nvim/indent_c.h" -#include "nvim/log.h" +#include "nvim/keycodes.h" #include "nvim/macros.h" #include "nvim/mark.h" #include "nvim/mbyte.h" @@ -43,13 +51,14 @@ #include "nvim/option.h" #include "nvim/os/input.h" #include "nvim/os/time.h" -#include "nvim/path.h" #include "nvim/plines.h" +#include "nvim/screen.h" #include "nvim/search.h" #include "nvim/state.h" #include "nvim/strings.h" #include "nvim/terminal.h" #include "nvim/textformat.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/vim.h" diff --git a/src/nvim/ops.h b/src/nvim/ops.h @@ -2,14 +2,17 @@ #define NVIM_OPS_H #include <stdbool.h> +#include <stddef.h> #include "nvim/ascii.h" #include "nvim/eval/typval.h" -#include "nvim/ex_cmds_defs.h" // for exarg_T +#include "nvim/eval/typval_defs.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/extmark.h" #include "nvim/macros.h" -#include "nvim/normal.h" // for MotionType and oparg_T +#include "nvim/normal.h" #include "nvim/os/time.h" +#include "nvim/pos.h" #include "nvim/types.h" typedef int (*Indenter)(void); diff --git a/src/nvim/option.c b/src/nvim/option.c @@ -21,14 +21,18 @@ #define IN_OPTION_C #include <assert.h> +#include <ctype.h> #include <inttypes.h> #include <limits.h> #include <stdbool.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> -#include "nvim/arglist.h" +#include "auto/config.h" +#include "nvim/api/private/defs.h" #include "nvim/ascii.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" #include "nvim/change.h" #include "nvim/charset.h" @@ -36,16 +40,18 @@ #include "nvim/decoration_provider.h" #include "nvim/diff.h" #include "nvim/drawscreen.h" -#include "nvim/edit.h" #include "nvim/eval.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/ex_getln.h" #include "nvim/ex_session.h" -#include "nvim/fileio.h" #include "nvim/fold.h" #include "nvim/garray.h" -#include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/grid_defs.h" #include "nvim/hardcopy.h" #include "nvim/highlight.h" #include "nvim/highlight_group.h" @@ -54,6 +60,7 @@ #include "nvim/insexpand.h" #include "nvim/keycodes.h" #include "nvim/locale.h" +#include "nvim/log.h" #include "nvim/macros.h" #include "nvim/mapping.h" #include "nvim/mbyte.h" @@ -66,22 +73,24 @@ #include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_defs.h" #include "nvim/optionstr.h" #include "nvim/os/os.h" -#include "nvim/os_unix.h" #include "nvim/path.h" #include "nvim/popupmenu.h" +#include "nvim/pos.h" #include "nvim/regexp.h" +#include "nvim/runtime.h" #include "nvim/screen.h" -#include "nvim/search.h" +#include "nvim/sign_defs.h" #include "nvim/spell.h" #include "nvim/spellfile.h" #include "nvim/spellsuggest.h" #include "nvim/strings.h" -#include "nvim/syntax.h" #include "nvim/tag.h" +#include "nvim/terminal.h" +#include "nvim/types.h" #include "nvim/ui.h" -#include "nvim/ui_compositor.h" #include "nvim/undo.h" #include "nvim/vim.h" #include "nvim/window.h" @@ -90,7 +99,6 @@ #endif #include "nvim/api/extmark.h" #include "nvim/api/private/helpers.h" -#include "nvim/api/vim.h" #include "nvim/lua/executor.h" #include "nvim/os/input.h" #include "nvim/os/lang.h" diff --git a/src/nvim/option.h b/src/nvim/option.h @@ -1,7 +1,7 @@ #ifndef NVIM_OPTION_H #define NVIM_OPTION_H -#include "nvim/ex_cmds_defs.h" // for exarg_T +#include "nvim/ex_cmds_defs.h" /// Returned by get_option_value(). typedef enum { diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h @@ -1,8 +1,8 @@ #ifndef NVIM_OPTION_DEFS_H #define NVIM_OPTION_DEFS_H -#include "eval/typval.h" // For scid_T -#include "nvim/macros.h" // For EXTERN +#include "nvim/eval/typval.h" +#include "nvim/macros.h" #include "nvim/types.h" // option_defs.h: definition of global variables for settable options diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c @@ -2,14 +2,13 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <assert.h> -#include <inttypes.h> #include <stdbool.h> -#include <stdlib.h> #include <string.h> #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" #include "nvim/autocmd.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/cursor_shape.h" @@ -17,23 +16,35 @@ #include "nvim/digraph.h" #include "nvim/drawscreen.h" #include "nvim/eval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/vars.h" #include "nvim/ex_getln.h" +#include "nvim/fold.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/hardcopy.h" #include "nvim/highlight_group.h" #include "nvim/indent.h" #include "nvim/indent_c.h" #include "nvim/insexpand.h" #include "nvim/keycodes.h" +#include "nvim/macros.h" #include "nvim/mapping.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" +#include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/mouse.h" #include "nvim/move.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_defs.h" #include "nvim/optionstr.h" +#include "nvim/os/os.h" +#include "nvim/pos.h" #include "nvim/quickfix.h" #include "nvim/runtime.h" +#include "nvim/screen.h" #include "nvim/spell.h" #include "nvim/spellfile.h" #include "nvim/spellsuggest.h" diff --git a/src/nvim/optionstr.h b/src/nvim/optionstr.h @@ -1,7 +1,7 @@ #ifndef NVIM_OPTIONSTR_H #define NVIM_OPTIONSTR_H -#include "nvim/buffer_defs.h" // for buf_T, win_T +#include "nvim/buffer_defs.h" #include "nvim/option_defs.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/os/dl.c b/src/nvim/os/dl.c @@ -4,13 +4,14 @@ /// Functions for using external native libraries #include <stdbool.h> +#include <stddef.h> #include <stdint.h> #include <uv.h> +#include "nvim/gettext.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/os/dl.h" -#include "nvim/os/os.h" /// possible function prototypes that can be called by os_libcall() /// int -> int diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c @@ -4,19 +4,32 @@ // Environment inspection #include <assert.h> +#include <limits.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> +#include <string.h> #include <uv.h> +#include "auto/config.h" #include "nvim/ascii.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cmdexpand.h" #include "nvim/eval.h" +#include "nvim/ex_cmds_defs.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/log.h" #include "nvim/macros.h" #include "nvim/map.h" #include "nvim/memory.h" #include "nvim/message.h" +#include "nvim/option_defs.h" #include "nvim/os/os.h" #include "nvim/path.h" #include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/version.h" #include "nvim/vim.h" diff --git a/src/nvim/os/fileio.c b/src/nvim/os/fileio.c @@ -11,22 +11,19 @@ #include <fcntl.h> #include <stdbool.h> #include <stddef.h> - -#include "auto/config.h" - -#ifdef HAVE_SYS_UIO_H -# include <sys/uio.h> -#endif - +#include <stdint.h> #include <uv.h> -#include "nvim/globals.h" +#include "auto/config.h" +#include "nvim/gettext.h" #include "nvim/macros.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/os/fileio.h" #include "nvim/os/os.h" +#include "nvim/os/os_defs.h" #include "nvim/rbuffer.h" +#include "nvim/types.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "os/fileio.c.generated.h" diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c @@ -5,11 +5,23 @@ #include <assert.h> #include <errno.h> #include <fcntl.h> -#include <limits.h> #include <stdbool.h> #include <stddef.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> #include "auto/config.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/log.h" +#include "nvim/macros.h" +#include "nvim/option_defs.h" +#include "nvim/os/fs_defs.h" +#include "nvim/types.h" +#include "nvim/vim.h" #ifdef HAVE_SYS_UIO_H # include <sys/uio.h> @@ -18,14 +30,12 @@ #include <uv.h> #include "nvim/ascii.h" -#include "nvim/assert.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option.h" #include "nvim/os/os.h" -#include "nvim/os/os_defs.h" #include "nvim/path.h" -#include "nvim/strings.h" + +struct iovec; #ifdef MSWIN # include "nvim/mbyte.h" // for utf8_to_utf16, utf16_to_utf8 diff --git a/src/nvim/os/fs.h b/src/nvim/os/fs.h @@ -1,8 +1,8 @@ #ifndef NVIM_OS_FS_H #define NVIM_OS_FS_H -#include "nvim/os/fs_defs.h" // for uv_* -#include "nvim/types.h" // for char_u +#include "nvim/os/fs_defs.h" +#include "nvim/types.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "os/fs.h.generated.h" diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c @@ -3,25 +3,33 @@ #include <assert.h> #include <stdbool.h> +#include <stdint.h> +#include <stdio.h> #include <string.h> #include <uv.h> #include "nvim/api/private/defs.h" #include "nvim/ascii.h" #include "nvim/autocmd.h" +#include "nvim/buffer_defs.h" #include "nvim/event/loop.h" +#include "nvim/event/multiqueue.h" #include "nvim/event/rstream.h" +#include "nvim/event/stream.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/keycodes.h" +#include "nvim/log.h" +#include "nvim/macros.h" #include "nvim/main.h" -#include "nvim/mbyte.h" -#include "nvim/memory.h" #include "nvim/msgpack_rpc/channel.h" +#include "nvim/option_defs.h" #include "nvim/os/input.h" +#include "nvim/os/time.h" #include "nvim/profile.h" -#include "nvim/screen.h" +#include "nvim/rbuffer.h" #include "nvim/state.h" -#include "nvim/ui.h" #include "nvim/vim.h" #define READ_BUFFER_SIZE 0xfff diff --git a/src/nvim/os/lang.c b/src/nvim/os/lang.c @@ -7,16 +7,16 @@ # include <CoreServices/CoreServices.h> # undef Boolean # undef FileInfo -#endif -#include "auto/config.h" +# include "auto/config.h" +# ifdef HAVE_LOCALE_H +# include <locale.h> +# endif +# include "nvim/os/os.h" -#ifdef HAVE_LOCALE_H -# include <locale.h> #endif #include "nvim/os/lang.h" -#include "nvim/os/os.h" void lang_init(void) { diff --git a/src/nvim/os/mem.c b/src/nvim/os/mem.c @@ -3,6 +3,7 @@ /// Functions for accessing system memory information. +#include <stdint.h> #include <uv.h> #include "nvim/os/os.h" diff --git a/src/nvim/os/process.c b/src/nvim/os/process.c @@ -6,10 +6,21 @@ /// psutil is a good reference for cross-platform syscall voodoo: /// https://github.com/giampaolo/psutil/tree/master/psutil/arch -#include <uv.h> // for HANDLE (win32) +#include <assert.h> +#include <signal.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdio.h> +#include <uv.h> + +#include "nvim/log.h" +#include "nvim/memory.h" +#include "nvim/os/process.h" #ifdef MSWIN -# include <tlhelp32.h> // for CreateToolhelp32Snapshot +# include <tlhelp32.h> + +# include "nvim/api/private/helpers.h" #endif #if defined(__FreeBSD__) // XXX: OpenBSD ? @@ -27,15 +38,8 @@ # include <sys/sysctl.h> #endif -#include "nvim/api/private/helpers.h" -#include "nvim/globals.h" -#include "nvim/log.h" -#include "nvim/os/os.h" -#include "nvim/os/os_defs.h" -#include "nvim/os/process.h" - #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "os/process.c.generated.h" +# include "os/process.c.generated.h" // IWYU pragma: export #endif #ifdef MSWIN diff --git a/src/nvim/os/pty_process_unix.c b/src/nvim/os/pty_process_unix.c @@ -2,13 +2,15 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // Some of the code came from pangoterm and libuv -#include <stdbool.h> + +#include <assert.h> +#include <errno.h> +#include <fcntl.h> +#include <signal.h> #include <stdlib.h> #include <string.h> #include <sys/ioctl.h> -#include <sys/types.h> #include <sys/wait.h> -#include <termios.h> // forkpty is not in POSIX, so headers are platform-specific #if defined(__FreeBSD__) || defined(__DragonFly__) @@ -31,13 +33,16 @@ #include <uv.h> +#include "auto/config.h" #include "klib/klist.h" +#include "nvim/eval/typval.h" #include "nvim/event/loop.h" #include "nvim/event/process.h" -#include "nvim/event/rstream.h" -#include "nvim/event/wstream.h" +#include "nvim/event/stream.h" #include "nvim/log.h" #include "nvim/os/os.h" +#include "nvim/os/os_defs.h" +#include "nvim/os/pty_process.h" #include "nvim/os/pty_process_unix.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/os/pty_process_unix.h b/src/nvim/os/pty_process_unix.h @@ -1,8 +1,10 @@ #ifndef NVIM_OS_PTY_PROCESS_UNIX_H #define NVIM_OS_PTY_PROCESS_UNIX_H +#include <stdint.h> #include <sys/ioctl.h> +#include "nvim/event/loop.h" #include "nvim/event/process.h" typedef struct pty_process { diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c @@ -3,30 +3,45 @@ #include <assert.h> #include <stdbool.h> -#include <stdlib.h> +#include <stdint.h> +#include <stdio.h> #include <string.h> #include <uv.h> +#include "auto/config.h" #include "klib/kvec.h" #include "nvim/ascii.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/eval.h" +#include "nvim/eval/typval_defs.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/rstream.h" +#include "nvim/event/stream.h" +#include "nvim/event/wstream.h" #include "nvim/ex_cmds.h" #include "nvim/fileio.h" -#include "nvim/log.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/macros.h" #include "nvim/main.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option_defs.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" #include "nvim/path.h" +#include "nvim/pos.h" #include "nvim/profile.h" -#include "nvim/screen.h" +#include "nvim/rbuffer.h" #include "nvim/strings.h" #include "nvim/tag.h" #include "nvim/types.h" diff --git a/src/nvim/os/signal.c b/src/nvim/os/signal.c @@ -3,23 +3,20 @@ #include <assert.h> #include <stdbool.h> -#include <uv.h> +#include <stdio.h> #ifndef MSWIN # include <signal.h> // for sigset_t #endif -#include "nvim/ascii.h" #include "nvim/autocmd.h" +#include "nvim/buffer_defs.h" #include "nvim/eval.h" -#include "nvim/event/loop.h" #include "nvim/event/signal.h" #include "nvim/globals.h" #include "nvim/log.h" #include "nvim/main.h" #include "nvim/memline.h" -#include "nvim/memory.h" #include "nvim/os/signal.h" -#include "nvim/vim.h" static SignalWatcher spipe, shup, squit, sterm, susr1, swinch; #ifdef SIGPWR diff --git a/src/nvim/os/stdpaths.c b/src/nvim/os/stdpaths.c @@ -2,6 +2,7 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <stdbool.h> +#include <string.h> #include "nvim/ascii.h" #include "nvim/fileio.h" diff --git a/src/nvim/os/time.c b/src/nvim/os/time.c @@ -1,22 +1,34 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include <assert.h> +#include <inttypes.h> #include <limits.h> +#include <stdbool.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> + #include <uv.h> -#include "nvim/assert.h" +#include "auto/config.h" #include "nvim/event/loop.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/log.h" +#include "nvim/macros.h" #include "nvim/main.h" +#include "nvim/memory.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/time.h" +struct tm; + static uv_mutex_t delay_mutex; static uv_cond_t delay_cond; #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "os/time.c.generated.h" +# include "os/time.c.generated.h" // IWYU pragma: export #endif /// Initializes the time module diff --git a/src/nvim/os/tty.c b/src/nvim/os/tty.c @@ -5,11 +5,11 @@ // Terminal/console utils // -#include "nvim/os/os.h" +#include "nvim/os/os.h" // IWYU pragma: keep (Windows) #include "nvim/os/tty.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "os/tty.c.generated.h" +# include "os/tty.c.generated.h" // IWYU pragma: export #endif #ifdef MSWIN diff --git a/src/nvim/os/unix_defs.h b/src/nvim/os/unix_defs.h @@ -3,6 +3,9 @@ #include <sys/param.h> #include <unistd.h> +#if defined(HAVE_TERMIOS_H) +# include <termios.h> +#endif // POSIX.1-2008 says that NAME_MAX should be in here #include <limits.h> diff --git a/src/nvim/os/users.c b/src/nvim/os/users.c @@ -3,6 +3,9 @@ // users.c -- operating system user information +#include <stdbool.h> +#include <stdio.h> +#include <string.h> #include <uv.h> #include "auto/config.h" @@ -10,7 +13,8 @@ #include "nvim/garray.h" #include "nvim/memory.h" #include "nvim/os/os.h" -#include "nvim/strings.h" +#include "nvim/types.h" +#include "nvim/vim.h" #ifdef HAVE_PWD_H # include <pwd.h> #endif diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c @@ -1,43 +1,12 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include <assert.h> -#include <errno.h> -#include <inttypes.h> -#include <stdbool.h> -#include <string.h> - -#include "nvim/ascii.h" -#include "nvim/buffer.h" -#include "nvim/charset.h" -#include "nvim/eval.h" -#include "nvim/ex_cmds.h" -#include "nvim/fileio.h" -#include "nvim/garray.h" -#include "nvim/getchar.h" -#include "nvim/main.h" -#include "nvim/mbyte.h" -#include "nvim/memline.h" -#include "nvim/memory.h" -#include "nvim/message.h" -#include "nvim/mouse.h" -#include "nvim/msgpack_rpc/helpers.h" -#include "nvim/os/input.h" -#include "nvim/os/os.h" -#include "nvim/os/shell.h" -#include "nvim/os/signal.h" -#include "nvim/os/time.h" +#include "nvim/os/os_defs.h" #include "nvim/os_unix.h" -#include "nvim/path.h" -#include "nvim/screen.h" -#include "nvim/strings.h" -#include "nvim/syntax.h" #include "nvim/types.h" -#include "nvim/ui.h" -#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "os_unix.c.generated.h" +# include "os_unix.c.generated.h" // IWYU pragma: export #endif #if defined(HAVE_ACL) diff --git a/src/nvim/os_unix.h b/src/nvim/os_unix.h @@ -2,7 +2,7 @@ #define NVIM_OS_UNIX_H #include "nvim/os/shell.h" -#include "nvim/types.h" // for vim_acl_T +#include "nvim/types.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "os_unix.h.generated.h" diff --git a/src/nvim/path.c b/src/nvim/path.c @@ -2,11 +2,16 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <assert.h> -#include <inttypes.h> +#include <ctype.h> +#include <limits.h> #include <stdbool.h> +#include <stddef.h> #include <stdlib.h> +#include <string.h> +#include "auto/config.h" #include "nvim/ascii.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cmdexpand.h" #include "nvim/eval.h" @@ -14,21 +19,21 @@ #include "nvim/file_search.h" #include "nvim/fileio.h" #include "nvim/garray.h" -#include "nvim/memfile.h" -#include "nvim/memline.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/macros.h" +#include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/os/fs_defs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/shell.h" -#include "nvim/os_unix.h" #include "nvim/path.h" -#include "nvim/quickfix.h" +#include "nvim/pos.h" #include "nvim/regexp.h" -#include "nvim/screen.h" #include "nvim/strings.h" -#include "nvim/tag.h" #include "nvim/types.h" #include "nvim/vim.h" #include "nvim/window.h" diff --git a/src/nvim/plines.c b/src/nvim/plines.c @@ -10,25 +10,21 @@ #include <string.h> #include "nvim/ascii.h" -#include "nvim/buffer.h" #include "nvim/charset.h" -#include "nvim/cursor.h" #include "nvim/decoration.h" #include "nvim/diff.h" #include "nvim/fold.h" -#include "nvim/func_attr.h" +#include "nvim/globals.h" #include "nvim/indent.h" -#include "nvim/main.h" +#include "nvim/macros.h" #include "nvim/mbyte.h" #include "nvim/memline.h" -#include "nvim/memory.h" #include "nvim/move.h" #include "nvim/option.h" #include "nvim/plines.h" -#include "nvim/screen.h" -#include "nvim/strings.h" +#include "nvim/pos.h" +#include "nvim/types.h" #include "nvim/vim.h" -#include "nvim/window.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "plines.c.generated.h" diff --git a/src/nvim/plines.h b/src/nvim/plines.h @@ -1,6 +1,9 @@ #ifndef NVIM_PLINES_H #define NVIM_PLINES_H +#include <stdbool.h> + +#include "nvim/buffer_defs.h" #include "nvim/vim.h" // Argument for lbr_chartabsize(). diff --git a/src/nvim/popupmenu.c b/src/nvim/popupmenu.c @@ -6,27 +6,35 @@ /// Popup menu (PUM) #include <assert.h> -#include <inttypes.h> +#include <limits.h> #include <stdbool.h> +#include <string.h> +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" #include "nvim/buffer.h" #include "nvim/charset.h" #include "nvim/drawscreen.h" -#include "nvim/edit.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds.h" +#include "nvim/getchar.h" +#include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/highlight.h" #include "nvim/insexpand.h" +#include "nvim/keycodes.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/menu.h" +#include "nvim/message.h" #include "nvim/move.h" #include "nvim/option.h" #include "nvim/popupmenu.h" -#include "nvim/search.h" +#include "nvim/pos.h" +#include "nvim/screen.h" #include "nvim/strings.h" #include "nvim/ui.h" #include "nvim/ui_compositor.h" diff --git a/src/nvim/popupmenu.h b/src/nvim/popupmenu.h @@ -1,6 +1,8 @@ #ifndef NVIM_POPUPMENU_H #define NVIM_POPUPMENU_H +#include <stdbool.h> + #include "nvim/grid_defs.h" #include "nvim/macros.h" #include "nvim/types.h" diff --git a/src/nvim/profile.c b/src/nvim/profile.c @@ -3,20 +3,34 @@ #include <assert.h> #include <math.h> +#include <stdbool.h> +#include <stdint.h> #include <stdio.h> +#include <stdlib.h> +#include <string.h> -#include "nvim/assert.h" +#include "nvim/ascii.h" #include "nvim/charset.h" #include "nvim/debugger.h" #include "nvim/eval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/userfunc.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/fileio.h" -#include "nvim/func_attr.h" -#include "nvim/globals.h" // for the global `time_fd` (startuptime) +#include "nvim/garray.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/hashtab.h" +#include "nvim/keycodes.h" +#include "nvim/memory.h" +#include "nvim/message.h" +#include "nvim/option_defs.h" #include "nvim/os/os.h" #include "nvim/os/time.h" +#include "nvim/pos.h" #include "nvim/profile.h" #include "nvim/runtime.h" +#include "nvim/types.h" #include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c @@ -4,30 +4,43 @@ // quickfix.c: functions for quickfix mode, using a file with error messages #include <assert.h> +#include <errno.h> #include <inttypes.h> +#include <limits.h> #include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> +#include <time.h> -#include "nvim/api/private/helpers.h" #include "nvim/arglist.h" #include "nvim/ascii.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/drawscreen.h" #include "nvim/edit.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds.h" #include "nvim/ex_cmds2.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" #include "nvim/ex_getln.h" #include "nvim/fileio.h" #include "nvim/fold.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/help.h" +#include "nvim/highlight_defs.h" #include "nvim/highlight_group.h" +#include "nvim/macros.h" #include "nvim/mark.h" #include "nvim/mbyte.h" +#include "nvim/memfile_defs.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" @@ -35,14 +48,16 @@ #include "nvim/normal.h" #include "nvim/option.h" #include "nvim/optionstr.h" +#include "nvim/os/fs_defs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" -#include "nvim/os_unix.h" #include "nvim/path.h" +#include "nvim/pos.h" #include "nvim/quickfix.h" #include "nvim/regexp.h" #include "nvim/search.h" #include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/vim.h" #include "nvim/window.h" diff --git a/src/nvim/rbuffer.c b/src/nvim/rbuffer.c @@ -2,15 +2,16 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <assert.h> +#include <stdbool.h> #include <stddef.h> #include <string.h> +#include "nvim/macros.h" #include "nvim/memory.h" #include "nvim/rbuffer.h" -#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "rbuffer.c.generated.h" +# include "rbuffer.c.generated.h" // IWYU pragma: export #endif /// Creates a new `RBuffer` instance. diff --git a/src/nvim/rbuffer.h b/src/nvim/rbuffer.h @@ -17,6 +17,8 @@ #include <stddef.h> #include <stdint.h> +struct rbuffer; + // Macros that simplify working with the read/write pointers directly by hiding // ring buffer wrap logic. Some examples: // diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c @@ -13,21 +13,34 @@ #include <inttypes.h> #include <stdbool.h> #include <string.h> +#include <sys/types.h> #include "nvim/ascii.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/userfunc.h" #include "nvim/garray.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/keycodes.h" +#include "nvim/macros.h" #include "nvim/mark.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" +#include "nvim/option_defs.h" #include "nvim/os/input.h" #include "nvim/plines.h" -#include "nvim/profile.h" +#include "nvim/pos.h" #include "nvim/regexp.h" +#include "nvim/regexp_defs.h" #include "nvim/strings.h" +#include "nvim/types.h" +#include "nvim/undo_defs.h" #include "nvim/vim.h" #ifdef REGEXP_DEBUG diff --git a/src/nvim/regexp.h b/src/nvim/regexp.h @@ -17,10 +17,11 @@ #define REX_ALL (REX_SET | REX_USE) // regexp.c +// uncrustify:off #ifdef INCLUDE_GENERATED_DECLARATIONS # include "regexp.h.generated.h" - # include "regexp_bt.h.generated.h" #endif +// uncrustify:on #endif // NVIM_REGEXP_H diff --git a/src/nvim/regexp_bt.c b/src/nvim/regexp_bt.c @@ -132,6 +132,7 @@ #include <string.h> #include "nvim/garray.h" +#include "nvim/profile.h" #include "nvim/regexp.h" // The opcodes are: diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c @@ -5,25 +5,47 @@ /// /// Management of runtime files (including packages) +#include <assert.h> +#include <errno.h> +#include <fcntl.h> +#include <inttypes.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#include <uv.h> + +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" #include "nvim/autocmd.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cmdexpand.h" #include "nvim/debugger.h" #include "nvim/eval.h" #include "nvim/eval/userfunc.h" -#include "nvim/ex_cmds.h" -#include "nvim/ex_cmds2.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" +#include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/lua/executor.h" +#include "nvim/macros.h" +#include "nvim/map.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" +#include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/option.h" #include "nvim/os/input.h" #include "nvim/os/os.h" +#include "nvim/os/stdpaths_defs.h" +#include "nvim/path.h" #include "nvim/profile.h" #include "nvim/runtime.h" +#include "nvim/strings.h" +#include "nvim/usercmd.h" #include "nvim/vim.h" /// Structure used to store info for each sourced file. diff --git a/src/nvim/runtime.h b/src/nvim/runtime.h @@ -3,10 +3,15 @@ #include <stdbool.h> +#include "klib/kvec.h" #include "nvim/autocmd.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" #include "nvim/ex_eval_defs.h" +#include "nvim/garray.h" +#include "nvim/pos.h" +#include "nvim/types.h" typedef enum { ETYPE_TOP, ///< toplevel diff --git a/src/nvim/screen.c b/src/nvim/screen.c @@ -10,32 +10,44 @@ #include <assert.h> #include <inttypes.h> +#include <limits.h> #include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> +#include "nvim/ascii.h" #include "nvim/buffer.h" #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/eval.h" -#include "nvim/extmark.h" -#include "nvim/fileio.h" #include "nvim/fold.h" -#include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/grid.h" +#include "nvim/grid_defs.h" #include "nvim/highlight.h" -#include "nvim/highlight_group.h" +#include "nvim/mbyte.h" +#include "nvim/memline_defs.h" +#include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/move.h" +#include "nvim/normal.h" #include "nvim/option.h" -#include "nvim/optionstr.h" +#include "nvim/os/os.h" +#include "nvim/os/time.h" +#include "nvim/pos.h" #include "nvim/profile.h" #include "nvim/regexp.h" #include "nvim/screen.h" #include "nvim/search.h" #include "nvim/state.h" #include "nvim/statusline.h" -#include "nvim/ui_compositor.h" -#include "nvim/undo.h" +#include "nvim/strings.h" +#include "nvim/types.h" +#include "nvim/ui.h" +#include "nvim/vim.h" #include "nvim/window.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/screen.h b/src/nvim/screen.h @@ -6,6 +6,7 @@ #include "nvim/buffer_defs.h" #include "nvim/fold.h" #include "nvim/grid_defs.h" +#include "nvim/macros.h" EXTERN match_T screen_search_hl; // used for 'hlsearch' highlight matching diff --git a/src/nvim/search.c b/src/nvim/search.c @@ -5,31 +5,35 @@ #include <assert.h> #include <inttypes.h> -#include <limits.h> // for INT_MAX on MSVC +#include <limits.h> #include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> #include "nvim/ascii.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/change.h" #include "nvim/charset.h" #include "nvim/cmdhist.h" #include "nvim/cursor.h" #include "nvim/drawscreen.h" -#include "nvim/edit.h" #include "nvim/eval.h" -#include "nvim/eval/funcs.h" +#include "nvim/eval/typval.h" #include "nvim/ex_cmds.h" #include "nvim/ex_docmd.h" #include "nvim/ex_getln.h" #include "nvim/fileio.h" #include "nvim/fold.h" -#include "nvim/func_attr.h" #include "nvim/getchar.h" -#include "nvim/indent.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/highlight_defs.h" #include "nvim/indent_c.h" #include "nvim/insexpand.h" -#include "nvim/main.h" +#include "nvim/macros.h" #include "nvim/mark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" @@ -39,11 +43,13 @@ #include "nvim/move.h" #include "nvim/normal.h" #include "nvim/option.h" +#include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/time.h" #include "nvim/path.h" #include "nvim/profile.h" #include "nvim/regexp.h" +#include "nvim/screen.h" #include "nvim/search.h" #include "nvim/strings.h" #include "nvim/ui.h" diff --git a/src/nvim/search.h b/src/nvim/search.h @@ -6,8 +6,11 @@ #include "nvim/buffer_defs.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/normal.h" #include "nvim/os/time.h" +#include "nvim/pos.h" +#include "nvim/types.h" #include "nvim/vim.h" // Values for the find_pattern_in_path() function args 'type' and 'action': diff --git a/src/nvim/sha256.c b/src/nvim/sha256.c @@ -13,11 +13,13 @@ /// Vim specific notes: /// sha256_self_test() is implicitly called once. -#include <stddef.h> // for size_t -#include <stdio.h> // for snprintf(). +#include <stdbool.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> -#include "nvim/sha256.h" // for context_sha256_T -#include "nvim/vim.h" // for STRCPY()/strlen(). +#include "nvim/sha256.h" +#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "sha256.c.generated.h" diff --git a/src/nvim/sha256.h b/src/nvim/sha256.h @@ -2,9 +2,9 @@ #define NVIM_SHA256_H #include <stddef.h> -#include <stdint.h> // for uint32_t +#include <stdint.h> -#include "nvim/types.h" // for char_u +#include "nvim/types.h" #define SHA256_BUFFER_SIZE 64 #define SHA256_SUM_SIZE 32 diff --git a/src/nvim/shada.c b/src/nvim/shada.c @@ -2,48 +2,58 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <assert.h> -#include <errno.h> #include <inttypes.h> -#include <msgpack.h> +#include <msgpack/object.h> +#include <msgpack/pack.h> +#include <msgpack/sbuffer.h> +#include <msgpack/unpack.h> #include <stdbool.h> #include <stddef.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> +#include <sys/stat.h> #include <uv.h> +#include "auto/config.h" #include "klib/khash.h" -#include "klib/kvec.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" #include "nvim/buffer.h" -#include "nvim/buffer_defs.h" #include "nvim/cmdhist.h" +#include "nvim/eval.h" #include "nvim/eval/decode.h" #include "nvim/eval/encode.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds.h" #include "nvim/ex_docmd.h" #include "nvim/fileio.h" #include "nvim/garray.h" +#include "nvim/gettext.h" #include "nvim/globals.h" +#include "nvim/hashtab.h" #include "nvim/macros.h" #include "nvim/mark.h" +#include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/msgpack_rpc/helpers.h" +#include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" #include "nvim/os/fileio.h" +#include "nvim/os/fs_defs.h" #include "nvim/os/os.h" #include "nvim/os/time.h" #include "nvim/path.h" #include "nvim/pos.h" -#include "nvim/quickfix.h" #include "nvim/regexp.h" #include "nvim/search.h" #include "nvim/shada.h" #include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/version.h" #include "nvim/vim.h" @@ -288,8 +298,6 @@ typedef struct { } data; } ShadaEntry; -struct hm_llist_entry; - /// One entry in sized linked list typedef struct hm_llist_entry { ShadaEntry data; ///< Entry data. diff --git a/src/nvim/sign.c b/src/nvim/sign.c @@ -5,20 +5,42 @@ // sign.c: functions for managing with signs // +#include <inttypes.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + #include "nvim/ascii.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/drawscreen.h" #include "nvim/edit.h" #include "nvim/eval/funcs.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" #include "nvim/fold.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/hashtab.h" +#include "nvim/highlight_defs.h" #include "nvim/highlight_group.h" +#include "nvim/macros.h" +#include "nvim/mbyte.h" +#include "nvim/memline_defs.h" +#include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/move.h" #include "nvim/option.h" +#include "nvim/pos.h" #include "nvim/sign.h" -#include "nvim/syntax.h" +#include "nvim/sign_defs.h" +#include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/vim.h" #include "nvim/window.h" diff --git a/src/nvim/spell.c b/src/nvim/spell.c @@ -56,61 +56,58 @@ // Use DEBUG_TRIEWALK to print the changes made in suggest_trie_walk() for a // specific word. -#include <assert.h> // for assert -#include <inttypes.h> // for uint32_t, uint16_t, uint8_t -#include <limits.h> // for INT_MAX -#include <stdbool.h> // for false, true, bool -#include <stddef.h> // for NULL, size_t, ptrdiff_t -#include <stdio.h> // for snprintf -#include <string.h> // for memmove, strstr, memcpy, memset - -#include "nvim/ascii.h" // for NUL, ascii_isdigit, ascii_iswhite -#include "nvim/autocmd.h" // for apply_autocmds -#include "nvim/buffer.h" // for bufref_valid, set_bufref, buf_is_empty -#include "nvim/buffer_defs.h" // for win_T, synblock_T, buf_T, w_p_... -#include "nvim/change.h" // for changed_bytes -#include "nvim/charset.h" // for skipwhite, getwhitecols, skipbin -#include "nvim/cursor.h" // for get_cursor_line_ptr +#include <assert.h> +#include <inttypes.h> +#include <limits.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> + +#include "nvim/ascii.h" +#include "nvim/autocmd.h" +#include "nvim/buffer.h" +#include "nvim/change.h" +#include "nvim/charset.h" +#include "nvim/cursor.h" #include "nvim/decoration.h" -#include "nvim/drawscreen.h" // for NOT_VALID, redraw_later -#include "nvim/eval/typval.h" // for semsg -#include "nvim/ex_cmds.h" // for do_sub_msg -#include "nvim/ex_cmds_defs.h" // for exarg_T -#include "nvim/ex_docmd.h" // for do_cmdline_cmd -#include "nvim/garray.h" // for garray_T, GA_EMPTY, GA_APPEND_... -#include "nvim/gettext.h" // for _, N_ -#include "nvim/hashtab.h" // for hash_clear_all, hash_init, has... -#include "nvim/highlight_defs.h" // for HLF_COUNT, hlf_T, HLF_SPB, HLF... -#include "nvim/insexpand.h" // for ins_compl_add_infercase, ins_c... -#include "nvim/log.h" // for ELOG -#include "nvim/macros.h" // for MB_PTR_ADV, MB_PTR_BACK, ASCII... -#include "nvim/mark.h" // for clearpos -#include "nvim/mbyte.h" // for utf_ptr2char, utf_char2bytes -#include "nvim/memline.h" // for ml_append, ml_get_buf, ml_close -#include "nvim/memline_defs.h" // for memline_T -#include "nvim/memory.h" // for xfree, xmalloc, xcalloc, xstrdup -#include "nvim/message.h" // for emsg, msg_puts, give_warning -#include "nvim/option.h" // for copy_option_part, set_option_v... -#include "nvim/option_defs.h" // for p_ws, OPT_LOCAL, p_enc, SHM_SE... -#include "nvim/os/fs.h" // for os_remove -#include "nvim/os/input.h" // for line_breakcheck -#include "nvim/os/os_defs.h" // for MAXPATHL -#include "nvim/path.h" // for path_full_compare, path_tail... -#include "nvim/pos.h" // for pos_T, colnr_T, linenr_T -#include "nvim/regexp.h" // for vim_regfree, vim_regexec, vim_... -#include "nvim/regexp_defs.h" // for regmatch_T, regprog_T -#include "nvim/runtime.h" // for DIP_ALL, do_in_runtimepath -#include "nvim/search.h" // for SEARCH_KEEP, for do_search -#include "nvim/spell.h" // for FUNC_ATTR_NONNULL_ALL, FUNC_AT... -#include "nvim/spell_defs.h" // for slang_T, langp_T, MAXWLEN, sal... -#include "nvim/spellfile.h" // for spell_load_file -#include "nvim/spellsuggest.h" // for spell_suggest_list -#include "nvim/strings.h" // for vim_strchr, vim_snprintf, conc... -#include "nvim/syntax.h" // for syn_get_id, syntax_present -#include "nvim/types.h" // for char_u -#include "nvim/undo.h" // for u_save_cursor -#include "nvim/vim.h" // for curwin, strlen, STRLCPY, STRNCMP -#include "nvim/window.h" // for win_valid_any_tab +#include "nvim/decoration_provider.h" +#include "nvim/drawscreen.h" +#include "nvim/ex_cmds.h" +#include "nvim/ex_cmds_defs.h" +#include "nvim/ex_docmd.h" +#include "nvim/garray.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/hashtab.h" +#include "nvim/highlight_defs.h" +#include "nvim/insexpand.h" +#include "nvim/log.h" +#include "nvim/macros.h" +#include "nvim/mark.h" +#include "nvim/mbyte.h" +#include "nvim/memline.h" +#include "nvim/memory.h" +#include "nvim/message.h" +#include "nvim/option.h" +#include "nvim/os/fs.h" +#include "nvim/os/input.h" +#include "nvim/os/os_defs.h" +#include "nvim/path.h" +#include "nvim/pos.h" +#include "nvim/regexp.h" +#include "nvim/runtime.h" +#include "nvim/search.h" +#include "nvim/spell.h" +#include "nvim/spell_defs.h" +#include "nvim/spellfile.h" +#include "nvim/spellsuggest.h" +#include "nvim/strings.h" +#include "nvim/syntax.h" +#include "nvim/types.h" +#include "nvim/undo.h" +#include "nvim/vim.h" +#include "nvim/window.h" // Result values. Lower number is accepted over higher one. enum { diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c @@ -226,34 +226,52 @@ // stored as an offset to the previous number in as // few bytes as possible, see offset2bytes()) -#include <stdint.h> +#include <assert.h> +#include <ctype.h> +#include <inttypes.h> +#include <limits.h> +#include <stdbool.h> #include <stdio.h> -#include <wctype.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include "auto/config.h" #include "nvim/arglist.h" #include "nvim/ascii.h" #include "nvim/buffer.h" #include "nvim/charset.h" #include "nvim/drawscreen.h" -#include "nvim/ex_cmds2.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/fileio.h" +#include "nvim/garray.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/hashtab.h" +#include "nvim/macros.h" +#include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/option.h" #include "nvim/os/input.h" #include "nvim/os/os.h" +#include "nvim/os/time.h" #include "nvim/path.h" +#include "nvim/pos.h" #include "nvim/regexp.h" #include "nvim/runtime.h" #include "nvim/spell.h" #include "nvim/spell_defs.h" #include "nvim/spellfile.h" +#include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/vim.h" #ifndef UNIX // it's in os/unix_defs.h for Unix -# include <time.h> // for time_t +# include <time.h> #endif // Special byte values for <byte>. Some are only used in the tree for diff --git a/src/nvim/spellsuggest.c b/src/nvim/spellsuggest.c @@ -3,30 +3,48 @@ // spellsuggest.c: functions for spelling suggestions +#include <assert.h> +#include <inttypes.h> +#include <limits.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + #include "nvim/ascii.h" +#include "nvim/buffer_defs.h" #include "nvim/change.h" #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/fileio.h" #include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/hashtab.h" +#include "nvim/highlight_defs.h" #include "nvim/input.h" +#include "nvim/macros.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" +#include "nvim/normal.h" #include "nvim/option.h" #include "nvim/os/fs.h" #include "nvim/os/input.h" +#include "nvim/os/os_defs.h" +#include "nvim/pos.h" #include "nvim/profile.h" #include "nvim/screen.h" #include "nvim/spell.h" -#include "nvim/spell_defs.h" #include "nvim/spellfile.h" #include "nvim/spellsuggest.h" #include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/vim.h" diff --git a/src/nvim/state.c b/src/nvim/state.c @@ -1,27 +1,38 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include <assert.h> +#include <stdbool.h> +#include <stddef.h> +#include <string.h> -#include "klib/kvec.h" #include "nvim/ascii.h" #include "nvim/autocmd.h" +#include "nvim/buffer_defs.h" #include "nvim/drawscreen.h" #include "nvim/eval.h" -#include "nvim/ex_docmd.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/event/defs.h" +#include "nvim/event/loop.h" +#include "nvim/event/multiqueue.h" #include "nvim/getchar.h" +#include "nvim/globals.h" #include "nvim/insexpand.h" +#include "nvim/keycodes.h" #include "nvim/log.h" +#include "nvim/macros.h" #include "nvim/main.h" #include "nvim/option.h" -#include "nvim/option_defs.h" #include "nvim/os/input.h" +#include "nvim/screen.h" #include "nvim/state.h" +#include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "state.c.generated.h" +# include "state.c.generated.h" // IWYU pragma: export #endif void state_enter(VimState *s) diff --git a/src/nvim/state.h b/src/nvim/state.h @@ -3,6 +3,8 @@ #include <stddef.h> +struct vim_state; + typedef struct vim_state VimState; typedef int (*state_check_callback)(VimState *state); diff --git a/src/nvim/statusline.c b/src/nvim/statusline.c @@ -5,22 +5,41 @@ #include <assert.h> #include <inttypes.h> #include <stdbool.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> -#include "nvim/assert.h" -#include "nvim/autocmd.h" +#include "nvim/api/private/defs.h" +#include "nvim/api/private/helpers.h" +#include "nvim/ascii.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/drawscreen.h" #include "nvim/eval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/vars.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/highlight.h" #include "nvim/highlight_group.h" +#include "nvim/macros.h" +#include "nvim/mbyte.h" +#include "nvim/memline.h" +#include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/move.h" #include "nvim/option.h" #include "nvim/optionstr.h" +#include "nvim/os/os.h" +#include "nvim/path.h" +#include "nvim/pos.h" +#include "nvim/screen.h" #include "nvim/statusline.h" +#include "nvim/strings.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/vim.h" diff --git a/src/nvim/statusline.h b/src/nvim/statusline.h @@ -1,7 +1,11 @@ #ifndef NVIM_STATUSLINE_H #define NVIM_STATUSLINE_H +#include <stddef.h> + #include "nvim/buffer_defs.h" +#include "nvim/macros.h" +#include "nvim/statusline_defs.h" /// Array defining what should be done when tabline is clicked EXTERN StlClickDefinition *tab_page_click_defs INIT(= NULL); diff --git a/src/nvim/strings.c b/src/nvim/strings.c @@ -6,48 +6,29 @@ #include <math.h> #include <stdarg.h> #include <stdbool.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> +#include "auto/config.h" #include "nvim/ascii.h" #include "nvim/assert.h" -#include "nvim/buffer.h" #include "nvim/charset.h" -#include "nvim/diff.h" -#include "nvim/edit.h" -#include "nvim/eval.h" #include "nvim/eval/encode.h" -#include "nvim/ex_cmds.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_docmd.h" -#include "nvim/ex_getln.h" -#include "nvim/file_search.h" -#include "nvim/fileio.h" -#include "nvim/fold.h" -#include "nvim/func_attr.h" -#include "nvim/getchar.h" -#include "nvim/mark.h" +#include "nvim/gettext.h" +#include "nvim/macros.h" #include "nvim/math.h" #include "nvim/mbyte.h" -#include "nvim/memfile.h" -#include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/move.h" -#include "nvim/ops.h" #include "nvim/option.h" -#include "nvim/os/os.h" -#include "nvim/os/shell.h" -#include "nvim/os_unix.h" -#include "nvim/path.h" -#include "nvim/quickfix.h" -#include "nvim/regexp.h" -#include "nvim/screen.h" -#include "nvim/search.h" -#include "nvim/spell.h" #include "nvim/strings.h" -#include "nvim/syntax.h" -#include "nvim/tag.h" +#include "nvim/types.h" #include "nvim/vim.h" -#include "nvim/window.h" /// Copy up to `len` bytes of `string` into newly allocated memory and /// terminate with a NUL. The allocated memory always has size `len + 1`, even diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c @@ -4,51 +4,46 @@ // syntax.c: code for syntax highlighting #include <assert.h> -#include <ctype.h> #include <inttypes.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> -#include "nvim/api/private/helpers.h" #include "nvim/ascii.h" #include "nvim/autocmd.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" -#include "nvim/cursor_shape.h" #include "nvim/drawscreen.h" #include "nvim/eval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/vars.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" -#include "nvim/fileio.h" #include "nvim/fold.h" #include "nvim/garray.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/hashtab.h" -#include "nvim/highlight.h" +#include "nvim/highlight_defs.h" #include "nvim/highlight_group.h" #include "nvim/indent_c.h" -#include "nvim/keycodes.h" -#include "nvim/lua/executor.h" #include "nvim/macros.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option.h" +#include "nvim/option_defs.h" #include "nvim/optionstr.h" #include "nvim/os/input.h" -#include "nvim/os/os.h" -#include "nvim/os/time.h" -#include "nvim/os_unix.h" #include "nvim/path.h" +#include "nvim/pos.h" #include "nvim/profile.h" #include "nvim/regexp.h" -#include "nvim/sign.h" +#include "nvim/runtime.h" #include "nvim/strings.h" #include "nvim/syntax.h" -#include "nvim/syntax_defs.h" -#include "nvim/terminal.h" -#include "nvim/ui.h" +#include "nvim/types.h" #include "nvim/vim.h" static bool did_syntax_onoff = false; diff --git a/src/nvim/syntax.h b/src/nvim/syntax.h @@ -6,6 +6,7 @@ #include "nvim/buffer_defs.h" #include "nvim/ex_cmds_defs.h" #include "nvim/globals.h" +#include "nvim/macros.h" #define HL_CONTAINED 0x01 // not used on toplevel #define HL_TRANSP 0x02 // has no highlighting diff --git a/src/nvim/tag.c b/src/nvim/tag.c @@ -4,28 +4,38 @@ // Code to handle tags and the tag stack #include <assert.h> +#include <ctype.h> #include <inttypes.h> #include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> #include "nvim/ascii.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" #include "nvim/charset.h" #include "nvim/cmdexpand.h" #include "nvim/cursor.h" #include "nvim/drawscreen.h" -#include "nvim/edit.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_docmd.h" -#include "nvim/ex_getln.h" #include "nvim/file_search.h" #include "nvim/fileio.h" #include "nvim/fold.h" #include "nvim/garray.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/hashtab.h" #include "nvim/help.h" +#include "nvim/highlight_defs.h" #include "nvim/input.h" #include "nvim/insexpand.h" +#include "nvim/macros.h" #include "nvim/mark.h" #include "nvim/mbyte.h" #include "nvim/memory.h" @@ -35,15 +45,17 @@ #include "nvim/optionstr.h" #include "nvim/os/input.h" #include "nvim/os/os.h" +#include "nvim/os/os_defs.h" #include "nvim/os/time.h" -#include "nvim/os_unix.h" #include "nvim/path.h" +#include "nvim/pos.h" #include "nvim/quickfix.h" #include "nvim/regexp.h" #include "nvim/runtime.h" #include "nvim/search.h" #include "nvim/strings.h" #include "nvim/tag.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/vim.h" #include "nvim/window.h" diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c @@ -37,45 +37,57 @@ // Some code from pangoterm http://www.leonerd.org.uk/code/pangoterm #include <assert.h> +#include <limits.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> +#include <stdlib.h> +#include <string.h> #include <vterm.h> +#include <vterm_keycodes.h> +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" #include "nvim/autocmd.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/change.h" +#include "nvim/channel.h" #include "nvim/cursor.h" +#include "nvim/drawline.h" #include "nvim/drawscreen.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_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_docmd.h" #include "nvim/getchar.h" +#include "nvim/globals.h" #include "nvim/highlight.h" #include "nvim/highlight_group.h" #include "nvim/keycodes.h" -#include "nvim/log.h" #include "nvim/macros.h" #include "nvim/main.h" #include "nvim/map.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" -#include "nvim/message.h" #include "nvim/mouse.h" #include "nvim/move.h" +#include "nvim/msgpack_rpc/channel_defs.h" +#include "nvim/normal.h" #include "nvim/option.h" #include "nvim/optionstr.h" -#include "nvim/os/input.h" +#include "nvim/pos.h" +#include "nvim/screen.h" #include "nvim/state.h" #include "nvim/terminal.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/vim.h" -#include "nvim/window.h" typedef struct terminal_state { VimState state; diff --git a/src/nvim/testing.c b/src/nvim/testing.c @@ -3,14 +3,32 @@ // testing.c: Support for tests +#include <inttypes.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdio.h> +#include <string.h> + +#include "nvim/ascii.h" #include "nvim/eval.h" #include "nvim/eval/encode.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_docmd.h" +#include "nvim/garray.h" +#include "nvim/gettext.h" #include "nvim/globals.h" +#include "nvim/hashtab.h" +#include "nvim/macros.h" +#include "nvim/mbyte.h" +#include "nvim/memory.h" #include "nvim/message.h" #include "nvim/os/os.h" #include "nvim/runtime.h" +#include "nvim/strings.h" #include "nvim/testing.h" +#include "nvim/types.h" +#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "testing.c.generated.h" diff --git a/src/nvim/textformat.c b/src/nvim/textformat.c @@ -4,20 +4,29 @@ // textformat.c: text formatting functions #include <stdbool.h> +#include <stdint.h> +#include <string.h> #include "nvim/ascii.h" +#include "nvim/buffer_defs.h" #include "nvim/change.h" #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/drawscreen.h" #include "nvim/edit.h" #include "nvim/eval.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/getchar.h" #include "nvim/globals.h" #include "nvim/indent.h" #include "nvim/indent_c.h" +#include "nvim/macros.h" +#include "nvim/mark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" +#include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/move.h" #include "nvim/normal.h" #include "nvim/ops.h" @@ -28,6 +37,7 @@ #include "nvim/strings.h" #include "nvim/textformat.h" #include "nvim/textobject.h" +#include "nvim/types.h" #include "nvim/undo.h" #include "nvim/vim.h" #include "nvim/window.h" diff --git a/src/nvim/textformat.h b/src/nvim/textformat.h @@ -1,8 +1,8 @@ #ifndef NVIM_TEXTFORMAT_H #define NVIM_TEXTFORMAT_H -#include "nvim/normal.h" // for oparg_T -#include "nvim/pos.h" // for linenr_T +#include "nvim/normal.h" +#include "nvim/pos.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "textformat.h.generated.h" diff --git a/src/nvim/textobject.c b/src/nvim/textobject.c @@ -4,8 +4,11 @@ // textobject.c: functions for text objects #include <stdbool.h> +#include <stdio.h> +#include <string.h> #include "nvim/ascii.h" +#include "nvim/buffer_defs.h" #include "nvim/cursor.h" #include "nvim/drawscreen.h" #include "nvim/edit.h" @@ -13,14 +16,19 @@ #include "nvim/fold.h" #include "nvim/globals.h" #include "nvim/indent.h" +#include "nvim/macros.h" #include "nvim/mark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" +#include "nvim/memory.h" #include "nvim/normal.h" +#include "nvim/option_defs.h" #include "nvim/pos.h" +#include "nvim/screen.h" #include "nvim/search.h" -#include "nvim/textformat.h" +#include "nvim/strings.h" #include "nvim/textobject.h" +#include "nvim/types.h" #include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/textobject.h b/src/nvim/textobject.h @@ -1,9 +1,9 @@ #ifndef NVIM_TEXTOBJECT_H #define NVIM_TEXTOBJECT_H -#include "nvim/normal.h" // for oparg_T -#include "nvim/pos.h" // for linenr_T -#include "nvim/vim.h" // for Direction +#include "nvim/normal.h" +#include "nvim/pos.h" +#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "textobject.h.generated.h" diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c @@ -1,20 +1,32 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/api/vim.h" #include "nvim/ascii.h" #include "nvim/autocmd.h" #include "nvim/charset.h" -#include "nvim/ex_docmd.h" +#include "nvim/event/defs.h" +#include "nvim/event/multiqueue.h" +#include "nvim/globals.h" +#include "nvim/log.h" #include "nvim/macros.h" #include "nvim/main.h" +#include "nvim/map.h" +#include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/option.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/tui/input.h" +#include "nvim/tui/input_defs.h" #include "nvim/tui/tui.h" -#include "nvim/vim.h" #ifdef MSWIN # include "nvim/os/os_win_console.h" #endif diff --git a/src/nvim/tui/input.h b/src/nvim/tui/input.h @@ -2,10 +2,14 @@ #define NVIM_TUI_INPUT_H #include <stdbool.h> +#include <stdint.h> #include <termkey.h> +#include <uv.h> +#include "nvim/event/loop.h" #include "nvim/event/stream.h" #include "nvim/event/time.h" +#include "nvim/rbuffer.h" #include "nvim/tui/input_defs.h" #include "nvim/tui/tui.h" diff --git a/src/nvim/tui/terminfo.c b/src/nvim/tui/terminfo.c @@ -8,14 +8,16 @@ #include <unibilium.h> #include "nvim/globals.h" -#include "nvim/log.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" -#include "nvim/os/os.h" #include "nvim/tui/terminfo.h" #include "nvim/tui/terminfo_defs.h" +#ifdef __FreeBSD__ +# include "nvim/os/os.h" +#endif + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "tui/terminfo.c.generated.h" #endif diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c @@ -4,31 +4,35 @@ // Terminal UI functions. Invoked (by ui_bridge.c) on the TUI thread. #include <assert.h> -#include <limits.h> +#include <signal.h> #include <stdbool.h> #include <stdio.h> +#include <stdlib.h> +#include <string.h> #include <unibilium.h> #include <uv.h> -#if defined(HAVE_TERMIOS_H) -# include <termios.h> -#endif +#include "auto/config.h" #include "klib/kvec.h" -#include "nvim/api/private/helpers.h" -#include "nvim/api/vim.h" +#include "nvim/api/private/defs.h" #include "nvim/ascii.h" +#include "nvim/event/defs.h" #include "nvim/event/loop.h" +#include "nvim/event/multiqueue.h" #include "nvim/event/signal.h" -#include "nvim/highlight.h" +#include "nvim/event/stream.h" +#include "nvim/globals.h" +#include "nvim/grid_defs.h" +#include "nvim/highlight_defs.h" #include "nvim/log.h" #include "nvim/main.h" -#include "nvim/map.h" +#include "nvim/mbyte.h" #include "nvim/memory.h" +#include "nvim/message.h" #include "nvim/option.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/signal.h" -#include "nvim/os/tty.h" #include "nvim/ui.h" #include "nvim/vim.h" #ifdef MSWIN @@ -36,8 +40,6 @@ #endif #include "nvim/cursor_shape.h" #include "nvim/macros.h" -#include "nvim/strings.h" -#include "nvim/syntax.h" #include "nvim/tui/input.h" #include "nvim/tui/terminfo.h" #include "nvim/tui/tui.h" diff --git a/src/nvim/ugrid.c b/src/nvim/ugrid.c @@ -2,14 +2,10 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <assert.h> -#include <limits.h> -#include <stdbool.h> -#include <stdio.h> +#include <string.h> -#include "nvim/assert.h" +#include "nvim/memory.h" #include "nvim/ugrid.h" -#include "nvim/ui.h" -#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "ugrid.c.generated.h" diff --git a/src/nvim/ugrid.h b/src/nvim/ugrid.h @@ -2,8 +2,12 @@ #define NVIM_UGRID_H #include "nvim/globals.h" +#include "nvim/grid_defs.h" #include "nvim/ui.h" +struct ucell; +struct ugrid; + typedef struct ucell UCell; typedef struct ugrid UGrid; diff --git a/src/nvim/ui.c b/src/nvim/ui.c @@ -2,37 +2,35 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <assert.h> -#include <inttypes.h> #include <limits.h> #include <stdbool.h> -#include <string.h> +#include <stddef.h> +#include <stdint.h> +#include <stdlib.h> +#include "auto/config.h" +#include "klib/kvec.h" #include "nvim/ascii.h" #include "nvim/autocmd.h" -#include "nvim/charset.h" -#include "nvim/cursor.h" +#include "nvim/buffer_defs.h" #include "nvim/cursor_shape.h" -#include "nvim/diff.h" #include "nvim/drawscreen.h" +#include "nvim/event/defs.h" #include "nvim/event/loop.h" #include "nvim/ex_getln.h" -#include "nvim/fold.h" -#include "nvim/garray.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/highlight.h" +#include "nvim/highlight_defs.h" #include "nvim/log.h" #include "nvim/main.h" -#include "nvim/mbyte.h" #include "nvim/memory.h" -#include "nvim/move.h" +#include "nvim/message.h" #include "nvim/msgpack_rpc/channel.h" -#include "nvim/normal.h" #include "nvim/option.h" -#include "nvim/os/input.h" -#include "nvim/os/signal.h" #include "nvim/os/time.h" -#include "nvim/os_unix.h" -#include "nvim/popupmenu.h" +#include "nvim/strings.h" #include "nvim/ui.h" #include "nvim/ui_compositor.h" #include "nvim/vim.h" diff --git a/src/nvim/ui.h b/src/nvim/ui.h @@ -6,9 +6,14 @@ #include <stdint.h> #include "nvim/api/private/defs.h" +#include "nvim/event/multiqueue.h" #include "nvim/globals.h" #include "nvim/highlight_defs.h" +#include "nvim/macros.h" #include "nvim/memory.h" +#include "nvim/types.h" + +struct ui_t; typedef enum { kUICmdline = 0, @@ -74,11 +79,12 @@ typedef struct ui_event_callback { bool ext_widgets[kUIGlobalCount]; } UIEventCallback; +// uncrustify:off #ifdef INCLUDE_GENERATED_DECLARATIONS # include "ui.h.generated.h" - # include "ui_events_call.h.generated.h" #endif +// uncrustify:on EXTERN MultiQueue *resize_events; #endif // NVIM_UI_H diff --git a/src/nvim/ui_bridge.c b/src/nvim/ui_bridge.c @@ -4,19 +4,19 @@ // UI wrapper that sends requests to the UI thread. // Used by the built-in TUI and libnvim-based UIs. -#include <assert.h> -#include <limits.h> #include <stdbool.h> -#include <stdio.h> +#include <stdint.h> +#include <stdlib.h> +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" -#include "nvim/log.h" +#include "nvim/event/loop.h" +#include "nvim/grid_defs.h" +#include "nvim/highlight_defs.h" #include "nvim/main.h" #include "nvim/memory.h" -#include "nvim/ugrid.h" #include "nvim/ui.h" #include "nvim/ui_bridge.h" -#include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "ui_bridge.c.generated.h" diff --git a/src/nvim/ui_bridge.h b/src/nvim/ui_bridge.h @@ -3,11 +3,14 @@ #ifndef NVIM_UI_BRIDGE_H #define NVIM_UI_BRIDGE_H +#include <stdbool.h> #include <uv.h> #include "nvim/event/defs.h" #include "nvim/ui.h" +struct ui_bridge_data; + typedef struct ui_bridge_data UIBridgeData; typedef void (*ui_main_fn)(UIBridgeData *bridge, UI *ui); struct ui_bridge_data { diff --git a/src/nvim/ui_client.c b/src/nvim/ui_client.c @@ -1,26 +1,28 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -#include <assert.h> #include <stdbool.h> #include <stdint.h> +#include <stdlib.h> -#include "nvim/api/private/dispatch.h" #include "nvim/api/private/helpers.h" +#include "nvim/event/loop.h" +#include "nvim/event/multiqueue.h" +#include "nvim/globals.h" #include "nvim/highlight.h" #include "nvim/log.h" -#include "nvim/map.h" +#include "nvim/main.h" +#include "nvim/memory.h" #include "nvim/msgpack_rpc/channel.h" -#include "nvim/screen.h" #include "nvim/ui.h" #include "nvim/ui_client.h" -#include "nvim/vim.h" +// uncrustify:off #ifdef INCLUDE_GENERATED_DECLARATIONS # include "ui_client.c.generated.h" - # include "ui_events_client.generated.h" #endif +// uncrustify:on void ui_client_init(uint64_t chan) { diff --git a/src/nvim/ui_client.h b/src/nvim/ui_client.h @@ -1,8 +1,11 @@ #ifndef NVIM_UI_CLIENT_H #define NVIM_UI_CLIENT_H +#include <stddef.h> + #include "nvim/api/private/defs.h" #include "nvim/grid_defs.h" +#include "nvim/macros.h" typedef struct { const char *name; diff --git a/src/nvim/ui_compositor.c b/src/nvim/ui_compositor.c @@ -7,25 +7,30 @@ // Layer-based compositing: https://en.wikipedia.org/wiki/Digital_compositing #include <assert.h> +#include <inttypes.h> #include <limits.h> #include <stdbool.h> #include <stdio.h> +#include <stdlib.h> +#include <string.h> #include "klib/kvec.h" -#include "nvim/api/private/helpers.h" +#include "nvim/api/private/defs.h" #include "nvim/ascii.h" +#include "nvim/buffer_defs.h" +#include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/highlight.h" #include "nvim/highlight_group.h" #include "nvim/log.h" #include "nvim/lua/executor.h" -#include "nvim/main.h" +#include "nvim/macros.h" #include "nvim/map.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/os/os.h" -#include "nvim/popupmenu.h" -#include "nvim/ugrid.h" +#include "nvim/option_defs.h" +#include "nvim/os/time.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/ui_compositor.h" #include "nvim/vim.h" diff --git a/src/nvim/undo.c b/src/nvim/undo.c @@ -76,41 +76,57 @@ #include <assert.h> #include <fcntl.h> #include <inttypes.h> -#include <limits.h> #include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> +#include <time.h> +#include <uv.h> #include "auto/config.h" #include "klib/kvec.h" #include "nvim/ascii.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" #include "nvim/buffer_updates.h" #include "nvim/change.h" #include "nvim/cursor.h" #include "nvim/drawscreen.h" #include "nvim/edit.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/ex_getln.h" #include "nvim/extmark.h" #include "nvim/fileio.h" #include "nvim/fold.h" #include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/highlight_defs.h" +#include "nvim/macros.h" #include "nvim/mark.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/os/fs_defs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" +#include "nvim/os/os_defs.h" #include "nvim/os/time.h" #include "nvim/os_unix.h" #include "nvim/path.h" -#include "nvim/pos.h" // MAXLNUM +#include "nvim/pos.h" +#include "nvim/screen.h" #include "nvim/sha256.h" #include "nvim/state.h" #include "nvim/strings.h" #include "nvim/types.h" #include "nvim/undo.h" +#include "nvim/undo_defs.h" +#include "nvim/vim.h" /// Structure passed around between undofile functions. typedef struct { diff --git a/src/nvim/usercmd.c b/src/nvim/usercmd.c @@ -6,19 +6,34 @@ #include <assert.h> #include <inttypes.h> #include <stdbool.h> -#include <stdlib.h> +#include <stdio.h> #include <string.h> +#include "auto/config.h" +#include "lauxlib.h" +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/eval.h" #include "nvim/ex_docmd.h" #include "nvim/garray.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" +#include "nvim/highlight_defs.h" +#include "nvim/keycodes.h" #include "nvim/lua/executor.h" +#include "nvim/macros.h" +#include "nvim/mbyte.h" +#include "nvim/memory.h" +#include "nvim/message.h" +#include "nvim/option_defs.h" #include "nvim/os/input.h" #include "nvim/runtime.h" +#include "nvim/strings.h" #include "nvim/usercmd.h" +#include "nvim/vim.h" #include "nvim/window.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/usercmd.h b/src/nvim/usercmd.h @@ -1,7 +1,12 @@ #ifndef NVIM_USERCMD_H #define NVIM_USERCMD_H +#include <stdint.h> + +#include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" +#include "nvim/garray.h" +#include "nvim/types.h" typedef struct ucmd { char *uc_name; // The command name diff --git a/src/nvim/version.c b/src/nvim/version.c @@ -7,27 +7,35 @@ /// Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred). #include <assert.h> -#include <inttypes.h> #include <limits.h> +#include <stdbool.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include "auto/config.h" +#include "auto/versiondef.h" // version info generated by the build system +#include "auto/versiondef_git.h" +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" #include "nvim/buffer.h" #include "nvim/charset.h" #include "nvim/drawscreen.h" +#include "nvim/ex_cmds_defs.h" +#include "nvim/gettext.h" +#include "nvim/globals.h" #include "nvim/grid.h" -#include "nvim/iconv.h" +#include "nvim/highlight_defs.h" #include "nvim/lua/executor.h" -#include "nvim/memline.h" -#include "nvim/memory.h" +#include "nvim/mbyte.h" #include "nvim/message.h" +#include "nvim/option_defs.h" +#include "nvim/os/os_defs.h" #include "nvim/strings.h" #include "nvim/version.h" #include "nvim/vim.h" -// version info generated by the build system -#include "auto/versiondef.h" - // for ":version", ":intro", and "nvim --version" #ifndef NVIM_VERSION_MEDIUM # define NVIM_VERSION_MEDIUM "v" STR(NVIM_VERSION_MAJOR) \ diff --git a/src/nvim/vim.h b/src/nvim/vim.h @@ -1,7 +1,7 @@ #ifndef NVIM_VIM_H #define NVIM_VIM_H -#include "nvim/pos.h" // for linenr_T, MAXCOL, etc... +#include "nvim/pos.h" #include "nvim/types.h" // Some defines from the old feature.h diff --git a/src/nvim/viml/parser/expressions.c b/src/nvim/viml/parser/expressions.c @@ -53,6 +53,8 @@ #include <assert.h> #include <stdbool.h> #include <stddef.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> #include "klib/kvec.h" @@ -60,6 +62,10 @@ #include "nvim/assert.h" #include "nvim/charset.h" #include "nvim/eval/typval.h" +#include "nvim/gettext.h" +#include "nvim/keycodes.h" +#include "nvim/macros.h" +#include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/types.h" #include "nvim/vim.h" diff --git a/src/nvim/viml/parser/expressions.h b/src/nvim/viml/parser/expressions.h @@ -6,9 +6,12 @@ #include <stdint.h> #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/types.h" #include "nvim/viml/parser/parser.h" +struct expr_ast_node; + // Defines whether to ignore case: // == kCCStrategyUseOption // ==# kCCStrategyMatchCase diff --git a/src/nvim/viml/parser/parser.c b/src/nvim/viml/parser/parser.c @@ -4,7 +4,7 @@ #include "nvim/viml/parser/parser.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "viml/parser/parser.c.generated.h" +# include "viml/parser/parser.c.generated.h" // IWYU pragma: export #endif void parser_simple_get_line(void *cookie, ParserLine *ret_pline) diff --git a/src/nvim/viml/parser/parser.h b/src/nvim/viml/parser/parser.h @@ -8,6 +8,7 @@ #include "klib/kvec.h" #include "nvim/func_attr.h" #include "nvim/mbyte.h" +#include "nvim/mbyte_defs.h" #include "nvim/memory.h" /// One parsed line diff --git a/src/nvim/window.c b/src/nvim/window.c @@ -2,21 +2,30 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include <assert.h> +#include <ctype.h> #include <inttypes.h> +#include <limits.h> #include <stdbool.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> +#include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" -#include "nvim/api/vim.h" #include "nvim/arglist.h" #include "nvim/ascii.h" +#include "nvim/autocmd.h" #include "nvim/buffer.h" #include "nvim/charset.h" #include "nvim/cursor.h" +#include "nvim/decoration.h" #include "nvim/diff.h" #include "nvim/drawscreen.h" #include "nvim/edit.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/eval/vars.h" #include "nvim/ex_cmds.h" #include "nvim/ex_cmds2.h" @@ -28,15 +37,19 @@ #include "nvim/fold.h" #include "nvim/garray.h" #include "nvim/getchar.h" +#include "nvim/gettext.h" #include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/hashtab.h" -#include "nvim/highlight.h" +#include "nvim/keycodes.h" +#include "nvim/macros.h" #include "nvim/main.h" -#include "nvim/mapping.h" +#include "nvim/map.h" +#include "nvim/mapping.h" // IWYU pragma: keep (langmap_adjust_mb) #include "nvim/mark.h" #include "nvim/match.h" -#include "nvim/memline.h" +#include "nvim/mbyte.h" +#include "nvim/memline_defs.h" #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/mouse.h" @@ -45,17 +58,18 @@ #include "nvim/option.h" #include "nvim/optionstr.h" #include "nvim/os/os.h" -#include "nvim/os_unix.h" #include "nvim/path.h" #include "nvim/plines.h" +#include "nvim/pos.h" #include "nvim/quickfix.h" -#include "nvim/regexp.h" +#include "nvim/screen.h" #include "nvim/search.h" #include "nvim/state.h" #include "nvim/statusline.h" #include "nvim/strings.h" #include "nvim/syntax.h" #include "nvim/terminal.h" +#include "nvim/types.h" #include "nvim/ui.h" #include "nvim/ui_compositor.h" #include "nvim/undo.h" diff --git a/src/nvim/window.h b/src/nvim/window.h @@ -2,10 +2,14 @@ #define NVIM_WINDOW_H #include <stdbool.h> +#include <stddef.h> +#include "nvim/buffer.h" #include "nvim/buffer_defs.h" #include "nvim/mark.h" #include "nvim/os/os.h" +#include "nvim/os/os_defs.h" +#include "nvim/vim.h" // Values for file_name_in_line() #define FNAME_MESS 1 // give error message