mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 23:18:33 +00:00
refactor(metadata): generate all metadata in lua
Then we can just load metadata in C as a single msgpack blob. Which also can be used directly as binarly data, instead of first unpacking all the functions and ui_events metadata to immediately pack it again, which was a bit of a silly walk (and one extra usecase of `msgpack_rpc_from_object` which will get yak shaved in the next PR)
This commit is contained in:
@@ -366,24 +366,6 @@ ptrdiff_t file_skip(FileDescriptor *const fp, const size_t size)
|
||||
return (ptrdiff_t)read_bytes;
|
||||
}
|
||||
|
||||
/// Msgpack callback for writing to a file
|
||||
///
|
||||
/// @param data File to write to.
|
||||
/// @param[in] buf Data to write.
|
||||
/// @param[in] len Length of the data to write.
|
||||
///
|
||||
/// @return 0 in case of success, -1 in case of error.
|
||||
int msgpack_file_write(void *data, const char *buf, size_t len)
|
||||
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
|
||||
{
|
||||
assert(len < PTRDIFF_MAX);
|
||||
const ptrdiff_t written_bytes = file_write((FileDescriptor *)data, buf, len);
|
||||
if (written_bytes < 0) {
|
||||
return msgpack_file_write_error((int)written_bytes);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// Print error which occurs when failing to write msgpack data
|
||||
///
|
||||
/// @param[in] error Error code of the error to print.
|
||||
|
Reference in New Issue
Block a user