Moves low-level functions handling to os/fs.c. Adds file.c with a proxy
interface.
Target: while leaving syscalls handling is os.c (partially handled by libuv),
add buffering for reading and writing to file.c.
The TUI can be enabled/disabled at build time with -DFEAT_TUI, default is ON for
UNIX, and OFF for non UNIX. When off, Neovim prints a message to stderr, along
with a list of the server endpoints.
This was noticed due to a user issue (#4750) when building Neovim 0.1.4
via ports. The crux of the issue is that we did not detect the
be64toh() macro, because there is no endian.h on FreeBSD (along with
several other BSDs). So we were defaulting to our builtin version of
be64toh(). However, it appears that sys/endian.h was being picked up by
an include (likely msgpack.h) and so be64toh() was actually defined and
corrupting our definition of it.
So the answer here was to use the correct include file in our check, and
export that information in the config.h. Then we use that information
to include the right header in shada.c.
This fixes#4750.
Change POROJECT_NAME to 'nvim', and use it as the gettext
domain name. The *.mo files, previously installed as
$runtime/lang/xx/LC_MESSAGES/nvim.mo, are now installed as
$prefix/locale/xx/LC_MESSAGES/nvim.mo.
Unix systems must have this header but Windows does not have it at all.
Since src/nvim/os/unix_defs.h includes <unistd.h> without the guard
in order to avoid including this in the numerous places we would
need <unistd.h> on Unix we just include src/nvim/os/os.h which will pull
in <unistd.h> for us.
In Vim, at least the constant `I_PUSH` is used from <stropts.h>, but
Neovim doesn't seem to use anything from said header.
Besides that, POSIX.1-2008[1] marks this header as obsolescent, and
there don't seem to be many platforms that even have it.
[1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stropts.h.html#tag_13_52_11
Windows does not have setenv(), instead the _putenv_s() function is used - added
a function check and fatal errors. Implemented os_setenv() for Windows.
Vim supports the original putenv() function if no alternative is available.
Neovim only supports systems where safer alternatives exist, so the check for
putenv() was removed from config/CMakeLists.txt.
RETSIGTYPE, SIGRETURN, and SIGDEFARG are always defined the same, so
inline them for simplicity; SIGDUMMYARG, however, is unused, so remove
it.
Even if these things don't work on windows, the signal handler in
if_cscope.c is already wrapped with '#idef UNIX', as is its only call
site.
Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
Removed unneeded platform checks from config/config.h.in and
config/CMakeLists.txt
- HAVE_OSPEED and HAVE_UP_BC_PC were used by the old UI, and are
no longer needed.
- sigvec() was used as part of the signal handling code in os_unix.c, but it is
no longer used in Neovim.
- The function lstat() is no longer used, replaced with libuv.
* Set JEMALLOC_NO_DEMANGLE to be able to use `je_*` functions,
regardless of how jemalloc was compiled (--with-jemalloc-prefix)
* Show jemalloc information in Neovim's version output.
Resolve#2449.
- In UNIX systems where unsetenv() is available, it is used. Otherwise
the variables are set with the empty string.
- New check HAVE_UNSETENV for unsetenv()
- Added unit test to env_spec.lua
Jemalloc will be used if the cmake option `USE_JEMALLOC` is enabled(which is the
default). To avoid trouble with clang's ASAN, it is disabled by default if the
`SANITIZE` option is enabled.
Since jemalloc has thread cache for small objects, it fills the gap created by
removing klib memory pools.
The `xstrdup` funciton(memory.c) had to be reimplemented on top of `xmalloc` to
make it work with a custom allocator.
- Remove abstract_ui global, now it is always active
- Remove some terminal handling code
- Remove unused functions
- Remove HAVE_TGETENT/TERMINFO/TERMIOS/IOCTL #ifdefs
- Remove tgetent/terminfo from version.c
- Remove curses/terminfo dependencies
- Only start/stop termcap when starting/exiting the program
- msg_use_printf will return true if there are no attached UIs(
messages will be written to stdout)
- Remove `ex_winpos`(implement `:winpos` with `ex_ni`)
put_time() had a complicated implementation, because of having to shift
an 8-byte value in a portable way with old means.
That can be greatly simplified now, using a C99 fixed-size type.
- cmake: git_timestamp() returns last commit time formatted as
`YYYYMMddHHmm`.
- Always include commit hash in :version and --version output.
`nvim --version` sample output:
NVIM 0.0.0-alpha+201410070245 (compiled Oct 7 2014 05:30:45)
Commit: f747b2b1ff7bfe7eb00cc2be82d7af87c98f1111
- Defined CMake checks for all headers in config.h.in
- Removed headers checks that are not used anymore:
sgtty.h sys/statfs.h libintl.h poll.h
- Added UNIX check
- Add some fatal checks
+ Check for setenv() and fail if it does not exist
since our os layer just assumes it does
+ lstat is required by os_unix.c
+ sys/wait.h is required in UNIX
- Removed entries for functions that are not being used: getcwd,
getrlimit, getwd, nanosleep, sigaltstack, getwd, sigstack, fseeko
- Replaced nearly all defines in config.h.in for functions with
compile time checks
- Add check for symbol FD_CLOEXEC
- Add check for langinfo CODESET
- HAVE_ICONV_H and HAVE_ICONV hold the expected checks but Neovim uses
USE_ICONV define to actually decide whether to enable it
- Removed checks that are no longer needed
+ USEMEMMOVE
+ _FILE_OFFSET_BITS
+ HAVE_ST_BLKSIZE
+ dlfcn.h