diff options
author | Markus Heiser <markus.heiser@darmarIT.de> | 2016-08-15 16:08:25 +0200 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2016-08-22 15:19:22 -0600 |
commit | 2c645cd7c4a0d4b35da1e43ec3a5b55a64038157 (patch) | |
tree | c18c69bd8fca8a662434864c714b0c884642a85b /Documentation/kernel-documentation.rst | |
parent | e8f5c617f26626ef4915ffa176f4ae02c9e08531 (diff) | |
download | op-kernel-dev-2c645cd7c4a0d4b35da1e43ec3a5b55a64038157.zip op-kernel-dev-2c645cd7c4a0d4b35da1e43ec3a5b55a64038157.tar.gz |
doc-rst:c-domain: ref-name of a function declaration
Add option 'name' to the "c:function:" directive. With option 'name'
the ref-name of a function can be modified. E.g.::
.. c:function:: int ioctl( int fd, int request )
:name: VIDIOC_LOG_STATUS
The func-name (e.g. ioctl) remains in the output but the ref-name
changed from ``ioctl`` to ``VIDIOC_LOG_STATUS``. The index entry for
this function is also changed to ``VIDIOC_LOG_STATUS`` and the function
can now referenced by::
:c:func:`VIDIOC_LOG_STATUS`
Signed-off-by: Markus Heiser <markus.heiser@darmarIT.de>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/kernel-documentation.rst')
-rw-r--r-- | Documentation/kernel-documentation.rst | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Documentation/kernel-documentation.rst b/Documentation/kernel-documentation.rst index c4eb504..bc4c3f5 100644 --- a/Documentation/kernel-documentation.rst +++ b/Documentation/kernel-documentation.rst @@ -107,6 +107,35 @@ Here are some specific guidelines for the kernel documentation: the order as encountered."), having the higher levels the same overall makes it easier to follow the documents. + +the C domain +------------ + +The `Sphinx C Domain`_ (name c) is suited for documentation of C API. E.g. a +function prototype: + +.. code-block:: rst + + .. c:function:: int ioctl( int fd, int request ) + +The C domain of the kernel-doc has some additional features. E.g. you can +*rename* the reference name of a function with a common name like ``open`` or +``ioctl``: + +.. code-block:: rst + + .. c:function:: int ioctl( int fd, int request ) + :name: VIDIOC_LOG_STATUS + +The func-name (e.g. ioctl) remains in the output but the ref-name changed from +``ioctl`` to ``VIDIOC_LOG_STATUS``. The index entry for this function is also +changed to ``VIDIOC_LOG_STATUS`` and the function can now referenced by: + +.. code-block:: rst + + :c:func:`VIDIOC_LOG_STATUS` + + list tables ----------- |