From 880957ad4e3fc0ff681025f5e29c5eccf797c564 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 10 May 2014 00:53:36 +0400 Subject: Move documentation from function declarations to definitions Uses a perl script to move it (scripts/movedocs.pl) --- src/nvim/os/channel.h | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'src/nvim/os/channel.h') diff --git a/src/nvim/os/channel.h b/src/nvim/os/channel.h index b88cd2445f..47182594b1 100644 --- a/src/nvim/os/channel.h +++ b/src/nvim/os/channel.h @@ -2,49 +2,24 @@ #define NVIM_OS_CHANNEL_H #include +#include #include "nvim/vim.h" #define EVENT_MAXLEN 512 -/// Initializes the module void channel_init(void); -/// Teardown the module void channel_teardown(void); -/// Creates an API channel from a libuv stream representing a tcp or -/// pipe/socket client connection -/// -/// @param stream The established connection void channel_from_stream(uv_stream_t *stream); -/// Creates an API channel by starting a job and connecting to its -/// stdin/stdout. stderr is forwarded to the editor error stream. -/// -/// @param argv The argument vector for the process void channel_from_job(char **argv); -/// Sends event/data to channel -/// -/// @param id The channel id. If 0, the event will be sent to all -/// channels that have subscribed to the event type -/// @param type The event type, an arbitrary string -/// @param obj The event data -/// @return True if the data was sent successfully, false otherwise. bool channel_send_event(uint64_t id, char *type, typval_T *data); -/// Subscribes to event broadcasts -/// -/// @param id The channel id -/// @param event The event type string void channel_subscribe(uint64_t id, char *event); -/// Unsubscribes to event broadcasts -/// -/// @param id The channel id -/// @param event The event type string void channel_unsubscribe(uint64_t id, char *event); #endif // NVIM_OS_CHANNEL_H - -- cgit From 70929f7e1616bab2783cc5735c6061981cda8a0f Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 10 May 2014 17:24:13 +0400 Subject: Add automatic generation of headers - The 'stripdecls.py' script replaces declarations in all headers by includes to generated headers. `ag '#\s*if(?!ndef NEOVIM_).*((?!#\s*endif).*\n)*#ifdef INCLUDE_GENERATED'` was used for this. - Add and integrate gendeclarations.lua into the build system to generate the required includes. - Add -Wno-unused-function - Made a bunch of old-style definitions ANSI This adds a requirement: all type and structure definitions must be present before INCLUDE_GENERATED_DECLARATIONS-protected include. Warning: mch_expandpath (path.h.generated.h) was moved manually. So far it is the only exception. --- src/nvim/os/channel.h | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'src/nvim/os/channel.h') diff --git a/src/nvim/os/channel.h b/src/nvim/os/channel.h index 47182594b1..240461d22e 100644 --- a/src/nvim/os/channel.h +++ b/src/nvim/os/channel.h @@ -8,18 +8,7 @@ #define EVENT_MAXLEN 512 -void channel_init(void); - -void channel_teardown(void); - -void channel_from_stream(uv_stream_t *stream); - -void channel_from_job(char **argv); - -bool channel_send_event(uint64_t id, char *type, typval_T *data); - -void channel_subscribe(uint64_t id, char *event); - -void channel_unsubscribe(uint64_t id, char *event); - +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "os/channel.h.generated.h" +#endif #endif // NVIM_OS_CHANNEL_H -- cgit