summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorAdam Turner <9087854+AA-Turner@users.noreply.github.com>2022-10-04 23:26:14 (GMT)
committerGitHub <noreply@github.com>2022-10-04 23:26:14 (GMT)
commita0f5599aac2037da715d09733e0a83a9cba7c37a (patch)
treecc5a1fc351eadd5f47bf1b52ee8ba9ff355f8f7f /Doc/library
parentfa59bda8d30ea0b6c19007205b57c800c944304c (diff)
downloadcpython-a0f5599aac2037da715d09733e0a83a9cba7c37a.zip
cpython-a0f5599aac2037da715d09733e0a83a9cba7c37a.tar.gz
cpython-a0f5599aac2037da715d09733e0a83a9cba7c37a.tar.bz2
gh-93738: Documentation C syntax (Use `c:struct`) (#97772)
Use `c:struct`
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/ctypes.rst4
-rw-r--r--Doc/library/socket.rst12
2 files changed, 8 insertions, 8 deletions
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
index 685ff83..d4c52a2 100644
--- a/Doc/library/ctypes.rst
+++ b/Doc/library/ctypes.rst
@@ -1088,7 +1088,7 @@ An extended example which also demonstrates the use of pointers accesses the
Quoting the docs for that value:
- This pointer is initialized to point to an array of :c:type:`struct _frozen`
+ This pointer is initialized to point to an array of :c:struct:`_frozen`
records, terminated by one whose members are all ``NULL`` or zero. When a frozen
module is imported, it is searched in this table. Third-party code could play
tricks with this to provide a dynamically created collection of frozen modules.
@@ -1107,7 +1107,7 @@ size, we show only how this table can be read with :mod:`ctypes`::
...
>>>
-We have defined the :c:type:`struct _frozen` data type, so we can get the pointer
+We have defined the :c:struct:`_frozen` data type, so we can get the pointer
to the table::
>>> FrozenTable = POINTER(struct_frozen)
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index f97c4f6..1a9e5fe 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -1059,7 +1059,7 @@ The :mod:`socket` module also offers various network-related services:
Convert an IPv4 address from dotted-quad string format (for example,
'123.45.67.89') to 32-bit packed binary format, as a bytes object four characters in
length. This is useful when conversing with a program that uses the standard C
- library and needs objects of type :c:type:`struct in_addr`, which is the C type
+ library and needs objects of type :c:struct:`in_addr`, which is the C type
for the 32-bit packed binary this function returns.
:func:`inet_aton` also accepts strings with less than three dots; see the
@@ -1078,7 +1078,7 @@ The :mod:`socket` module also offers various network-related services:
Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four
bytes in length) to its standard dotted-quad string representation (for example,
'123.45.67.89'). This is useful when conversing with a program that uses the
- standard C library and needs objects of type :c:type:`struct in_addr`, which
+ standard C library and needs objects of type :c:struct:`in_addr`, which
is the C type for the 32-bit packed binary data this function takes as an
argument.
@@ -1095,8 +1095,8 @@ The :mod:`socket` module also offers various network-related services:
Convert an IP address from its family-specific string format to a packed,
binary format. :func:`inet_pton` is useful when a library or network protocol
- calls for an object of type :c:type:`struct in_addr` (similar to
- :func:`inet_aton`) or :c:type:`struct in6_addr`.
+ calls for an object of type :c:struct:`in_addr` (similar to
+ :func:`inet_aton`) or :c:struct:`in6_addr`.
Supported values for *address_family* are currently :const:`AF_INET` and
:const:`AF_INET6`. If the IP address string *ip_string* is invalid,
@@ -1116,8 +1116,8 @@ The :mod:`socket` module also offers various network-related services:
bytes) to its standard, family-specific string representation (for
example, ``'7.10.0.5'`` or ``'5aef:2b::8'``).
:func:`inet_ntop` is useful when a library or network protocol returns an
- object of type :c:type:`struct in_addr` (similar to :func:`inet_ntoa`) or
- :c:type:`struct in6_addr`.
+ object of type :c:struct:`in_addr` (similar to :func:`inet_ntoa`) or
+ :c:struct:`in6_addr`.
Supported values for *address_family* are currently :const:`AF_INET` and
:const:`AF_INET6`. If the bytes object *packed_ip* is not the correct