| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -119,13 +119,13 @@ The following functions provide locale-independent string to number conversions. | |||
| 119 | 119 | .. versionadded:: 3.1 | |
| 120 | 120 | ||
| 121 | 121 | ||
| 122 | - .. c:function:: int PyOS_stricmp(char *s1, char *s2) | ||
| 122 | + .. c:function:: int PyOS_stricmp(const char *s1, const char *s2) | ||
| 123 | 123 | ||
| 124 | 124 | Case insensitive comparison of strings. The function works almost | |
| 125 | 125 | identically to :c:func:`strcmp` except that it ignores the case. | |
| 126 | 126 | ||
| 127 | 127 | ||
| 128 | - .. c:function:: int PyOS_strnicmp(char *s1, char *s2, Py_ssize_t size) | ||
| 128 | + .. c:function:: int PyOS_strnicmp(const char *s1, const char *s2, Py_ssize_t size) | ||
| 129 | 129 | ||
| 130 | 130 | Case insensitive comparison of strings. The function works almost | |
| 131 | 131 | identically to :c:func:`strncmp` except that it ignores the case. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -244,15 +244,15 @@ NULL pointer for use in a ``return`` statement. | |||
| 244 | 244 | .. versionadded:: 3.4 | |
| 245 | 245 | ||
| 246 | 246 | ||
| 247 | - .. c:function:: void PyErr_SyntaxLocationEx(char *filename, int lineno, int col_offset) | ||
| 247 | + .. c:function:: void PyErr_SyntaxLocationEx(const char *filename, int lineno, int col_offset) | ||
| 248 | 248 | ||
| 249 | 249 | Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string | |
| 250 | 250 | decoded from the filesystem encoding (:func:`os.fsdecode`). | |
| 251 | 251 | ||
| 252 | 252 | .. versionadded:: 3.2 | |
| 253 | 253 | ||
| 254 | 254 | ||
| 255 | - .. c:function:: void PyErr_SyntaxLocation(char *filename, int lineno) | ||
| 255 | + .. c:function:: void PyErr_SyntaxLocation(const char *filename, int lineno) | ||
| 256 | 256 | ||
| 257 | 257 | Like :c:func:`PyErr_SyntaxLocationEx`, but the col_offset parameter is | |
| 258 | 258 | omitted. | |
@@ -516,7 +516,7 @@ Signal Handling | |||
| 516 | 516 | Exception Classes | |
| 517 | 517 | ================= | |
| 518 | 518 | ||
| 519 | - .. c:function:: PyObject* PyErr_NewException(char *name, PyObject *base, PyObject *dict) | ||
| 519 | + .. c:function:: PyObject* PyErr_NewException(const char *name, PyObject *base, PyObject *dict) | ||
| 520 | 520 | ||
| 521 | 521 | This utility function creates and returns a new exception class. The *name* | |
| 522 | 522 | argument must be the name of the new exception, a C string of the form | |
@@ -531,7 +531,7 @@ Exception Classes | |||
| 531 | 531 | argument can be used to specify a dictionary of class variables and methods. | |
| 532 | 532 | ||
| 533 | 533 | ||
| 534 | - .. c:function:: PyObject* PyErr_NewExceptionWithDoc(char *name, char *doc, PyObject *base, PyObject *dict) | ||
| 534 | + .. c:function:: PyObject* PyErr_NewExceptionWithDoc(const char *name, const char *doc, PyObject *base, PyObject *dict) | ||
| 535 | 535 | ||
| 536 | 536 | Same as :c:func:`PyErr_NewException`, except that the new exception class can | |
| 537 | 537 | easily be given a docstring: If *doc* is non-*NULL*, it will be used as the | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,7 +39,7 @@ Importing Modules | |||
| 39 | 39 | behaviour isn't needed anymore. | |
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | - .. c:function:: PyObject* PyImport_ImportModuleEx(char *name, PyObject *globals, PyObject *locals, PyObject *fromlist) | ||
| 42 | + .. c:function:: PyObject* PyImport_ImportModuleEx(const char *name, PyObject *globals, PyObject *locals, PyObject *fromlist) | ||
| 43 | 43 | ||
| 44 | 44 | .. index:: builtin: __import__ | |
| 45 | 45 | ||
@@ -70,7 +70,7 @@ Importing Modules | |||
| 70 | 70 | .. versionadded:: 3.3 | |
| 71 | 71 | ||
| 72 | 72 | ||
| 73 | - .. c:function:: PyObject* PyImport_ImportModuleLevel(char *name, PyObject *globals, PyObject *locals, PyObject *fromlist, int level) | ||
| 73 | + .. c:function:: PyObject* PyImport_ImportModuleLevel(const char *name, PyObject *globals, PyObject *locals, PyObject *fromlist, int level) | ||
| 74 | 74 | ||
| 75 | 75 | Similar to :c:func:`PyImport_ImportModuleLevelObject`, but the name is an | |
| 76 | 76 | UTF-8 encoded string instead of a Unicode object. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -86,7 +86,7 @@ Process-wide parameters | |||
| 86 | 86 | ======================= | |
| 87 | 87 | ||
| 88 | 88 | ||
| 89 | - .. c:function:: int Py_SetStandardStreamEncoding(char *encoding, char *errors) | ||
| 89 | + .. c:function:: int Py_SetStandardStreamEncoding(const char *encoding, const char *errors) | ||
| 90 | 90 | ||
| 91 | 91 | .. index:: | |
| 92 | 92 | single: Py_Initialize() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,7 +34,7 @@ Mapping Protocol | |||
| 34 | 34 | failure. This is equivalent to the Python statement ``del o[key]``. | |
| 35 | 35 | ||
| 36 | 36 | ||
| 37 | - .. c:function:: int PyMapping_HasKeyString(PyObject *o, char *key) | ||
| 37 | + .. c:function:: int PyMapping_HasKeyString(PyObject *o, const char *key) | ||
| 38 | 38 | ||
| 39 | 39 | On success, return ``1`` if the mapping object has the key *key* and ``0`` | |
| 40 | 40 | otherwise. This is equivalent to the Python expression ``key in o``. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -88,7 +88,7 @@ written using these routines? | |||
| 88 | 88 | :exc:`TypeError`) and returns *NULL*. | |
| 89 | 89 | ||
| 90 | 90 | ||
| 91 | - .. c:function:: PyObject* PyMarshal_ReadObjectFromString(char *string, Py_ssize_t len) | ||
| 91 | + .. c:function:: PyObject* PyMarshal_ReadObjectFromString(const char *string, Py_ssize_t len) | ||
| 92 | 92 | ||
| 93 | 93 | Return a Python object from the data stream in a character buffer | |
| 94 | 94 | containing *len* bytes pointed to by *string*. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -110,12 +110,12 @@ These are utility functions that make functionality from the :mod:`sys` module | |||
| 110 | 110 | accessible to C code. They all work with the current interpreter thread's | |
| 111 | 111 | :mod:`sys` module's dict, which is contained in the internal thread state structure. | |
| 112 | 112 | ||
| 113 | - .. c:function:: PyObject *PySys_GetObject(char *name) | ||
| 113 | + .. c:function:: PyObject *PySys_GetObject(const char *name) | ||
| 114 | 114 | ||
| 115 | 115 | Return the object *name* from the :mod:`sys` module or *NULL* if it does | |
| 116 | 116 | not exist, without setting an exception. | |
| 117 | 117 | ||
| 118 | - .. c:function:: int PySys_SetObject(char *name, PyObject *v) | ||
| 118 | + .. c:function:: int PySys_SetObject(const char *name, PyObject *v) | ||
| 119 | 119 | ||
| 120 | 120 | Set *name* in the :mod:`sys` module to *v* unless *v* is *NULL*, in which | |
| 121 | 121 | case *name* is deleted from the sys module. Returns ``0`` on success, ``-1`` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1635,7 +1635,7 @@ They all return *NULL* or ``-1`` if an exception occurs. | |||
| 1635 | 1635 | respectively. | |
| 1636 | 1636 | ||
| 1637 | 1637 | ||
| 1638 | - .. c:function:: int PyUnicode_CompareWithASCIIString(PyObject *uni, char *string) | ||
| 1638 | + .. c:function:: int PyUnicode_CompareWithASCIIString(PyObject *uni, const char *string) | ||
| 1639 | 1639 | ||
| 1640 | 1640 | Compare a unicode object, *uni*, with *string* and return -1, 0, 1 for less | |
| 1641 | 1641 | than, equal, and greater than, respectively. It is best to pass only | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -600,7 +600,7 @@ Extracting Parameters in Extension Functions | |||
| 600 | 600 | ||
| 601 | 601 | The :c:func:`PyArg_ParseTuple` function is declared as follows:: | |
| 602 | 602 | ||
| 603 | - int PyArg_ParseTuple(PyObject *arg, char *format, ...); | ||
| 603 | + int PyArg_ParseTuple(PyObject *arg, const char *format, ...); | ||
| 604 | 604 | ||
| 605 | 605 | The *arg* argument must be a tuple object containing an argument list passed | |
| 606 | 606 | from Python to a C function. The *format* argument must be a format string, | |
@@ -693,7 +693,7 @@ Keyword Parameters for Extension Functions | |||
| 693 | 693 | The :c:func:`PyArg_ParseTupleAndKeywords` function is declared as follows:: | |
| 694 | 694 | ||
| 695 | 695 | int PyArg_ParseTupleAndKeywords(PyObject *arg, PyObject *kwdict, | |
| 696 | - char *format, char *kwlist[], ...); | ||
| 696 | + const char *format, char *kwlist[], ...); | ||
| 697 | 697 | ||
| 698 | 698 | The *arg* and *format* parameters are identical to those of the | |
| 699 | 699 | :c:func:`PyArg_ParseTuple` function. The *kwdict* parameter is the dictionary of | |
@@ -770,7 +770,7 @@ Building Arbitrary Values | |||
| 770 | 770 | This function is the counterpart to :c:func:`PyArg_ParseTuple`. It is declared | |
| 771 | 771 | as follows:: | |
| 772 | 772 | ||
| 773 | - PyObject *Py_BuildValue(char *format, ...); | ||
| 773 | + PyObject *Py_BuildValue(const char *format, ...); | ||
| 774 | 774 | ||
| 775 | 775 | It recognizes a set of format units similar to the ones recognized by | |
| 776 | 776 | :c:func:`PyArg_ParseTuple`, but the arguments (which are input to the function, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -115,8 +115,8 @@ call, a format string like that used with :c:func:`Py_BuildValue`, and the | |||
| 115 | 115 | argument values:: | |
| 116 | 116 | ||
| 117 | 117 | PyObject * | |
| 118 | - PyObject_CallMethod(PyObject *object, char *method_name, | ||
| 119 | - char *arg_format, ...); | ||
| 118 | + PyObject_CallMethod(PyObject *object, const char *method_name, | ||
| 119 | + const char *arg_format, ...); | ||
| 120 | 120 | ||
| 121 | 121 | This works for any object that has methods -- whether built-in or user-defined. | |
| 122 | 122 | You are responsible for eventually :c:func:`Py_DECREF`\ 'ing the return value. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments