aboutsummaryrefslogtreecommitdiff
path: root/src/os
Commit message (Collapse)AuthorAge
* Introduce nvim namespace: Move files.Eliseo Martínez2014-05-15
| | | | | | Move files from src/ to src/nvim/. - src/nvim/ becomes the new root dir for nvim executable sources. - src/libnvim/ is planned to become root dir of the neovim library.
* Add new files to clint and fix reported errorsThiago de Arruda2014-05-13
|
* Fix jumps depending on unitialized valuesThiago de Arruda2014-05-12
| | | | Reported by valgrind
* Add server module for accepting API connectionsThiago de Arruda2014-05-12
| | | | | | | The `NEOVIM_LISTEN_ADDRESS` environment variable can be set to customize the address where Neovim will listen for connections. If it's not set, a random socket/pipe will be created, and the `NEOVIM_LISTEN_ADDRESS` will be updated accordingly.
* Add channel moduleThiago de Arruda2014-05-12
| | | | | | - Add channel module that exposes the API over arbitrary streams - Add `xmemdup` for duplicating memory chunks - Make job exit callback optional
* Refactor API types and prototypesThiago de Arruda2014-05-12
| | | | | | | | - Split functions with multiple files in the 'api' subdirectory - Move/Add more types in the 'api/defs.h' header - Add more prototypes - Refactor scripts/msgpack-gen.lua - Move msgpack modules to 'os' subdirectory
* Fix update of pending_reqs in `write_cb`Thiago de Arruda2014-05-12
|
* Add teardown function for the event.c moduleThiago de Arruda2014-05-12
| | | | Also move the `job_teardown` call from os_unix.c to the event module
* Refactor modules to use handle data accessorsThiago de Arruda2014-05-12
| | | | The job, rstream and wstream modules now use handle data accessors
* Add helpers for accessing data in libuv handlesThiago de Arruda2014-05-12
| | | | | | | Libuv handles have a single generic pointer for storing user data, this adds some functions for adding/retrieving pointers to "slots" in the new `HandleData` structure, which increase flexibility when using shared handles(job streams for example)
* implemented FileInfo structStefan Hoffmann2014-05-09
| | | | | | | This struct is a wrapper around `uv_stat_t` to hide the stat information inside `src/os/`. The stat file attribute will be private after all refactorings concerning file informations are done.
* implemented os_file_get_size()Stefan Hoffmann2014-05-09
|
* Merge pull request #644 from philix/logJustin M. Keyes2014-05-06
|\ | | | | Macro-based log utility for Neovim
| * Introduce os_localtime_r() and os_get_local_time()Felipe Oliveira Carvalho2014-05-06
| | | | | | | | Replace localtime() with os_localtime_r() in `eval.c` and `undo.c`.
* | Prevent preserve_exit() from executing more than once.Dane Summers2014-05-06
| | | | | | | | https://github.com/neovim/neovim/issues/563
* | replaced `vim_free()` calls with `free()` callsMatthias Beyer2014-05-05
|/
* revert #652Justin M. Keyes2014-05-01
| | | | | | | reverting broad cosmetic/style change because: - increases merge-conflicts - increases overhead of merging upstream Vim patches - reasons for change are ambiguous, so default to no change
* Remove NUL macroMarco Hinz2014-04-29
|
* Remove code and checks for unsupported systems.Chris Watkins2014-04-28
| | | | | Remove remnants of support for systems including __EMX__, MSDOS, OS2, AMIGA and MORPHOS.
* Broken build on 32 bit: Pending TODO: Reenable assertion.Eliseo Martínez2014-04-24
| | | | | | On a1a0c00589a8efc664db82be6743136bb462e08f, an assertion was disabled because of breaking 32bit build. This fixes that so that it now always works.
* Fix clint.sh wrapper script and broken filesThiago de Arruda2014-04-22
| | | | | - Fixed clint.sh, it no longer ignores errors in individual files. - Fixed two files that weren't passing the clint test
* Broken build on 32 bit: Fix -Wtautological-constant-out-of-range-compare.Eliseo Martínez2014-04-22
| | | | | | | | | | | | | | | | | | | Problem: [ 51%] Building C object src/CMakeFiles/nvim.dir/os/rstream.c.o /Users/eliseo/projects/os/neovim/src/os/rstream.c:237:24: error: comparison of constant 9223372036854775807 with expression of type 'size_t' (aka 'unsigned long') is always true [-Werror,-Wtautological-constant-out-of-range-compare] assert(rstream->fpos <= INT64_MAX); ~~~~~~~~~~~~~ ^ ~~~~~~~~~ /usr/include/assert.h:93:25: note: expanded from macro 'assert' (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0) ^ Solution: Assertion temporarily disabled. TODO: Review types so that assertion can be used.
* Broken build on 32 bit: Fix -Wshorten-64-to-32.Eliseo Martínez2014-04-22
| | | | | | | | | | | | | | | | | | Problem: [ 48%] Building C object src/CMakeFiles/nvim.dir/os/mem.c.o /Users/eliseo/projects/os/neovim/src/os/mem.c:9:32: error: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'long_u' (aka 'unsigned long') [-Werror,-Wshorten-64-to-32] return uv_get_total_memory() >> 10; ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~^~~~~ Solution: Avoid conversion. Make function return proper uint64_t. Make users of the function accomodate the value if too big for them.
* fix -Wconversion warnings for rstreamNicolas Hillegeer2014-04-21
| | | | | | | I'm not sure whether to go for signed or unsigned types for the offsets, but without a doubt size_t is a better alternative than uint32_t. Added casts after checking bounds before and after calling external libraries (in this case libuv).
* Replace explicit uv_guest_handle(fd) == UV_TTY by os_isattyPavel Platto2014-04-20
|
* Added os_isattyPavel Platto2014-04-20
|
* Fix bug of `job_stop` not emitting `JobExit`Thiago de Arruda2014-04-18
| | | | | | The `job_stop` function was calling `uv_read_stop` on the std{out,err} streams. This is now responsibility of `RStream` and because of those calls `job_stop` wasn't emitting the `JobExit` event.
* Remove unnecessary cleanup label from `job_start`Thiago de Arruda2014-04-18
| | | | The argument vector is now freed in the `close_cb` function in job.c
* Free job data on close_cbThiago de Arruda2014-04-18
|
* Stop job prepare watcher when there are no jobsThiago de Arruda2014-04-18
| | | | No need to check for job status when no jobs are running
* Refactor job.c module to use WStreamThiago de Arruda2014-04-18
| | | | | After a job has accumulated 1mb of stdin data we assume that it's stuck and kill it.
* Extract writing boilerplate into wstream.c moduleThiago de Arruda2014-04-18
|
* Correctly free libuv handlesThiago de Arruda2014-04-18
| | | | | This ensures memory chunks for libuv handles are only freed after the event loop no longer has references to it.
* Refactor job control to use RStream eventsThiago de Arruda2014-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of a single 'job read' callback, job control consumers need to provide callbacks for "stdout read", "stderr read" and "exit". For vimscript, the JobActivity autocommand is still used to handle every job event, for example: ```vim :let srv1_id = jobstart('netcat-server-1', 'nc', ['-l', '9991']) :let srv2_id = jobstart('netcat-server-2', 'nc', ['-l', '9991']) function JobEvent() " v:job_data[0] = the job id " v:job_data[1] = the event type, one of "stdout", "stderr" or "exit" " v:job_data[2] = data read from stdout or stderr if v:job_data[1] == 'stdout' let str = 'Message from job '.v:job_data[0].': '.v:job_data[2] elseif v:job_data[1] == 'stderr' let str = 'Error message from job '.v:job_data[0].': '.v:job_data[2] else " Exit let str = 'Job '.v:job_data[0].' exited' endif call append(line('$'), str) endfunction au JobActivity netcat-server-* call JobEvent() ``` And to see messages from 'job 1', run in another terminal: ```sh bash -c "while true; do echo 123; sleep 1; done" | nc localhost 9991 ```
* Create EventType for RStream readingThiago de Arruda2014-04-18
| | | | | | | RStream will be the main way Neovim receives asynchronous messages, so it is best to have a specialized EventType for it. A new flag parameter was added to `rstream_new` which tells the RStream instance to defer event handling for later with KE_EVENT instead of handling it directly from libuv callback.
* Deal with backpressure on RStream instancesThiago de Arruda2014-04-18
| | | | | Each RStream instance will now stop its libuv watcher when the buffer is full, and automatically restart when some data is read with `rstream_read`.
* Handle special KE_EVENT case where maxlen < 3Thiago de Arruda2014-04-16
| | | | | | | | | | Possible bug reported by @oni-link [here](https://github.com/neovim/neovim/pull/485/files#r11664573). It was handled by doing a circular walk through a key buffer and saving the index between calls with a static variable. Also replaced some `char_u` occurrences by `uint8_t` and removed unused headers in input.c module.
* Refactor input module to use RStream classThiago de Arruda2014-04-16
|
* Refactor job control module to use RStream classThiago de Arruda2014-04-16
|
* Extract reading boilerplate into rstream.c moduleThiago de Arruda2014-04-16
| | | | | | The `RStream` class hides the differences between files and other types of streams with a simpler, general-purpose API for performing non-blocking reads with libuv. Most of the code was adapted from input.c.
* Bring neovim up to date with recent libuv changesWill Tange2014-04-14
| | | | | | | | | As of v0.11.23 libuv's uv_timer_cb, uv_async_cb, uv_prepare_cb, uv_check_cb and uv_idle_cb no longer require a status parameter (this went unused in the first place). Bump third-party dependency `libuv` up to 0.11.23 and remove the extra parameters from the callbacks.
* Rename os_total_mem to os_get_total_mem_kib.Chris Watkins2014-04-12
| | | | Also removed an unused parameter.
* port vim_mkdir, mch_rmdir and mch_remove to libuvStefan Hoffmann2014-04-11
|
* Remove OOM error handling code after ga_grow() callsFelipe Oliveira Carvalho2014-04-11
|
* Move exe functions back to os/fs.cJohn Schmidt2014-04-08
|
* Move functions from os/fs.c into path.cJohn Schmidt2014-04-08
| | | | Move unit tests from os/fs.moon to path.moon
* Remove old comment from job.cThiago de Arruda2014-04-08
|
* Define special key for asynchronous eventsThiago de Arruda2014-04-08
| | | | | | | | | | | | | | | | | | | | | | K_EVENT/KE_EVENT are used to signal any loop that reads user input(scattered across normal.c edit.c , ex_getln.c and message.c) of asynchronous events that were not initiated by the user. Representing non-user asynchronous events as special keys has the following advantages: - We reuse the normal vim redrawing code. As far as the rest of the code in edit.c/normal.c is concerned, it's just the user pressing another key. - Assume less about vim tolerance for "out-of-band" modifications to its internal state. - We still have a very complex codebase and it's hard to predict what bugs may be introduced by these changes. With this we implement asynchronicity in a way that will be more "natural" to the editor and has less chance of causing unpredictable behavior. As the code is refactored, we will be able to treat user input as an 'event type' and not the other way around(With this we are treating arbitrary events as a special case of user input).
* Fix/add more files with to clint-files.txtThiago de Arruda2014-04-08
|
* Implement job controlThiago de Arruda2014-04-07
| | | | | | - Add a job control module for spawning and controlling co-processes - Add three vimscript functions for interfacing with the module - Use dedicated header files for typedefs/structs in event/job modules