Skip to content

Commit 0f49e30

Browse files
committed
C, initial rewrite
1 parent 77d8471 commit 0f49e30

File tree

10 files changed

+2880
-468
lines changed

10 files changed

+2880
-468
lines changed

doc/usage/restructuredtext/domains.rst

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -556,43 +556,29 @@ The C domain (name **c**) is suited for documentation of C API.
556556
557557
Describes a C function. The signature should be given as in C, e.g.::
558558

559-
.. c:function:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
560-
561-
This is also used to describe function-like preprocessor macros. The names
562-
of the arguments should be given so they may be used in the description.
559+
.. c:function:: PyObject *PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
563560

564561
Note that you don't have to backslash-escape asterisks in the signature, as
565562
it is not parsed by the reST inliner.
566563

567564
.. rst:directive:: .. c:member:: declaration
565+
.. c:var:: declaration
568566
569-
Describes a C struct member. Example signature::
570-
571-
.. c:member:: PyObject* PyTypeObject.tp_bases
567+
Describes a C struct member or variable. Example signature::
572568

573-
The text of the description should include the range of values allowed, how
574-
the value should be interpreted, and whether the value can be changed.
575-
References to structure members in text should use the ``member`` role.
569+
.. c:member:: PyObject *PyTypeObject.tp_bases
576570

577571
.. rst:directive:: .. c:macro:: name
572+
.. c:macro:: name(arg list)
578573
579-
Describes a "simple" C macro. Simple macros are macros which are used for
580-
code expansion, but which do not take arguments so cannot be described as
581-
functions. This is a simple C-language ``#define``. Examples of its use in
582-
the Python documentation include :c:macro:`PyObject_HEAD` and
583-
:c:macro:`Py_BEGIN_ALLOW_THREADS`.
584-
585-
.. rst:directive:: .. c:type:: name
586-
587-
Describes a C type (whether defined by a typedef or struct). The signature
588-
should just be the type name.
574+
Describes a C macro, i.e., a C-language ``#define``, without the replacement
575+
text.
589576

590-
.. rst:directive:: .. c:var:: declaration
577+
.. rst:directive:: .. c:type:: typedef-like declaration
578+
.. c:type:: name
591579
592-
Describes a global C variable. The signature should include the type, such
593-
as::
594-
595-
.. c:var:: PyObject* PyClass_Type
580+
Describes a C type, either as a typedef, or the alias for an unspecified
581+
type.
596582

597583
.. _c-roles:
598584

@@ -607,21 +593,18 @@ are defined in the documentation:
607593
Reference a C-language function. Should include trailing parentheses.
608594

609595
.. rst:role:: c:member
596+
c:data
610597
611-
Reference a C-language member of a struct.
598+
Reference a C-language member of a struct or variable.
612599

613600
.. rst:role:: c:macro
614601
615-
Reference a "simple" C macro, as defined above.
602+
Reference a simple C macro, as defined above.
616603

617604
.. rst:role:: c:type
618605
619606
Reference a C-language type.
620607

621-
.. rst:role:: c:data
622-
623-
Reference a C-language variable.
624-
625608

626609
.. _cpp-domain:
627610

0 commit comments

Comments
 (0)