mirror of
https://github.com/neovim/neovim.git
synced 2026-02-07 13:02:04 +10:00
Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
43 lines
971 B
C
43 lines
971 B
C
#ifndef NVIM_EVENT_SOCKET_H
|
|
#define NVIM_EVENT_SOCKET_H
|
|
|
|
#include <uv.h>
|
|
|
|
#include "nvim/event/loop.h"
|
|
#include "nvim/event/multiqueue.h"
|
|
#include "nvim/event/rstream.h"
|
|
#include "nvim/event/wstream.h"
|
|
|
|
struct socket_watcher;
|
|
|
|
#define ADDRESS_MAX_SIZE 256
|
|
|
|
typedef struct socket_watcher SocketWatcher;
|
|
typedef void (*socket_cb)(SocketWatcher *watcher, int result, void *data);
|
|
typedef void (*socket_close_cb)(SocketWatcher *watcher, void *data);
|
|
|
|
struct socket_watcher {
|
|
// Pipe/socket path, or TCP address string
|
|
char addr[ADDRESS_MAX_SIZE];
|
|
// TCP server or unix socket (named pipe on Windows)
|
|
union {
|
|
struct {
|
|
uv_tcp_t handle;
|
|
struct addrinfo *addrinfo;
|
|
} tcp;
|
|
struct {
|
|
uv_pipe_t handle;
|
|
} pipe;
|
|
} uv;
|
|
uv_stream_t *stream;
|
|
void *data;
|
|
socket_cb cb;
|
|
socket_close_cb close_cb;
|
|
MultiQueue *events;
|
|
};
|
|
|
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
|
# include "event/socket.h.generated.h"
|
|
#endif
|
|
#endif // NVIM_EVENT_SOCKET_H
|