- return result of setting and remove directory if the setting was not
successful.
- don't do `STRCPY` in case of `vim_FullName` failure because
`vim_FullName` already did it.
Though this module is relatively small it has very clear boundaries.
The last argument for extracting `tempfile` was the errors which I got
when I was writing unittests for it: `cimport './src/nvim/fileio.h'`
does not work for some reason.
- temp_count is uint32_t now instead of long because it supposed to be
at most 999999999 (comment on line 5227) temporary files. The most
probably it was a long for compatibility with systems where int is
16-bit.
- Use "nvim" as prefix for temp folder name instead of "v"
- Remove unused parameter from vim_tempname
Vim does not define TEMPDIRNAMES for all systems, but it is defined for
all systems supported by Neovim.
Temporary directory names for Windows was obtained from GetTempPath()
function documentation at MSDN.
Additionally small renamings were performed.
`-Wstrict-prototypes` warn if a function is declared or defined without
specifying the argument types.
This warning disallow function prototypes with empty parameter list.
In C, a function declared with an empty parameter list accepts an
arbitrary number of arguments when being called. This is for historic
reasons; originally, C functions didn't have prototypes, as C evolved
from B, a typeless language. When prototypes were added, the original
typeless declarations were left in the language for backwards
compatibility.
Instead we should provide `void` in argument list to state
that function doesn't have arguments.
Also this warning disallow declaring type of the parameters after the
parentheses because Neovim header generator produce no declarations for
old-stlyle prototypes: it expects to find `{` after prototype.
- Unittest should contain substring '_spec' in filename.
- This is the simplest way to use both lua and moonscript tests.
- This prevents running of non-test scripts from test folder.
- use return value instead of open_req.result
- libuv uv_fs_open() returns `-errno` instead of always -1
- libuv always sets open_req.result to the return value, _except_ for OOM
where it only sets the return value. So always use the return value.
- replace calls to mch_open macro.
- update call sites expecting -1 error
- When USE_BUNDLED=OFF and the system has multiple lua interpreters
(luajit AND lua) it may occur that only the later has the needed
dependencies (lua-lpeg, lua-cmsgpack). If we pick luajit then
finding the dependencies FAILS.
- This commit groups detection of the lua interpreter with the lua
dependencies it tries to find them for both the interpreters and
choses the first one that has them.
Helped-by: John Szakmeister <john@szakmeister.net>
This is in preparation for the next step, which is to find a suitable
lua interpreter, rather than just erroring when an interpreter is found
but doesn't have the necessary dependencies.
Helped-by: John Szakmeister <john@szakmeister.net>
Normally the default encoding does not have much effect, since it's
overridden by the environment.
But when it's not (test with "LANG= LC_ALL= C_CTYPE= nvim" and perform
":set encoding?"), utf-8 should be the default encoding for a 21st
century editor :).
If libtgent or libcurses is installed, the first one found of them
is linked to.
But if not, a find_package(Curses REQUIRED) is used and CURSES_LIBRARIES
is added to NVIM_LINK_LIBRARIES. This contains libform(w).so on many
systems, causing nvim to be linked to and depend on libform(w).so,
which may not be installed one some space-constrained systems, unnecessarily.