@@ -556,43 +556,29 @@ The C domain (name **c**) is suited for documentation of C API.
556
556
557
557
Describes a C function. The signature should be given as in C, e.g.::
558
558
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)
563
560
564
561
Note that you don't have to backslash-escape asterisks in the signature, as
565
562
it is not parsed by the reST inliner.
566
563
567
564
.. rst :directive :: .. c:member:: declaration
565
+ .. c:var:: declaration
568
566
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::
572
568
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
576
570
577
571
.. rst :directive :: .. c:macro:: name
572
+ .. c:macro:: name(arg list)
578
573
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.
589
576
590
- .. rst :directive :: .. c:var:: declaration
577
+ .. rst :directive :: .. c:type:: typedef-like declaration
578
+ .. c:type:: name
591
579
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.
596
582
597
583
.. _c-roles :
598
584
@@ -607,21 +593,18 @@ are defined in the documentation:
607
593
Reference a C-language function. Should include trailing parentheses.
608
594
609
595
.. rst :role :: c:member
596
+ c:data
610
597
611
- Reference a C-language member of a struct.
598
+ Reference a C-language member of a struct or variable .
612
599
613
600
.. rst :role :: c:macro
614
601
615
- Reference a " simple" C macro, as defined above.
602
+ Reference a simple C macro, as defined above.
616
603
617
604
.. rst :role :: c:type
618
605
619
606
Reference a C-language type.
620
607
621
- .. rst :role :: c:data
622
-
623
- Reference a C-language variable.
624
-
625
608
626
609
.. _cpp-domain :
627
610
0 commit comments