Skip to content

Commit 2a396b4

Browse files
AA-Turnerambv
authored andcommitted
[3.10] pythongh-93738: Documentation C syntax (Use c:struct) (pythonGH-97772)
Use `c:struct` (cherry picked from commit a0f5599) Co-authored-by: Adam Turner <[email protected]>
1 parent 09e5029 commit 2a396b4

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

Doc/c-api/import.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ Importing Modules
243243
UTF-8 encoded string instead of a Unicode object.
244244
245245
246-
.. c:type:: struct _frozen
246+
.. c:struct:: _frozen
247247
248248
.. index:: single: freeze utility
249249
@@ -261,7 +261,7 @@ Importing Modules
261261
262262
.. c:var:: const struct _frozen* PyImport_FrozenModules
263263
264-
This pointer is initialized to point to an array of :c:type:`struct _frozen`
264+
This pointer is initialized to point to an array of :c:struct:`_frozen`
265265
records, terminated by one whose members are all ``NULL`` or zero. When a frozen
266266
module is imported, it is searched in this table. Third-party code could play
267267
tricks with this to provide a dynamically created collection of frozen modules.
@@ -277,7 +277,7 @@ Importing Modules
277277
:c:func:`Py_Initialize`.
278278
279279
280-
.. c:type:: struct _inittab
280+
.. c:struct:: _inittab
281281
282282
Structure describing a single entry in the list of built-in modules. Each of
283283
these structures gives the name and initialization function for a module built

Doc/c-api/veryhigh.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ the same library that the Python runtime is using.
8282
.. c:function:: int PyRun_SimpleString(const char *command)
8383
8484
This is a simplified interface to :c:func:`PyRun_SimpleStringFlags` below,
85-
leaving the :c:type:`PyCompilerFlags`\* argument set to ``NULL``.
85+
leaving the :c:struct:`PyCompilerFlags`\* argument set to ``NULL``.
8686
8787
8888
.. c:function:: int PyRun_SimpleStringFlags(const char *command, PyCompilerFlags *flags)
@@ -344,7 +344,7 @@ the same library that the Python runtime is using.
344344
interpreter loop.
345345
346346
347-
.. c:type:: struct PyCompilerFlags
347+
.. c:struct:: PyCompilerFlags
348348
349349
This is the structure used to hold compiler flags. In cases where code is only
350350
being compiled, it is passed as ``int flags``, and in cases where code is being

Doc/library/ctypes.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ An extended example which also demonstrates the use of pointers accesses the
10751075

10761076
Quoting the docs for that value:
10771077

1078-
This pointer is initialized to point to an array of :c:type:`struct _frozen`
1078+
This pointer is initialized to point to an array of :c:struct:`_frozen`
10791079
records, terminated by one whose members are all ``NULL`` or zero. When a frozen
10801080
module is imported, it is searched in this table. Third-party code could play
10811081
tricks with this to provide a dynamically created collection of frozen modules.
@@ -1092,7 +1092,7 @@ size, we show only how this table can be read with :mod:`ctypes`::
10921092
...
10931093
>>>
10941094

1095-
We have defined the :c:type:`struct _frozen` data type, so we can get the pointer
1095+
We have defined the :c:struct:`_frozen` data type, so we can get the pointer
10961096
to the table::
10971097

10981098
>>> FrozenTable = POINTER(struct_frozen)

Doc/library/socket.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ The :mod:`socket` module also offers various network-related services:
948948
Convert an IPv4 address from dotted-quad string format (for example,
949949
'123.45.67.89') to 32-bit packed binary format, as a bytes object four characters in
950950
length. This is useful when conversing with a program that uses the standard C
951-
library and needs objects of type :c:type:`struct in_addr`, which is the C type
951+
library and needs objects of type :c:struct:`in_addr`, which is the C type
952952
for the 32-bit packed binary this function returns.
953953

954954
:func:`inet_aton` also accepts strings with less than three dots; see the
@@ -967,7 +967,7 @@ The :mod:`socket` module also offers various network-related services:
967967
Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four
968968
bytes in length) to its standard dotted-quad string representation (for example,
969969
'123.45.67.89'). This is useful when conversing with a program that uses the
970-
standard C library and needs objects of type :c:type:`struct in_addr`, which
970+
standard C library and needs objects of type :c:struct:`in_addr`, which
971971
is the C type for the 32-bit packed binary data this function takes as an
972972
argument.
973973

@@ -984,8 +984,8 @@ The :mod:`socket` module also offers various network-related services:
984984

985985
Convert an IP address from its family-specific string format to a packed,
986986
binary format. :func:`inet_pton` is useful when a library or network protocol
987-
calls for an object of type :c:type:`struct in_addr` (similar to
988-
:func:`inet_aton`) or :c:type:`struct in6_addr`.
987+
calls for an object of type :c:struct:`in_addr` (similar to
988+
:func:`inet_aton`) or :c:struct:`in6_addr`.
989989

990990
Supported values for *address_family* are currently :const:`AF_INET` and
991991
:const:`AF_INET6`. If the IP address string *ip_string* is invalid,
@@ -1005,8 +1005,8 @@ The :mod:`socket` module also offers various network-related services:
10051005
bytes) to its standard, family-specific string representation (for
10061006
example, ``'7.10.0.5'`` or ``'5aef:2b::8'``).
10071007
:func:`inet_ntop` is useful when a library or network protocol returns an
1008-
object of type :c:type:`struct in_addr` (similar to :func:`inet_ntoa`) or
1009-
:c:type:`struct in6_addr`.
1008+
object of type :c:struct:`in_addr` (similar to :func:`inet_ntoa`) or
1009+
:c:struct:`in6_addr`.
10101010

10111011
Supported values for *address_family* are currently :const:`AF_INET` and
10121012
:const:`AF_INET6`. If the bytes object *packed_ip* is not the correct

Doc/whatsnew/3.8.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2012,7 +2012,7 @@ Changes in the Python API
20122012
Changes in the C API
20132013
--------------------
20142014

2015-
* The :c:type:`PyCompilerFlags` structure got a new *cf_feature_version*
2015+
* The :c:struct:`PyCompilerFlags` structure got a new *cf_feature_version*
20162016
field. It should be initialized to ``PY_MINOR_VERSION``. The field is ignored
20172017
by default, and is used if and only if ``PyCF_ONLY_AST`` flag is set in
20182018
*cf_flags*.

0 commit comments

Comments
 (0)