summaryrefslogtreecommitdiffstats
path: root/Documentation/kernel-documentation.rst
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2016-08-22 15:40:38 -0600
committerJonathan Corbet <corbet@lwn.net>2016-08-22 15:40:38 -0600
commit8d8f60c5e0cdc05bd9785faffd1cc034acdcd6d6 (patch)
tree41554684ad5904924b3108cbec4debffe56b90b2 /Documentation/kernel-documentation.rst
parente349b1b700c1fda12380cd5dcf6af8a3b82edff3 (diff)
parentca7bfe2c8d9f3aee469a3a36110a95ebb511ee20 (diff)
downloadlinux-8d8f60c5e0cdc05bd9785faffd1cc034acdcd6d6.tar.gz
linux-8d8f60c5e0cdc05bd9785faffd1cc034acdcd6d6.tar.bz2
linux-8d8f60c5e0cdc05bd9785faffd1cc034acdcd6d6.zip
Merge branch 'doc/4.9' into docs-next
Diffstat (limited to 'Documentation/kernel-documentation.rst')
-rw-r--r--Documentation/kernel-documentation.rst29
1 files changed, 29 insertions, 0 deletions
diff --git a/Documentation/kernel-documentation.rst b/Documentation/kernel-documentation.rst
index 391decc66a18..a0dcae15639b 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
-----------