aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/msgpack_rpc/helpers.c
Commit message (Collapse)AuthorAge
* msgpack_rpc: Allocate empty string in msgpack_rpc_to_objectJames McCoy2016-11-29
| | | | | | | | | | STR_CASE previously used a NULL data pointer for the String object, but this pushes the NULL checks to the rest of the code. Instead, allocating an empty string solves the same issue of there not being any data but ensures that we're not passing NULL to functions that don't expect it. Closes #5627
* Avoid serializing NULL string through msgpackJames McCoy2016-11-23
| | | | | | Attempting to serialize a NULL string through msgpack results in msgpack_sbuffer_write attempting to memcpy from a NULL pointer, which is undefined behavior.
* lintJames McCoy2016-11-02
|
* object_to_vim: Fix buffer/window/tabpage conversion on BE systemsJames McCoy2016-11-02
| | | | | | | | | | | Since data.integer is a different (larger) integer type than data.{buffer,window,tabpage}, we cannot abuse the union by using data.integer to access the value for all 4 types. Instead, remove the {buffer,window,tabpage} members and always use the integer member. In order to accomodate this, perform distinct validation and coercion between the Integer type and Buffer/Window/Tabpage types in object_to_vim, msgpack_rpc helpers, and gendispatch.lua.
* api: call multiple methods atomically (useful in async contexts)Björn Linse2016-10-22
| | | | remove unused response_id parameter of handle_nvim_... helpers
* api: unify buffer numbers and window ids with handlesBjörn Linse2016-08-31
| | | | also allow handle==0 meaning curbuf/curwin/curtab
* api: rename "msgpack_rpc/defs.h" to "api/private/dispatch.h" and use the ↵Björn Linse2016-08-31
| | | | header generator.
* *: Fix linter errorsZyX2016-06-24
| | | | | | | | | Also adds one exception to linter rules: typedef struct { kvec_t(Object) stack; } EncodedData; is completely valid (from the style guide point of view) code.
* msgpack_rpc: Also make msgpack_from_*/msgpack_to_* functions not recurZyX2016-06-24
| | | | | | This removes some stack overflows in new test regarding deeply nested variables. Now in place of crashing vim_to_object/msgpack_rpc_from_object/etc it crashes clear_tv with stack overflow.
* *: Fix errors from new linter checksZyX2016-06-11
|
* *: Fix new linter errorsZyX2016-05-01
| | | | Originally there were 128 new errors, so I thought this is a good idea to fix all of them. Of course, this commit also fixes many suppressed errors.
* helpers.c: Handle msgpack str/bin objects with length 0 correctlyoni-link2015-12-21
| | | | | | | | | | | When converting a msgpack object to a String object, strings (and byte arrays) with length 0 are handled as errors. This is fixed by always using the msgpack data pointer as a valid pointer. For a NULL pointer there is nothing to copy. Test by @snoe Fixes #3844
* api: represent api type String as msgpack type STR. closes #1250Björn Linse2015-10-08
|
* ASan: Fix "null pointer passed for argument declared to never be null". #2925Florian Walch2015-06-30
| | | | | | | | Arguments passed to xmemdupz() are sometimes NULL, but xmemdupz() has FUNC_ATTR_NONNULL_ALL. Check pointers for NULL before calling xmemdupz(). Resolves #2533.
* msgpack-rpc: handle failure to convert method arguments #2664Björn Linse2015-05-19
|
* msgpack: Allow notifications to execute commands.Scott Prager2015-04-13
| | | | | | | | | | Consider: `let vim = rpcstart('nvim', ['--embed'])` Allows `rpcnotify(vim, ...)` to work like an asynchronous `rpcrequest(nvim, ...)`. Helped-by: Michael Reed <m.reed@mykolab.com> Helped-by: Justin M. Keyes <>
* ui: Remove/adapt some old code for a big UI refactorThiago de Arruda2015-02-16
| | | | | | | | | | | | | - 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`)
* build: upgrade msgpack-c #1900Michael Reed2015-02-09
| | | | | | | closes #1899 closes #1967 refs https://github.com/msgpack/msgpack-c/pull/194
* msgpack-rpc: Fix typo in validation messageRui Abreu Ferreira2014-11-07
|
* msgpack-rpc: Return from msgpack_rpc_validate on errorRui Abreu Ferreira2014-11-07
| | | | | - When validating a msgpack msg we need to return on the first error otherwise we can SEGFAULT with invalid checks
* msgpack-rpc: Improve logging of msgpack-rpc messagesThiago de Arruda2014-10-23
| | | | | | | | | | - Expose more logging control from the log.c module(get log stream and omit newlines) - Remove logging from the generated functions in msgpack-gen.lua - Refactor channel.c/helpers.c to log every msgpack-rpc payload using msgpack_object_print(a helper function from msgpack.h) - Remove the api_stringify function, it was only useful for logging msgpack-rpc which is now handled by msgpack_object_print.
* msgpack-rpc: Allow selective deferral API callsThiago de Arruda2014-10-21
| | | | | | | | | | | | | Since all API functions now run immediately after a msgpack-rpc request is parsed by libuv callbacks, a mechanism was added to override this behavior and allow certain functions to run in Nvim main loop. The mechanism is simple: Any API function tagged with the FUNC_ATTR_DEFERRED (a "dummy" attribute only used by msgpack-gen.lua) will be called when Nvim main loop receives a K_EVENT key. To implement this mechanism it was necessary some restructuration on the msgpack-rpc modules, especially in the msgpack-gen.lua script.
* msgpack-rpc: Create subdirectory for msgpack-rpc modulesThiago de Arruda2014-10-21
Create the msgpack_rpc subdirectory and move all modules that deal with msgpack-rpc to it. Also merge msgpack_rpc.c into msgpack_rpc/helpers.c