Skip to content

Commit

Permalink
first conversion from docs->rst
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeInnes committed Jun 27, 2015
1 parent a392a04 commit b95f63f
Show file tree
Hide file tree
Showing 18 changed files with 19,229 additions and 4,874 deletions.
2,466 changes: 2,027 additions & 439 deletions doc/stdlib/arrays.rst

Large diffs are not rendered by default.

3,093 changes: 2,521 additions & 572 deletions doc/stdlib/base.rst

Large diffs are not rendered by default.

297 changes: 217 additions & 80 deletions doc/stdlib/c.rst

Large diffs are not rendered by default.

2,487 changes: 1,836 additions & 651 deletions doc/stdlib/collections.rst

Large diffs are not rendered by default.

885 changes: 736 additions & 149 deletions doc/stdlib/dates.rst

Large diffs are not rendered by default.

846 changes: 737 additions & 109 deletions doc/stdlib/file.rst

Large diffs are not rendered by default.

2,126 changes: 1,672 additions & 454 deletions doc/stdlib/io-network.rst

Large diffs are not rendered by default.

204 changes: 180 additions & 24 deletions doc/stdlib/libc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,64 +6,195 @@

.. function:: malloc(size::Integer) -> Ptr{Void}

Call ``malloc`` from the C standard library.
::

malloc(size::Integer) -> Ptr{Void}

Call ``malloc`` from the C standard library.


::

malloc(size::Integer) -> Ptr{Void}

Call ``malloc`` from the C standard library.


.. function:: calloc(num::Integer, size::Integer) -> Ptr{Void}

Call ``calloc`` from the C standard library.
::

calloc(num::Integer, size::Integer) -> Ptr{Void}

Call ``calloc`` from the C standard library.


::

calloc(num::Integer, size::Integer) -> Ptr{Void}

Call ``calloc`` from the C standard library.


.. function:: realloc(addr::Ptr, size::Integer) -> Ptr{Void}

Call ``realloc`` from the C standard library.
::

realloc(addr::Ptr, size::Integer) -> Ptr{Void}

Call ``realloc`` from the C standard library. See warning in the documentation for ``free`` regarding only using this on memory originally obtained from ``malloc``.


::

realloc(addr::Ptr, size::Integer) -> Ptr{Void}

Call ``realloc`` from the C standard library. See warning in the documentation for ``free`` regarding only using this on memory originally obtained from ``malloc``.

See warning in the documentation for ``free`` regarding only using this on memory originally obtained from ``malloc``.

.. function:: free(addr::Ptr)

Call ``free`` from the C standard library. Only use this on memory obtained from ``malloc``,
not on pointers retrieved from other C libraries.
``Ptr`` objects obtained from C libraries should be freed by the free functions defined in that library,
to avoid assertion failures if multiple ``libc`` libraries exist on the system.
::

free(addr::Ptr)

Call ``free`` from the C standard library. Only use this on memory obtained from ``malloc``, not on pointers retrieved from other C libraries. ``Ptr`` objects obtained from C libraries should be freed by the free functions defined in that library, to avoid assertion failures if multiple ``libc`` libraries exist on the system.


::

free(addr::Ptr)

Call ``free`` from the C standard library. Only use this on memory obtained from ``malloc``, not on pointers retrieved from other C libraries. ``Ptr`` objects obtained from C libraries should be freed by the free functions defined in that library, to avoid assertion failures if multiple ``libc`` libraries exist on the system.


.. function:: errno([code])

Get the value of the C library's ``errno``. If an argument is specified, it is
used to set the value of ``errno``.
::

errno([code])

Get the value of the C library's ``errno``. If an argument is specified, it is used to set the value of ``errno``. The value of ``errno`` is only valid immediately after a ``ccall`` to a C library routine that sets it. Specifically, you cannot call executed between prompts.


::

errno([code])

Get the value of the C library's ``errno``. If an argument is specified, it is used to set the value of ``errno``. The value of ``errno`` is only valid immediately after a ``ccall`` to a C library routine that sets it. Specifically, you cannot call executed between prompts.

The value of ``errno`` is only valid immediately after a ``ccall`` to a C
library routine that sets it. Specifically, you cannot call ``errno`` at the next
prompt in a REPL, because lots of code is executed between prompts.

.. function:: strerror(n)

Convert a system call error code to a descriptive string
::

strerror(n)

Convert a system call error code to a descriptive string


::

strerror(n)

Convert a system call error code to a descriptive string


.. function:: time(t::TmStruct)

Converts a ``TmStruct`` struct to a number of seconds since the epoch.
::

time(t::TmStruct)

Converts a ``TmStruct`` struct to a number of seconds since the epoch.


