@@ -1376,24 +1376,22 @@ it.
13761376The *mode * parameter can be used to specify how the library is loaded. For
13771377details, consult the ``dlopen(3) `` manpage, on Windows, *mode * is ignored.
13781378
1379- The *use_errno * parameter, when set to True, enables a ctypes
1380- mechanism that allows to access the system `errno ` error number in a
1381- safe way. `ctypes ` maintains a thread-local copy of the systems
1382- `errno ` variable; if you call foreign functions created with
1383- `use_errno=True ` then the `errno ` value before the function call is
1384- swapped with the ctypes private copy, the same happens immediately
1385- after the function call.
1386-
1387- The function `ctypes.get_errno() ` returns the value of the ctypes
1388- private copy, and the function `ctypes.set_errno(value) ` changes the
1389- ctypes private copy to `value ` and returns the former value.
1390-
1391- The *use_last_error * parameter, when set to True, enables the same
1392- mechanism for the Windows error code which is managed by the
1393- :func: `GetLastError ` and :func: `SetLastError ` Windows API functions;
1394- `ctypes.get_last_error() ` and `ctypes.set_last_error(value) ` are used
1395- to request and change the ctypes private copy of the windows error
1396- code.
1379+ The *use_errno * parameter, when set to True, enables a ctypes mechanism that
1380+ allows to access the system :data: `errno ` error number in a safe way.
1381+ :mod: `ctypes ` maintains a thread-local copy of the systems :data: `errno `
1382+ variable; if you call foreign functions created with ``use_errno=True `` then the
1383+ :data: `errno ` value before the function call is swapped with the ctypes private
1384+ copy, the same happens immediately after the function call.
1385+
1386+ The function :func: `ctypes.get_errno ` returns the value of the ctypes private
1387+ copy, and the function :func: `ctypes.set_errno ` changes the ctypes private copy
1388+ to a new value and returns the former value.
1389+
1390+ The *use_last_error * parameter, when set to True, enables the same mechanism for
1391+ the Windows error code which is managed by the :func: `GetLastError ` and
1392+ :func: `SetLastError ` Windows API functions; :func: `ctypes.get_last_error ` and
1393+ :func: `ctypes.set_last_error ` are used to request and change the ctypes private
1394+ copy of the windows error code.
13971395
13981396.. data :: RTLD_GLOBAL
13991397 :noindex:
@@ -1596,18 +1594,20 @@ type and the argument types of the function.
15961594.. function :: CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False)
15971595
15981596 The returned function prototype creates functions that use the standard C
1599- calling convention. The function will release the GIL during the call.
1600- If `use_errno ` is set to True, the ctypes private copy of the system `errno `
1601- variable is exchanged with the real `errno ` value bafore and after the call;
1602- `use_last_error ` does the same for the Windows error code.
1597+ calling convention. The function will release the GIL during the call. If
1598+ *use_errno * is set to True, the ctypes private copy of the system
1599+ :data: `errno ` variable is exchanged with the real :data: `errno ` value bafore
1600+ and after the call; *use_last_error * does the same for the Windows error
1601+ code.
16031602
16041603
16051604.. function :: WINFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False)
16061605
16071606 Windows only: The returned function prototype creates functions that use the
1608- ``stdcall `` calling convention, except on Windows CE where :func: `WINFUNCTYPE `
1609- is the same as :func: `CFUNCTYPE `. The function will release the GIL during the
1610- call. `use_errno ` and `use_last_error ` have the same meaning as above.
1607+ ``stdcall `` calling convention, except on Windows CE where
1608+ :func: `WINFUNCTYPE ` is the same as :func: `CFUNCTYPE `. The function will
1609+ release the GIL during the call. *use_errno * and *use_last_error * have the
1610+ same meaning as above.
16111611
16121612
16131613.. function :: PYFUNCTYPE(restype, *argtypes)
@@ -1852,10 +1852,10 @@ Utility functions
18521852.. function :: find_library(name)
18531853 :module: ctypes.util
18541854
1855- Try to find a library and return a pathname. ` name ` is the library name without
1856- any prefix like `lib `, suffix like ``.so ``, ``.dylib `` or version number (this
1857- is the form used for the posix linker option :option: `-l `). If no library can
1858- be found, returns ``None ``.
1855+ Try to find a library and return a pathname. * name * is the library name
1856+ without any prefix like `` lib` `` , suffix like ``.so ``, ``.dylib `` or version
1857+ number (this is the form used for the posix linker option :option: `-l `). If
1858+ no library can be found, returns ``None ``.
18591859
18601860 The exact functionality is system dependent.
18611861
@@ -1887,12 +1887,12 @@ Utility functions
18871887.. function :: get_errno()
18881888
18891889 Returns the current value of the ctypes-private copy of the system
1890- `errno ` variable in the calling thread.
1890+ :data: `errno ` variable in the calling thread.
18911891
18921892.. function :: get_last_error()
18931893
18941894 Windows only: returns the current value of the ctypes-private copy of the system
1895- `LastError ` variable in the calling thread.
1895+ :data: `LastError ` variable in the calling thread.
18961896
18971897.. function :: memmove(dst, src, count)
18981898
@@ -1947,15 +1947,14 @@ Utility functions
19471947
19481948.. function :: set_errno(value)
19491949
1950- Set the current value of the ctypes-private copy of the system
1951- `errno ` variable in the calling thread to `value ` and return the
1952- previous value.
1950+ Set the current value of the ctypes-private copy of the system :data: `errno `
1951+ variable in the calling thread to *value * and return the previous value.
19531952
19541953.. function :: set_last_error(value)
19551954
1956- Windows only: set the current value of the ctypes-private copy of
1957- the system `LastError ` variable in the calling thread to ` value `
1958- and return the previous value.
1955+ Windows only: set the current value of the ctypes-private copy of the system
1956+ :data: `LastError ` variable in the calling thread to * value * and return the
1957+ previous value.
19591958
19601959.. function :: sizeof(obj_or_type)
19611960
0 commit comments