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/input.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nvim/os/input.c') diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index a673a6c8b8..95afa95d61 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -124,6 +124,10 @@ void os_breakcheck() fill_input_buf(false); } +/// Test whether a file descriptor refers to a terminal. +/// +/// @param fd File descriptor. +/// @return `true` if file descriptor refers to a terminal. bool os_isatty(int fd) { return uv_guess_handle(fd) == UV_TTY; -- 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/input.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/nvim/os/input.c') diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index 95afa95d61..3e9751a4db 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -25,12 +25,11 @@ typedef enum { static RStream *read_stream; static bool eof = false, started_reading = false; -static InbufPollResult inbuf_poll(int32_t ms); -static void stderr_switch(void); -static void read_cb(RStream *rstream, void *data, bool eof); +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "os/input.c.generated.h" +#endif // Helper function used to push bytes from the 'event' key sequence partially // between calls to os_inchar when maxlen < 3 -static int push_event_key(uint8_t *buf, int maxlen); void input_init() { -- cgit