::

time(t::TmStruct)

Converts a ``TmStruct`` struct to a number of seconds since the epoch.


.. function:: strftime([format], time)

Convert time, given as a number of seconds since the epoch or a ``TmStruct``, to a formatted string using the given format. Supported formats are the same as those in the standard C library.
::

strftime([format], time)

Convert time, given as a number of seconds since the epoch or a Supported formats are the same as those in the standard C library.


::

strftime([format], time)

Convert time, given as a number of seconds since the epoch or a Supported formats are the same as those in the standard C library.


.. function:: strptime([format], timestr)

Parse a formatted time string into a ``TmStruct`` giving the seconds, minute, hour, date, etc. Supported formats are the same as those in the standard C library. On some platforms, timezones will not be parsed correctly. If the result of this function will be passed to ``time`` to convert it to seconds since the epoch, the ``isdst`` field should be filled in manually. Setting it to ``-1`` will tell the C library to use the current system settings to determine the timezone.
::

strptime([format], timestr)

Parse a formatted time string into a ``TmStruct`` giving the seconds, minute, hour, date, etc. Supported formats are the same as those in the standard C library. On some platforms, timezones will not be parsed correctly. If the result of this function will be passed to ``time`` to convert it to seconds since the epoch, the will tell the C library to use the current system settings to determine the timezone.


::

strptime([format], timestr)

Parse a formatted time string into a ``TmStruct`` giving the seconds, minute, hour, date, etc. Supported formats are the same as those in the standard C library. On some platforms, timezones will not be parsed correctly. If the result of this function will be passed to ``time`` to convert it to seconds since the epoch, the will tell the C library to use the current system settings to determine the timezone.


.. function:: TmStruct([seconds])

Convert a number of seconds since the epoch to broken-down format, with fields ``sec``, ``min``, ``hour``, ``mday``, ``month``, ``year``, ``wday``, ``yday``, and ``isdst``.
::

TmStruct([seconds])

Convert a number of seconds since the epoch to broken-down format, with fields ``sec``, ``min``, ``hour``, ``mday``, ``month``,


::

TmStruct([seconds])

Convert a number of seconds since the epoch to broken-down format, with fields ``sec``, ``min``, ``hour``, ``mday``, ``month``,


.. function:: flush_cstdio()

Flushes the C ``stdout`` and ``stderr`` streams (which may have been
written to by external C code).
::

flush_cstdio()

Flushes the C ``stdout`` and ``stderr`` streams (which may have been written to by external C code).


::

flush_cstdio()

Flushes the C ``stdout`` and ``stderr`` streams (which may have been written to by external C code).


.. function:: msync(ptr, len, [flags])

Forces synchronization of the :func:`mmap`\ ped memory region from ``ptr`` to ``ptr+len``. Flags defaults to ``MS_SYNC``, but can be a combination of ``MS_ASYNC``, ``MS_SYNC``, or ``MS_INVALIDATE``. See your platform man page for specifics. The flags argument is not valid on Windows.
::

msync(ptr, len[, flags])

Forces synchronization of the ``mmap()``ped memory region from combination of ``MS_ASYNC``, ``MS_SYNC``, or ``MS_INVALIDATE``. See your platform man page for specifics. The flags argument is not valid on Windows. You may not need to call ``msync``, because synchronization is performed at intervals automatically by the operating system. However, you can call this directly if, for example, you are concerned about losing the result of a long-running calculation.


::

msync(ptr, len[, flags])

Forces synchronization of the ``mmap()``ped memory region from combination of ``MS_ASYNC``, ``MS_SYNC``, or ``MS_INVALIDATE``. See your platform man page for specifics. The flags argument is not valid on Windows. You may not need to call ``msync``, because synchronization is performed at intervals automatically by the operating system. However, you can call this directly if, for example, you are concerned about losing the result of a long-running calculation.

You may not need to call ``msync``, because synchronization is performed at intervals automatically by the operating system. However, you can call this directly if, for example, you are concerned about losing the result of a long-running calculation.

.. data:: MS_ASYNC

Expand All @@ -79,8 +210,33 @@

.. function:: mmap(len, prot, flags, fd, offset)

Low-level interface to the ``mmap`` system call. See the man page.
::

mmap(len, prot, flags, fd, offset)

Low-level interface to the ``mmap`` system call. See the man page.


::

mmap(len, prot, flags, fd, offset)

Low-level interface to the ``mmap`` system call. See the man page.


.. function:: munmap(pointer, len)

Low-level interface for unmapping memory (see the man page). With :func:`mmap_array` you do not need to call this directly; the memory is unmapped for you when the array goes out of scope.
::

