diff options
Diffstat (limited to 'deps/uv/docs')
-rw-r--r-- | deps/uv/docs/src/conf.py | 4 | ||||
-rw-r--r-- | deps/uv/docs/src/design.rst | 4 | ||||
-rw-r--r-- | deps/uv/docs/src/dns.rst | 16 | ||||
-rw-r--r-- | deps/uv/docs/src/fs.rst | 44 | ||||
-rw-r--r-- | deps/uv/docs/src/loop.rst | 4 | ||||
-rw-r--r-- | deps/uv/docs/src/misc.rst | 20 | ||||
-rw-r--r-- | deps/uv/docs/src/pipe.rst | 4 | ||||
-rw-r--r-- | deps/uv/docs/src/poll.rst | 4 | ||||
-rw-r--r-- | deps/uv/docs/src/sphinx-plugins/manpage.py | 46 | ||||
-rw-r--r-- | deps/uv/docs/src/stream.rst | 2 | ||||
-rw-r--r-- | deps/uv/docs/src/tcp.rst | 4 | ||||
-rw-r--r-- | deps/uv/docs/src/threadpool.rst | 4 | ||||
-rw-r--r-- | deps/uv/docs/src/tty.rst | 34 | ||||
-rw-r--r-- | deps/uv/docs/src/udp.rst | 4 |
14 files changed, 143 insertions, 51 deletions
diff --git a/deps/uv/docs/src/conf.py b/deps/uv/docs/src/conf.py index f614fc5b43..b9eaa13743 100644 --- a/deps/uv/docs/src/conf.py +++ b/deps/uv/docs/src/conf.py @@ -38,7 +38,7 @@ def get_libuv_version(): # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) +sys.path.insert(0, os.path.abspath('sphinx-plugins')) # -- General configuration ------------------------------------------------ @@ -48,7 +48,7 @@ def get_libuv_version(): # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [] +extensions = ['manpage'] # Add any paths that contain templates here, relative to this directory. templates_path = ['templates'] diff --git a/deps/uv/docs/src/design.rst b/deps/uv/docs/src/design.rst index 63141bedf5..34c3cff68e 100644 --- a/deps/uv/docs/src/design.rst +++ b/deps/uv/docs/src/design.rst @@ -40,7 +40,7 @@ The I/O loop The I/O (or event) loop is the central part of libuv. It establishes the content for all I/O operations, and it's meant to be tied to a single thread. One can run multiple event loops as long as each runs in a different thread. The libuv event loop (or any other API involving -the loop or handles, for that matter) **is not thread-safe** except stated otherwise. +the loop or handles, for that matter) **is not thread-safe** except where stated otherwise. The event loop follows the rather usual single threaded asynchronous I/O approach: all (network) I/O is performed on non-blocking sockets which are polled using the best mechanism available @@ -113,7 +113,7 @@ stages of a loop iteration: .. note:: While the polling mechanism is different, libuv makes the execution model consistent - Unix systems and Windows. + across Unix systems and Windows. File I/O diff --git a/deps/uv/docs/src/dns.rst b/deps/uv/docs/src/dns.rst index 3b15377f91..1d88158096 100644 --- a/deps/uv/docs/src/dns.rst +++ b/deps/uv/docs/src/dns.rst @@ -51,6 +51,18 @@ Public members Loop that started this getnameinfo request and where completion will be reported. Readonly. +.. c:member:: char[NI_MAXHOST] uv_getnameinfo_t.host + + Char array containing the resulting host. It's null terminated. + + .. versionchanged:: 1.3.0 the field is declared as public. + +.. c:member:: char[NI_MAXSERV] uv_getnameinfo_t.service + + Char array containing the resulting service. It's null terminated. + + .. versionchanged:: 1.3.0 the field is declared as public. + .. seealso:: The :c:type:`uv_req_t` members also apply. @@ -59,7 +71,7 @@ API .. c:function:: int uv_getaddrinfo(uv_loop_t* loop, uv_getaddrinfo_t* req, uv_getaddrinfo_cb getaddrinfo_cb, const char* node, const char* service, const struct addrinfo* hints) - Asynchronous ``getaddrinfo(3)``. + Asynchronous :man:`getaddrinfo(3)`. Either node or service may be NULL but not both. @@ -84,7 +96,7 @@ API .. c:function:: int uv_getnameinfo(uv_loop_t* loop, uv_getnameinfo_t* req, uv_getnameinfo_cb getnameinfo_cb, const struct sockaddr* addr, int flags) - Asynchronous ``getnameinfo(3)``. + Asynchronous :man:`getnameinfo(3)`. Returns 0 on success or an error code < 0 on failure. If successful, the callback will get called sometime in the future with the lookup result. diff --git a/deps/uv/docs/src/fs.rst b/deps/uv/docs/src/fs.rst index cd535f756f..c2a3fc252a 100644 --- a/deps/uv/docs/src/fs.rst +++ b/deps/uv/docs/src/fs.rst @@ -162,46 +162,46 @@ API .. c:function:: int uv_fs_close(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) - Equivalent to ``close(2)``. + Equivalent to :man:`close(2)`. .. c:function:: int uv_fs_open(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags, int mode, uv_fs_cb cb) - Equivalent to ``open(2)``. + Equivalent to :man:`open(2)`. .. c:function:: int uv_fs_read(uv_loop_t* loop, uv_fs_t* req, uv_file file, const uv_buf_t bufs[], unsigned int nbufs, int64_t offset, uv_fs_cb cb) - Equivalent to ``preadv(2)``. + Equivalent to :man:`preadv(2)`. .. c:function:: int uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) - Equivalent to ``unlink(2)``. + Equivalent to :man:`unlink(2)`. .. c:function:: int uv_fs_write(uv_loop_t* loop, uv_fs_t* req, uv_file file, const uv_buf_t bufs[], unsigned int nbufs, int64_t offset, uv_fs_cb cb) - Equivalent to ``pwritev(2)``. + Equivalent to :man:`pwritev(2)`. .. c:function:: int uv_fs_mkdir(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode, uv_fs_cb cb) - Equivalent to ``mkdir(2)``. + Equivalent to :man:`mkdir(2)`. .. note:: `mode` is currently not implemented on Windows. .. c:function:: int uv_fs_mkdtemp(uv_loop_t* loop, uv_fs_t* req, const char* tpl, uv_fs_cb cb) - Equivalent to ``mkdtemp(3)``. + Equivalent to :man:`mkdtemp(3)`. .. note:: The result can be found as a null terminated string at `req->path`. .. c:function:: int uv_fs_rmdir(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) - Equivalent to ``rmdir(2)``. + Equivalent to :man:`rmdir(2)`. .. c:function:: int uv_fs_scandir(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags, uv_fs_cb cb) .. c:function:: int uv_fs_scandir_next(uv_fs_t* req, uv_dirent_t* ent) - Equivalent to ``scandir(3)``, with a slightly different API. Once the callback + Equivalent to :man:`scandir(3)`, with a slightly different API. Once the callback for the request is called, the user can use :c:func:`uv_fs_scandir_next` to get `ent` populated with the next directory entry data. When there are no more entries ``UV_EOF`` will be returned. @@ -210,49 +210,49 @@ API .. c:function:: int uv_fs_fstat(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) .. c:function:: int uv_fs_lstat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) - Equivalent to ``(f/l)stat(2)``. + Equivalent to :man:`stat(2)`, :man:`fstat(2)` and :man:`fstat(2)` respectively. .. c:function:: int uv_fs_rename(uv_loop_t* loop, uv_fs_t* req, const char* path, const char* new_path, uv_fs_cb cb) - Equivalent to ``rename(2)``. + Equivalent to :man:`rename(2)`. .. c:function:: int uv_fs_fsync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) - Equivalent to ``fsync(2)``. + Equivalent to :man:`fsync(2)`. .. c:function:: int uv_fs_fdatasync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) - Equivalent to ``fdatasync(2)``. + Equivalent to :man:`fdatasync(2)`. .. c:function:: int uv_fs_ftruncate(uv_loop_t* loop, uv_fs_t* req, uv_file file, int64_t offset, uv_fs_cb cb) - Equivalent to ``ftruncate(2)``. + Equivalent to :man:`ftruncate(2)`. .. c:function:: int uv_fs_sendfile(uv_loop_t* loop, uv_fs_t* req, uv_file out_fd, uv_file in_fd, int64_t in_offset, size_t length, uv_fs_cb cb) - Limited equivalent to ``sendfile(2)``. + Limited equivalent to :man:`sendfile(2)`. .. c:function:: int uv_fs_access(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode, uv_fs_cb cb) - Equivalent to ``access(2)`` on Unix. Windows uses ``GetFileAttributesW()``. + Equivalent to :man:`access(2)` on Unix. Windows uses ``GetFileAttributesW()``. .. c:function:: int uv_fs_chmod(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode, uv_fs_cb cb) .. c:function:: int uv_fs_fchmod(uv_loop_t* loop, uv_fs_t* req, uv_file file, int mode, uv_fs_cb cb) - Equivalent to ``(f)chmod(2)``. + Equivalent to :man:`chmod(2)` and :man:`fchmod(2)` respectively. .. c:function:: int uv_fs_utime(uv_loop_t* loop, uv_fs_t* req, const char* path, double atime, double mtime, uv_fs_cb cb) .. c:function:: int uv_fs_futime(uv_loop_t* loop, uv_fs_t* req, uv_file file, double atime, double mtime, uv_fs_cb cb) - Equivalent to ``(f)utime(s)(2)``. + Equivalent to :man:`utime(2)` and :man:`futime(2)` respectively. .. c:function:: int uv_fs_link(uv_loop_t* loop, uv_fs_t* req, const char* path, const char* new_path, uv_fs_cb cb) - Equivalent to ``link(2)``. + Equivalent to :man:`link(2)`. .. c:function:: int uv_fs_symlink(uv_loop_t* loop, uv_fs_t* req, const char* path, const char* new_path, int flags, uv_fs_cb cb) - Equivalent to ``symlink(2)``. + Equivalent to :man:`symlink(2)`. .. note:: On Windows the `flags` parameter can be specified to control how the symlink will @@ -265,12 +265,12 @@ API .. c:function:: int uv_fs_readlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) - Equivalent to ``readlink(2)``. + Equivalent to :man:`readlink(2)`. .. c:function:: int uv_fs_chown(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_uid_t uid, uv_gid_t gid, uv_fs_cb cb) .. c:function:: int uv_fs_fchown(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_uid_t uid, uv_gid_t gid, uv_fs_cb cb) - Equivalent to ``(f)chown(2)``. + Equivalent to :man:`chown(2)` and :man:`fchown(2)` respectively. .. note:: These functions are not implemented on Windows. diff --git a/deps/uv/docs/src/loop.rst b/deps/uv/docs/src/loop.rst index 203672bd34..2a01d79637 100644 --- a/deps/uv/docs/src/loop.rst +++ b/deps/uv/docs/src/loop.rst @@ -92,7 +92,9 @@ API specified mode: - UV_RUN_DEFAULT: Runs the event loop until there are no more active and - referenced handles or requests. Always returns zero. + referenced handles or requests. Returns non-zero if :c:func:`uv_stop` + was called and there are still active handles or requests. Returns + zero in all other cases. - UV_RUN_ONCE: Poll for i/o once. Note that this function blocks if there are no pending callbacks. Returns zero when done (no active handles or requests left), or non-zero if more callbacks are expected (meaning diff --git a/deps/uv/docs/src/misc.rst b/deps/uv/docs/src/misc.rst index 10c349e9b7..bb97a26005 100644 --- a/deps/uv/docs/src/misc.rst +++ b/deps/uv/docs/src/misc.rst @@ -15,6 +15,17 @@ Data types Buffer data type. + .. c:member:: char* uv_buf_t.base + + Pointer to the base of the buffer. Readonly. + + .. c:member:: size_t uv_buf_t.len + + Total bytes in the buffer. Readonly. + + .. note:: + On Windows this field is ULONG. + .. c:type:: uv_file Cross platform representation of a file handle. @@ -26,7 +37,7 @@ Data types .. c:type:: uv_os_fd_t Abstract representation of a file descriptor. On Unix systems this is a - `typedef` of `int` and on Windows fa `HANDLE`. + `typedef` of `int` and on Windows a `HANDLE`. .. c:type:: uv_rusage_t @@ -101,7 +112,8 @@ API descriptor. Usually this will be used during initialization to guess the type of the stdio streams. - For ``isatty()`` functionality use this function and test for ``UV_TTY``. + For :man:`isatty(3)` equivalent functionality use this function and test + for ``UV_TTY``. .. c:function:: unsigned int uv_version(void) @@ -195,8 +207,8 @@ API .. c:function:: int uv_inet_ntop(int af, const void* src, char* dst, size_t size) .. c:function:: int uv_inet_pton(int af, const char* src, void* dst) - Cross-platform IPv6-capable implementation of the 'standard' ``inet_ntop()`` - and ``inet_pton()`` functions. On success they return 0. In case of error + Cross-platform IPv6-capable implementation of :man:`inet_ntop(3)` + and :man:`inet_pton(3)`. On success they return 0. In case of error the target `dst` pointer is unmodified. .. c:function:: int uv_exepath(char* buffer, size_t* size) diff --git a/deps/uv/docs/src/pipe.rst b/deps/uv/docs/src/pipe.rst index 8f8402c29b..df896a0583 100644 --- a/deps/uv/docs/src/pipe.rst +++ b/deps/uv/docs/src/pipe.rst @@ -40,6 +40,10 @@ API .. versionchanged:: 1.2.1 the file descriptor is set to non-blocking mode. + .. note:: + The passed file descriptor or HANDLE is not checked for its type, but + it's required that it represents a valid pipe. + .. c:function:: int uv_pipe_bind(uv_pipe_t* handle, const char* name) Bind the pipe to a file path (Unix) or a name (Windows). diff --git a/deps/uv/docs/src/poll.rst b/deps/uv/docs/src/poll.rst index 907cb1a613..6dc41839ac 100644 --- a/deps/uv/docs/src/poll.rst +++ b/deps/uv/docs/src/poll.rst @@ -5,7 +5,7 @@ =================================== Poll handles are used to watch file descriptors for readability and -writability, similar to the purpose of poll(2). +writability, similar to the purpose of :man:`poll(2)`. The purpose of poll handles is to enable integrating external libraries that rely on the event loop to signal it about the socket status changes, like @@ -29,7 +29,7 @@ closed immediately after a call to :c:func:`uv_poll_stop` or :c:func:`uv_close`. .. note:: On windows only sockets can be polled with poll handles. On Unix any file - descriptor that would be accepted by poll(2) can be used. + descriptor that would be accepted by :man:`poll(2)` can be used. Data types diff --git a/deps/uv/docs/src/sphinx-plugins/manpage.py b/deps/uv/docs/src/sphinx-plugins/manpage.py new file mode 100644 index 0000000000..1d1dc379f4 --- /dev/null +++ b/deps/uv/docs/src/sphinx-plugins/manpage.py @@ -0,0 +1,46 @@ +# encoding: utf-8 + +# +# Copyright (c) 2013 Dariusz Dwornikowski. All rights reserved. +# +# Adapted from https://github.com/tdi/sphinxcontrib-manpage +# License: Apache 2 +# + + +import re + +from docutils import nodes, utils +from docutils.parsers.rst.roles import set_classes +from string import Template + + +def make_link_node(rawtext, app, name, manpage_num, options): + ref = app.config.man_url_regex + if not ref: + ref = "http://linux.die.net/man/%s/%s" % (manpage_num, name) + else: + s = Template(ref) + ref = s.substitute(num=manpage_num, topic=name) + set_classes(options) + node = nodes.reference(rawtext, "%s(%s)" % (name, manpage_num), refuri=ref, **options) + return node + + +def man_role(name, rawtext, text, lineno, inliner, options={}, content=[]): + app = inliner.document.settings.env.app + p = re.compile("([a-zA-Z0-9_\.-_]+)\((\d)\)") + m = p.match(text) + + manpage_num = m.group(2) + name = m.group(1) + node = make_link_node(rawtext, app, name, manpage_num, options) + return [node], [] + + +def setup(app): + app.info('Initializing manpage plugin') + app.add_role('man', man_role) + app.add_config_value('man_url_regex', None, 'env') + return + diff --git a/deps/uv/docs/src/stream.rst b/deps/uv/docs/src/stream.rst index 1f6682adc1..880f0e2ebc 100644 --- a/deps/uv/docs/src/stream.rst +++ b/deps/uv/docs/src/stream.rst @@ -104,7 +104,7 @@ API .. c:function:: int uv_listen(uv_stream_t* stream, int backlog, uv_connection_cb cb) Start listening for incoming connections. `backlog` indicates the number of - connections the kernel might queue, same as ``listen(2)``. When a new + connections the kernel might queue, same as :man:`listen(2)`. When a new incoming connection is received the :c:type:`uv_connection_cb` callback is called. diff --git a/deps/uv/docs/src/tcp.rst b/deps/uv/docs/src/tcp.rst index 8baedde86c..2b5d268ddd 100644 --- a/deps/uv/docs/src/tcp.rst +++ b/deps/uv/docs/src/tcp.rst @@ -38,6 +38,10 @@ API .. versionchanged:: 1.2.1 the file descriptor is set to non-blocking mode. + .. note:: + The passed file descriptor or SOCKET is not checked for its type, but + it's required that it represents a valid stream socket. + .. c:function:: int uv_tcp_nodelay(uv_tcp_t* handle, int enable) Enable / disable Nagle's algorithm. diff --git a/deps/uv/docs/src/threadpool.rst b/deps/uv/docs/src/threadpool.rst index 89f00844ef..18949507e7 100644 --- a/deps/uv/docs/src/threadpool.rst +++ b/deps/uv/docs/src/threadpool.rst @@ -18,6 +18,10 @@ libuv preallocates and initializes the maximum number of threads allowed by ``UV_THREADPOOL_SIZE``. This causes a relatively minor memory overhead (~1MB for 128 threads) but increases the performance of threading at runtime. +.. note:: + Note that even though a global thread pool which is shared across all events + loops is used, the functions are not thread safe. + Data types ---------- diff --git a/deps/uv/docs/src/tty.rst b/deps/uv/docs/src/tty.rst index 6c20c84bf7..18f34ef46d 100644 --- a/deps/uv/docs/src/tty.rst +++ b/deps/uv/docs/src/tty.rst @@ -24,14 +24,14 @@ Data types :: - typedef enum { - /* Initial/normal terminal mode */ - UV_TTY_MODE_NORMAL, - /* Raw input mode (On Windows, ENABLE_WINDOW_INPUT is also enabled) */ - UV_TTY_MODE_RAW, - /* Binary-safe I/O mode for IPC (Unix-only) */ - UV_TTY_MODE_IO - } uv_tty_mode_t; + typedef enum { + /* Initial/normal terminal mode */ + UV_TTY_MODE_NORMAL, + /* Raw input mode (On Windows, ENABLE_WINDOW_INPUT is also enabled) */ + UV_TTY_MODE_RAW, + /* Binary-safe I/O mode for IPC (Unix-only) */ + UV_TTY_MODE_IO + } uv_tty_mode_t; @@ -58,18 +58,22 @@ API `readable`, specifies if you plan on calling :c:func:`uv_read_start` with this stream. stdin is readable, stdout is not. - On Unix this function will try to open ``/dev/tty`` and use it if the passed file - descriptor refers to a TTY. This lets libuv put the tty in non-blocking mode - without affecting other processes that share the tty. + On Unix this function will try to open ``/dev/tty`` and use it if the passed + file descriptor refers to a TTY. This lets libuv put the tty in non-blocking + mode without affecting other processes that share the tty. .. note:: - If opening ``/dev/tty`` fails, libuv falls back to blocking writes for non-readable - TTY streams. + If opening ``/dev/tty`` fails, libuv falls back to blocking writes for + non-readable TTY streams. + + .. versionchanged:: 1.5.0: trying to initialize a TTY stream with a file + descriptor that refers to a file returns `UV_EINVAL` + on UNIX. .. c:function:: int uv_tty_set_mode(uv_tty_t*, uv_tty_mode_t mode) - .. versionchanged:: 1.2.0: the mode is specified as a :c:type:`uv_tty_mode_t` - value. + .. versionchanged:: 1.2.0: the mode is specified as a + :c:type:`uv_tty_mode_t` value. Set the TTY using the specified terminal mode. diff --git a/deps/uv/docs/src/udp.rst b/deps/uv/docs/src/udp.rst index 9c4aa2102b..ec7ce56d38 100644 --- a/deps/uv/docs/src/udp.rst +++ b/deps/uv/docs/src/udp.rst @@ -122,6 +122,10 @@ API .. versionchanged:: 1.2.1 the file descriptor is set to non-blocking mode. + .. note:: + The passed file descriptor or SOCKET is not checked for its type, but + it's required that it represents a valid datagram socket. + .. c:function:: int uv_udp_bind(uv_udp_t* handle, const struct sockaddr* addr, unsigned int flags) Bind the UDP handle to an IP address and port. |