aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
Commit message (Collapse)AuthorAge
...
| * os_fchown: impl and remove HAVE_FCHOWNPavel Platto2014-08-13
| |
* | coverity/71508: Fix potential null dereference.Manish Raghavan2014-08-13
|/ | | | Make sure feature pointer is not null before dereferencing.
* Implement `os_mkdtemp` on top of `uv_fs_mkdtemp`Pavel Platto2014-08-09
|
* Remove unused arg 'defer' in 'job_start' #1000oni-link2014-07-29
| | | | | | | | | * With the changes in commit "events: Refactor how event deferral is handled" (2e4ea29d2c7b62eb8baf1c41cd43433e085dda0) the function argument 'defer' of 'job_start' and member variable 'defer' of 'struct job' can be removed. * Update/Fix the documentation for function 'job_start'.
* rstream: remove 'reading' struct memberNicolas Hillegeer2014-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | Not necessary, as discussed in #980. From the libuv mailing list: https://groups.google.com/forum/#!topic/libuv/OD38PeGeVgQ E.g. this could happen (red: on Windows): > > alloc_cb(handle1); > > alloc_cb(handle2); > > read_cb(handle1); > > read_cb(handle2); But this couldn't: > > alloc_cb(handle1); > > alloc_cb(handle1); > > read_cb(handle1); > > read_cb(handle1); Because each stream has a 1-to-1 correspondance with a libuv handle. The code removed was never executed. Closes #980.
* job: increase JOB_BUFFER_SIZE to 0xFFFFNicolas Hillegeer2014-07-27
| | | | | | | | | It used to be 1024 bytes, which is very tiny and slows down some operations (imaging `cat`-ing a large file). Benchmarks show a large speedup for such cases. ref #978. For modern systems 0xFFFF bytes (65535 B = 64 KB = 0.0625 MB) per job shouldn't be a big problem.
* os/shell: implement os_systemNicolas Hillegeer2014-07-27
| | | | | | | | | | | | | | | | | With the goal to support pipe-only system() calls. Notes on the second (vim) argument to f_system() (i.e.: redirected input) and its implications: - When calling system('cat -', ['some', 'list']), vanilla vim (before a recent patch that added support for passing lists) just passes an empty file to the process. This is the same as immediately closing the pipe, which os_system does when no input is given. If we wouldn't close the pipe, the process will linger forever (as is the case with `cat -`). As of now, it's not allowed to pass a non-NULL pointer as the `output` parameter. In other words, it's not possible to signal disinterst in the process output. That may change in the future.
* job: add in-pipe notification and closing supportNicolas Hillegeer2014-07-27
| | | | | | - One can now manually close the in-pipe, without having to tear down the job. - One can be notified of write success/failure.
* wstream: allow empty release wbuffer cbNicolas Hillegeer2014-07-27
| | | | | Sometimes a wbuffer is not supposed to be free()'d (such as when it comes from a constant (possibly static) string, for example.
* wstream: write completion callbackNicolas Hillegeer2014-07-27
| | | | Now modules using the wstream can find out what's happening to their writes.
* job: implement job_wait()Nicolas Hillegeer2014-07-27
| | | | Used to wait synchronously for a job to end.
* os/shell: constify argumentsNicolas Hillegeer2014-07-27
| | | | Minor fixes
* Fix memory leaks for jobs.oni-link2014-07-23
| | | | | Free the data memory of process and pipe handles in the close callback for a job.
* Fix memory leak in provider_call.oni-link2014-07-23
| | | | | If no channel can be found for a method, free argument arg before returning.
* os/time: fix os_localtime_r on win + add func_attrNicolas Hillegeer2014-07-20
| | | | | | - it makes no sense for these functions to take NULL pointers - if `localtime()` on Windows returns a NULL pointer, the old code would try to dereference it.
* os/time: make os_get_localtime more portableNicolas Hillegeer2014-07-20
| | | | | | gettimeofday() doesn't exist on Windows, as reported by @equalsraf. It seems a call to time() would be sufficient here, as only the seconds since the UNIX epoch are needed.
* os/time: include time.h in os/time.hNicolas Hillegeer2014-07-20
| | | | Include what you use, also in the positive direction.
* events: Refactor how event deferral is handledThiago de Arruda2014-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove all *_set_defer methods and the 'defer' flag from rstream/jobs - Added {signal,rstream,job}_event_source functions. Each return a pointer that represent the event source for the object in question(For signals, a static pointer is returned) - Added a 'source' field to the Event struct, which is set to the appropriate value by the code that created the event. - Added a 'sources' parameter to `event_poll`. It should point to a NULL-terminated array of event sources that will be used to decide which events should be processed immediately - Added a 'source_override' parameter to `rstream_new`. This was required to use jobs as event sources of RStream instances(When "focusing" on a job, for example). - Extracted `process_from` static function from `event_process`. - Remove 'defer' parameter from `event_process`, which now operates only on deferred events. - Refactor `channel_send_call` to use the new lock mechanism What changed in a single sentence: Code that calls `event_poll` have to specify which event sources should NOT be deferred. This change was necessary for a number of reasons: - To fix a bug where due to race conditions, a client request could end in the deferred queue in the middle of a `channel_send_call` invocation, resulting in a deadlock since the client process would never receive a response, and channel_send_call would never return because the client would still be waiting for the response. - To handle "event locking" correctly in recursive `channel_send_call` invocations when the frames are waiting for responses from different clients. Not much of an issue now since there's only a python client, but could break things later. - To simplify the process of implementing synchronous functions that depend on asynchronous events.
* api/events/msgpack: Insert log statements to improve debuggingThiago de Arruda2014-07-17
| | | | | | Also changed the default log level to INFO so developers won't end up with big log files without asking explicitly(DLOG statements were placed in really "hot" code)
* provider: Add support for clipboard registers.Thiago de Arruda2014-07-17
| | | | | | | | | | | | | This reimplements the '+'/'*' clipboard registers(both are aliases to the same register, no dedicated storage for the X11 selection) on top of the provider infrastructure. This adds two new 'unnamedclip' option, has the same effect of setting 'clipboard' to 'unnamed/unnamedplus' in vim The 'clipboard' option was not reused because all values(except 'unnamedplus') seem to be useless for Neovim, and the code to parse the option was relatively big. The option remains for vim compatibility but it's silently ignored.
* provider: Add support for python commands/functionsThiago de Arruda2014-07-17
| | | | | | | | This uses the provider/scripting infrastructure to reintroduce python support through the msgpack-rpc API. A new 'initpython' option was added, and it must be set to a command that will bootstrap the python provider the first time it's needed.
* provider: New module used to expose extension points for core servicesThiago de Arruda2014-07-17
| | | | | | | | | | | | | | | | | Introducing the concept of providers: co-processes that talk with the editor through the remote API and provide implementation for one or more core services. The `provider_register` function and it's API wrapper can be used by channels that want to self-register as a service provider. Some old builtin vim features will be re-implemented as providers. The `provider_has_feature` function is used to check if a provider implementing a certain feature is available(It will be called by the `has` vimscript function to check for features in a vim-compatible way) This implements the provider module without exposing any extension points, which will be done in future commits.
* channel: Bugfixes and refactorThiago de Arruda2014-07-17
| | | | | | | | | | - All functions that require a channel id will fail when the channel was disabled - Rewrite `call_stack_unwind` as `call_set_error`. It will now disable the channel and set error on all frames. The stack will be unwinded automatically while the involved functions exit. - Remove `disable_channel` function. If channels are disabled, they will be closed as soon as possible
* job: No longer free the job data. It's now done by the exit callbackThiago de Arruda2014-07-17
|
* channel: Implement channel_exists functionThiago de Arruda2014-07-17
|
* channel: Refactor channel_from_job to return the channel idThiago de Arruda2014-07-17
|
* wstream: Pass WBuffer refcount as a constructor parameterThiago de Arruda2014-07-17
| | | | | | This is required to handle broadcasting when the first write fails. Ref: https://github.com/tarruda/neovim/commit/11916b6b595421ce2ece10f7aa40757cc4937c0c#commitcomment-6792287
* wstream: document default value for 'maxmem'Thiago de Arruda2014-07-17
|
* os: implement os_hrtimeNicolas Hillegeer2014-07-16
| | | | Just an alias to uv_hrtime. Provides a high-resolution timer.
* Create os/os_defs.h for os specific definitionsPavel Platto2014-07-14
|
* Extract `tempfile` module from fileioPavel Platto2014-07-14
| | | | | | | 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.
* Refactor vim_tempnamePavel Platto2014-07-14
| | | | | | | | | - 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
* Remove #ifdefs TEMPDIRNAMES and add TEMPDIRNAMES for WindowsPavel Platto2014-07-14
| | | | | | | | 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.
* Temporary os_mkdtemp implementation. Use it instead of mkdtemp.Pavel Platto2014-07-14
|
* Use strict function prototypes #945Pavel Platto2014-07-14
| | | | | | | | | | | | | | | | | | | `-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.
* os_open: add unit testsJustin M. Keyes2014-07-14
|
* os_open: impl mch_open with libuv. ref #133Justin M. Keyes2014-07-14
| | | | | | | | | - 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
* os/server: Fix possible port overflowAndré Twupack2014-07-13
| | | | | - add documentation about port being optional - parse port into long and check for valid value
* os/server: Fix TCP connectionAndré Twupack2014-07-13
| | | | | | | - remove unused errno - remove unused port_end - correct calculation of addr_len - use correct string length during IP copy
* os/server: Fix indentationAndré Twupack2014-07-13
|
* Include stdbool.h in headers which have functions with bool in signaturePavel Platto2014-07-11
| | | | | | | Done by manual inspecting of the output of this script: grep -r -l -w "bool" * | grep 'c$' | sed 's/.c$//' > has_bool grep -r -l -w "stdbool.h" * | grep 'h$' | sed 's/.h$//' > has_include grep -F -x -v -f has_include has_bool
* Remove stdbool.h from files which don't need itPavel Platto2014-07-11
| | | | | | | Done by manual inspection of the output of this script: grep -r -l -w "bool\|true\|false" * | grep 'c$\|h$' > has_bool grep -r -l "stdbool.h" * | grep 'c$\|h$' > has_include grep -F -x -v -f has_bool has_include
* Include stdbool.h in some files which use itPavel Platto2014-07-11
| | | | | | | Done by manual inspection of the output of this script: grep -r -l -w "bool\|true\|false" * | grep 'c$\|h$' > has_bool grep -r -l "stdbool.h" * | grep 'c$\|h$' > has_include grep -F -x -v -f has_include has_bool
* Fix two android compile errors in fs.c #924Fredrik Fornwall2014-07-09
| | | | | Replace usage of deprecated S_IEXEC with S_IXUSR. Rename a variable named "errno" to avoid clashing with define.
* move assert.h include out of vim.hBrandon Coleman2014-07-09
|
* move <inttypes.h> include out of vim.hBrandon Coleman2014-07-09
|
* move ascii.h include out of vim.hBrandon Coleman2014-07-09
|
* remove stdbool.h include from vim.h and globals.hBrandon Coleman2014-07-09
|
* MsgPack-RPC dispatch based on function array lookup #864Felipe Oliveira Carvalho2014-07-04
| | | | | | This simplifies the generated msgpack_rpc_dispatch() function, separates the code for each RPC method more clearly and allows easy implementation of alternative dispatching methods (e.g. string method id dispatch).
* Introduce GA_APPEND()Felipe Oliveira Carvalho2014-06-30
| | | | | | | | | This macro is used to append an element to a growable array. It replaces this common idiom: ga_grow(&ga, 1); ((item_type *)ga.ga_data)[ga.ga_len] = item; ++ga.ga_len;