@@ -1378,24 +1378,22 @@ it.
13781378The *mode * parameter can be used to specify how the library is loaded. For
13791379details, consult the ``dlopen(3) `` manpage, on Windows, *mode * is ignored.
13801380
1381- The *use_errno * parameter, when set to True, enables a ctypes
1382- mechanism that allows to access the system `errno ` error number in a
1383- safe way. `ctypes ` maintains a thread-local copy of the systems
1384- `errno ` variable; if you call foreign functions created with
1385- `use_errno=True ` then the `errno ` value before the function call is
1386- swapped with the ctypes private copy, the same happens immediately
1387- after the function call.
1388-
1389- The function `ctypes.get_errno() ` returns the value of the ctypes
1390- private copy, and the function `ctypes.set_errno(value) ` changes the
1391- ctypes private copy to `value ` and returns the former value.
1392-
1393- The *use_last_error * parameter, when set to True, enables the same
1394- mechanism for the Windows error code which is managed by the
1395- :func: `GetLastError ` and :func: `SetLastError ` Windows API functions;
1396- `ctypes.get_last_error() ` and `ctypes.set_last_error(value) ` are used
1397- to request and change the ctypes private copy of the windows error
1398- code.
1381+ The *use_errno * parameter, when set to True, enables a ctypes mechanism that
1382+ allows to access the system :data: `errno ` error number in a safe way.
1383+ :mod: `ctypes ` maintains a thread-local copy of the systems :data: `errno `
1384+ variable; if you call foreign functions created with ``use_errno=True `` then the
1385+ :data: `errno ` value before the function call is swapped with the ctypes private
1386+ copy, the same happens immediately after the function call.
1387+
1388+ The function :func: `ctypes.get_errno ` returns the value of the ctypes private
1389+ copy, and the function :func: `ctypes.set_errno ` changes the ctypes private copy
1390+ to a new value and returns the former value.
1391+
1392+ The *use_last_error * parameter, when set to True, enables the same mechanism for
1393+ the Windows error code which is managed by the :func: `GetLastError ` and
1394+ :func: `SetLastError ` Windows API functions; :func: `ctypes.get_last_error ` and
1395+ :func: `ctypes.set_last_error ` are used to request and change the ctypes private
1396+ copy of the windows error code.
13991397
14001398.. versionadded :: 2.6
14011399 The ``use_last_error `` and ``use_errno `` optional parameters
@@ -1602,22 +1600,23 @@ type and the argument types of the function.
16021600.. function :: CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False)
16031601
16041602 The returned function prototype creates functions that use the standard C
1605- calling convention. The function will release the GIL during the call.
1606- If `use_errno ` is set to True, the ctypes private copy of the system `errno `
1607- variable is exchanged with the real `errno ` value bafore and after the call;
1608- `use_last_error ` does the same for the Windows error code.
1603+ calling convention. The function will release the GIL during the call. If
1604+ *use_errno * is set to True, the ctypes private copy of the system
1605+ :data: `errno ` variable is exchanged with the real :data: `errno ` value bafore
1606+ and after the call; *use_last_error * does the same for the Windows error
1607+ code.
16091608
16101609 .. versionchanged :: 2.6
1611- The optional `use_errno ` and `use_last_error ` parameters were
1612- added.
1610+ The optional *use_errno * and *use_last_error * parameters were added.
16131611
16141612
16151613.. function :: WINFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False)
16161614
16171615 Windows only: The returned function prototype creates functions that use the
1618- ``stdcall `` calling convention, except on Windows CE where :func: `WINFUNCTYPE `
1619- is the same as :func: `CFUNCTYPE `. The function will release the GIL during the
1620- call. `use_errno ` and `use_last_error ` have the same meaning as above.
1616+ ``stdcall `` calling convention, except on Windows CE where
1617+ :func: `WINFUNCTYPE ` is the same as :func: `CFUNCTYPE `. The function will
1618+ release the GIL during the call. *use_errno * and *use_last_error * have the
1619+ same meaning as above.
16211620
16221621
16231622.. function :: PYFUNCTYPE(restype, *argtypes)
@@ -1864,10 +1863,10 @@ Utility functions
18641863.. function :: find_library(name)
18651864 :module: ctypes.util
18661865
1867- Try to find a library and return a pathname. ` name ` is the library name without
1868- any prefix like `lib `, suffix like ``.so ``, ``.dylib `` or version number (this
1869- is the form used for the posix linker option :option: `-l `). If no library can
1870- be found, returns ``None ``.
1866+ Try to find a library and return a pathname. * name * is the library name
1867+ without any prefix like `` lib` `` , suffix like ``.so ``, ``.dylib `` or version
1868+ number (this is the form used for the posix linker option :option: `-l `). If
1869+ no library can be found, returns ``None ``.
18711870
18721871 The exact functionality is system dependent.
18731872
@@ -1905,14 +1904,14 @@ Utility functions
19051904.. function :: get_errno()
19061905
19071906 Returns the current value of the ctypes-private copy of the system
1908- `errno ` variable in the calling thread.
1907+ :data: `errno ` variable in the calling thread.
19091908
19101909 .. versionadded :: 2.6
19111910
19121911.. function :: get_last_error()
19131912
19141913 Windows only: returns the current value of the ctypes-private copy of the system
1915- `LastError ` variable in the calling thread.
1914+ :data: `LastError ` variable in the calling thread.
19161915
19171916 .. versionadded :: 2.6
19181917
@@ -1969,17 +1968,16 @@ Utility functions
19691968
19701969.. function :: set_errno(value)
19711970
1972- Set the current value of the ctypes-private copy of the system
1973- `errno ` variable in the calling thread to `value ` and return the
1974- previous value.
1971+ Set the current value of the ctypes-private copy of the system :data: `errno `
1972+ variable in the calling thread to *value * and return the previous value.
19751973
19761974 .. versionadded :: 2.6
19771975
19781976.. function :: set_last_error(value)
19791977
1980- Windows only: set the current value of the ctypes-private copy of
1981- the system `LastError ` variable in the calling thread to ` value `
1982- and return the previous value.
1978+ Windows only: set the current value of the ctypes-private copy of the system
1979+ :data: `LastError ` variable in the calling thread to * value * and return the
1980+ previous value.
19831981
19841982 .. versionadded :: 2.6
19851983
0 commit comments