X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=Documentation%2Fkernel-documentation.rst;h=10cc7ddb62356aeae9259724aaa6584f0c81ce9a;hb=6727ad9e206cc08b80d8000a4d67f8417e53539d;hp=391decc66a18fd3da282cc009d6f239441de4a8d;hpb=b669010e5878dfda9c1b494f96fc122b67f8d880;p=cascardo%2Flinux.git diff --git a/Documentation/kernel-documentation.rst b/Documentation/kernel-documentation.rst index 391decc66a18..10cc7ddb6235 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 ----------- @@ -265,6 +294,8 @@ The kernel-doc extension is included in the kernel source tree, at ``scripts/kernel-doc`` script to extract the documentation comments from the source. +.. _kernel_doc: + Writing kernel-doc comments ===========================