munmap(pointer, len)

Low-level interface for unmapping memory (see the man page). With is unmapped for you when the array goes out of scope.


::

munmap(pointer, len)

Low-level interface for unmapping memory (see the man page). With is unmapped for you when the array goes out of scope.


99 changes: 78 additions & 21 deletions doc/stdlib/libdl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,35 @@

.. function:: dlopen(libfile::AbstractString [, flags::Integer])

Load a shared library, returning an opaque handle.

The optional flags argument is a bitwise-or of zero or more of
``RTLD_LOCAL``, ``RTLD_GLOBAL``, ``RTLD_LAZY``, ``RTLD_NOW``, ``RTLD_NODELETE``,
``RTLD_NOLOAD``, ``RTLD_DEEPBIND``, and ``RTLD_FIRST``. These are converted to
the corresponding flags of the POSIX (and/or GNU libc and/or MacOS)
dlopen command, if possible, or are ignored if the specified
functionality is not available on the current platform. The
default is ``RTLD_LAZY|RTLD_DEEPBIND|RTLD_LOCAL``. An important usage
of these flags, on POSIX platforms, is to specify
``RTLD_LAZY|RTLD_DEEPBIND|RTLD_GLOBAL`` in order for the library's
symbols to be available for usage in other shared libraries, in
situations where there are dependencies between shared libraries.
::

dlopen(libfile::AbstractString[, flags::Integer])

Load a shared library, returning an opaque handle. The optional flags argument is a bitwise-or of zero or more of the POSIX (and/or GNU libc and/or MacOS) dlopen command, if possible, or are ignored if the specified functionality is not available on the current platform. The default is these flags, on POSIX platforms, is to specify symbols to be available for usage in other shared libraries, in situations where there are dependencies between shared libraries.


::

dlopen(libfile::AbstractString[, flags::Integer])

Load a shared library, returning an opaque handle. The optional flags argument is a bitwise-or of zero or more of the POSIX (and/or GNU libc and/or MacOS) dlopen command, if possible, or are ignored if the specified functionality is not available on the current platform. The default is these flags, on POSIX platforms, is to specify symbols to be available for usage in other shared libraries, in situations where there are dependencies between shared libraries.


.. function:: dlopen_e(libfile::AbstractString [, flags::Integer])

Similar to :func:`dlopen`, except returns a ``NULL`` pointer instead of raising errors.
::

dlopen_e(libfile::AbstractString[, flags::Integer])

Similar to ``dlopen()``, except returns a ``NULL`` pointer instead of raising errors.


::

dlopen_e(libfile::AbstractString[, flags::Integer])

Similar to ``dlopen()``, except returns a ``NULL`` pointer instead of raising errors.


.. data:: RTLD_DEEPBIND

Expand Down Expand Up @@ -58,22 +70,67 @@

.. function:: dlsym(handle, sym)

Look up a symbol from a shared library handle, return callable function pointer on success.
::

dlsym(handle, sym)

Look up a symbol from a shared library handle, return callable function pointer on success.


::

dlsym(handle, sym)

Look up a symbol from a shared library handle, return callable function pointer on success.


.. function:: dlsym_e(handle, sym)

Look up a symbol from a shared library handle, silently return NULL pointer on lookup failure.
::

dlsym_e(handle, sym)

Look up a symbol from a shared library handle, silently return NULL pointer on lookup failure.


::

dlsym_e(handle, sym)

Look up a symbol from a shared library handle, silently return NULL pointer on lookup failure.


.. function:: dlclose(handle)

Close shared library referenced by handle.
::

dlclose(handle)

Close shared library referenced by handle.


::

dlclose(handle)

Close shared library referenced by handle.


.. function:: find_library(names, locations)

Searches for the first library in ``names`` in the paths in the ``locations`` list, ``DL_LOAD_PATH``, or system
library paths (in that order) which can successfully be dlopen'd. On success, the return value will be one of
the names (potentially prefixed by one of the paths in locations). This string can be assigned to a ``global const``
and used as the library name in future ``ccall``'s. On failure, it returns the empty string.
::

find_library(names, locations)

Searches for the first library in ``names`` in the paths in the that order) which can successfully be dlopen'd. On success, the return value will be one of the names (potentially prefixed by one of the paths in locations). This string can be assigned to a


::

find_library(names, locations)

Searches for the first library in ``names`` in the paths in the that order) which can successfully be dlopen'd. On success, the return value will be one of the names (potentially prefixed by one of the paths in locations). This string can be assigned to a


.. data:: DL_LOAD_PATH

Expand Down
Loading

0 comments on commit b95f63f

Please sign in to comment.