| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 80ab130 commit c679227
39 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,7 +84,7 @@ Dictionary Objects | |||
| 84 | 84 | on failure. | |
| 85 | 85 | ||
| 86 | 86 | ||
| 87 | - .. c:function:: int PyDict_DelItemString(PyObject *p, char *key) | ||
| 87 | + .. c:function:: int PyDict_DelItemString(PyObject *p, const char *key) | ||
| 88 | 88 | ||
| 89 | 89 | Remove the entry in dictionary *p* which has a key specified by the string | |
| 90 | 90 | *key*. Return ``0`` on success or ``-1`` on failure. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,7 +17,7 @@ error reporting in the interpreter; third-party code is advised to access | |||
| 17 | 17 | the :mod:`io` APIs instead. | |
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | - .. c:function:: PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding, char *errors, char *newline, int closefd) | ||
| 20 | + .. c:function:: PyFile_FromFd(int fd, const char *name, const char *mode, int buffering, const char *encoding, const char *errors, const char *newline, int closefd) | ||
| 21 | 21 | ||
| 22 | 22 | Create a Python file object from the file descriptor of an already | |
| 23 | 23 | opened file *fd*. The arguments *name*, *encoding*, *errors* and *newline* | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -118,7 +118,7 @@ Importing Modules | |||
| 118 | 118 | encoded string instead of a Unicode object. | |
| 119 | 119 | ||
| 120 | 120 | ||
| 121 | - .. c:function:: PyObject* PyImport_ExecCodeModule(char *name, PyObject *co) | ||
| 121 | + .. c:function:: PyObject* PyImport_ExecCodeModule(const char *name, PyObject *co) | ||
| 122 | 122 | ||
| 123 | 123 | .. index:: builtin: compile | |
| 124 | 124 | ||
@@ -145,7 +145,7 @@ Importing Modules | |||
| 145 | 145 | :c:func:`PyImport_ExecCodeModuleWithPathnames`. | |
| 146 | 146 | ||
| 147 | 147 | ||
| 148 | - .. c:function:: PyObject* PyImport_ExecCodeModuleEx(char *name, PyObject *co, char *pathname) | ||
| 148 | + .. c:function:: PyObject* PyImport_ExecCodeModuleEx(const char *name, PyObject *co, const char *pathname) | ||
| 149 | 149 | ||
| 150 | 150 | Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute of | |
| 151 | 151 | the module object is set to *pathname* if it is non-``NULL``. | |
@@ -162,7 +162,7 @@ Importing Modules | |||
| 162 | 162 | .. versionadded:: 3.3 | |
| 163 | 163 | ||
| 164 | 164 | ||
| 165 | - .. c:function:: PyObject* PyImport_ExecCodeModuleWithPathnames(char *name, PyObject *co, char *pathname, char *cpathname) | ||
| 165 | + .. c:function:: PyObject* PyImport_ExecCodeModuleWithPathnames(const char *name, PyObject *co, const char *pathname, const char *cpathname) | ||
| 166 | 166 | ||
| 167 | 167 | Like :c:func:`PyImport_ExecCodeModuleObject`, but *name*, *pathname* and | |
| 168 | 168 | *cpathname* are UTF-8 encoded strings. Attempts are also made to figure out | |
@@ -246,7 +246,7 @@ Importing Modules | |||
| 246 | 246 | .. versionadded:: 3.3 | |
| 247 | 247 | ||
| 248 | 248 | ||
| 249 | - .. c:function:: int PyImport_ImportFrozenModule(char *name) | ||
| 249 | + .. c:function:: int PyImport_ImportFrozenModule(const char *name) | ||
| 250 | 250 | ||
| 251 | 251 | Similar to :c:func:`PyImport_ImportFrozenModuleObject`, but the name is a | |
| 252 | 252 | UTF-8 encoded string instead of a Unicode object. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -80,7 +80,7 @@ All integers are implemented as "long" integer objects of arbitrary size. | |||
| 80 | 80 | *NULL* on failure. | |
| 81 | 81 | ||
| 82 | 82 | ||
| 83 | - .. c:function:: PyObject* PyLong_FromString(char *str, char **pend, int base) | ||
| 83 | + .. c:function:: PyObject* PyLong_FromString(const char *str, char **pend, int base) | ||
| 84 | 84 | ||
| 85 | 85 | Return a new :c:type:`PyLongObject` based on the string value in *str*, which | |
| 86 | 86 | is interpreted according to the radix in *base*. If *pend* is non-*NULL*, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,7 @@ Mapping Protocol | |||
| 22 | 22 | expression ``len(o)``. | |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | - .. c:function:: int PyMapping_DelItemString(PyObject *o, char *key) | ||
| 25 | + .. c:function:: int PyMapping_DelItemString(PyObject *o, const char *key) | ||
| 26 | 26 | ||
| 27 | 27 | Remove the mapping for object *key* from the object *o*. Return ``-1`` on | |
| 28 | 28 | failure. This is equivalent to the Python statement ``del o[key]``. | |
@@ -67,13 +67,13 @@ Mapping Protocol | |||
| 67 | 67 | the Python expression ``list(o.items())``. | |
| 68 | 68 | ||
| 69 | 69 | ||
| 70 | - .. c:function:: PyObject* PyMapping_GetItemString(PyObject *o, char *key) | ||
| 70 | + .. c:function:: PyObject* PyMapping_GetItemString(PyObject *o, const char *key) | ||
| 71 | 71 | ||
| 72 | 72 | Return element of *o* corresponding to the object *key* or *NULL* on failure. | |
| 73 | 73 | This is the equivalent of the Python expression ``o[key]``. | |
| 74 | 74 | ||
| 75 | 75 | ||
| 76 | - .. c:function:: int PyMapping_SetItemString(PyObject *o, char *key, PyObject *v) | ||
| 76 | + .. c:function:: int PyMapping_SetItemString(PyObject *o, const char *key, PyObject *v) | ||
| 77 | 77 | ||
| 78 | 78 | Map the object *key* to the value *v* in object *o*. Returns ``-1`` on failure. | |
| 79 | 79 | This is the equivalent of the Python statement ``o[key] = v``. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -155,7 +155,7 @@ the same library that the Python runtime is using. | |||
| 155 | 155 | Python source code. | |
| 156 | 156 | ||
| 157 | 157 | ||
| 158 | - .. c:var:: char* (*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *) | ||
| 158 | + .. c:var:: char* (*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *) | ||
| 159 | 159 | ||
| 160 | 160 | Can be set to point to a function with the prototype | |
| 161 | 161 | ``char *func(FILE *stdin, FILE *stdout, char *prompt)``, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -508,13 +508,13 @@ PyImport_AddModule:const char*:name:: | |||
| 508 | 508 | PyImport_Cleanup:void::: | |
| 509 | 509 | ||
| 510 | 510 | PyImport_ExecCodeModule:PyObject*::+1: | |
| 511 | - PyImport_ExecCodeModule:char*:name:: | ||
| 511 | + PyImport_ExecCodeModule:const char*:name:: | ||
| 512 | 512 | PyImport_ExecCodeModule:PyObject*:co:0: | |
| 513 | 513 | ||
| 514 | 514 | PyImport_ExecCodeModuleEx:PyObject*::+1: | |
| 515 | - PyImport_ExecCodeModuleEx:char*:name:: | ||
| 515 | + PyImport_ExecCodeModuleEx:const char*:name:: | ||
| 516 | 516 | PyImport_ExecCodeModuleEx:PyObject*:co:0: | |
| 517 | - PyImport_ExecCodeModuleEx:char*:pathname:: | ||
| 517 | + PyImport_ExecCodeModuleEx:const char*:pathname:: | ||
| 518 | 518 | ||
| 519 | 519 | PyImport_GetMagicNumber:long::: | |
| 520 | 520 | ||
@@ -524,7 +524,7 @@ PyImport_Import:PyObject*::+1: | |||
| 524 | 524 | PyImport_Import:PyObject*:name:0: | |
| 525 | 525 | ||
| 526 | 526 | PyImport_ImportFrozenModule:int::: | |
| 527 | - PyImport_ImportFrozenModule:char*::: | ||
| 527 | + PyImport_ImportFrozenModule:const char*::: | ||
| 528 | 528 | ||
| 529 | 529 | PyImport_ImportModule:PyObject*::+1: | |
| 530 | 530 | PyImport_ImportModule:const char*:name:: | |
@@ -673,7 +673,7 @@ PyLong_FromUnsignedLongLong:PyObject*::+1: | |||
| 673 | 673 | PyLong_FromUnsignedLongLong:unsigned long long:v:: | |
| 674 | 674 | ||
| 675 | 675 | PyLong_FromString:PyObject*::+1: | |
| 676 | - PyLong_FromString:char*:str:: | ||
| 676 | + PyLong_FromString:const char*:str:: | ||
| 677 | 677 | PyLong_FromString:char**:pend:: | |
| 678 | 678 | PyLong_FromString:int:base:: | |
| 679 | 679 | ||
@@ -701,15 +701,15 @@ PyMapping_DelItemString:const char*:key:: | |||
| 701 | 701 | ||
| 702 | 702 | PyMapping_GetItemString:PyObject*::+1: | |
| 703 | 703 | PyMapping_GetItemString:PyObject*:o:0: | |
| 704 | - PyMapping_GetItemString:char*:key:: | ||
| 704 | + PyMapping_GetItemString:const char*:key:: | ||
| 705 | 705 | ||
| 706 | 706 | PyMapping_HasKey:int::: | |
| 707 | 707 | PyMapping_HasKey:PyObject*:o:0: | |
| 708 | 708 | PyMapping_HasKey:PyObject*:key:: | |
| 709 | 709 | ||
| 710 | 710 | PyMapping_HasKeyString:int::: | |
| 711 | 711 | PyMapping_HasKeyString:PyObject*:o:0: | |
| 712 | - PyMapping_HasKeyString:char*:key:: | ||
| 712 | + PyMapping_HasKeyString:const char*:key:: | ||
| 713 | 713 | ||
| 714 | 714 | PyMapping_Items:PyObject*::+1: | |
| 715 | 715 | PyMapping_Items:PyObject*:o:0: | |
@@ -722,7 +722,7 @@ PyMapping_Length:PyObject*:o:0: | |||
| 722 | 722 | ||
| 723 | 723 | PyMapping_SetItemString:int::: | |
| 724 | 724 | PyMapping_SetItemString:PyObject*:o:0: | |
| 725 | - PyMapping_SetItemString:char*:key:: | ||
| 725 | + PyMapping_SetItemString:const char*:key:: | ||
| 726 | 726 | PyMapping_SetItemString:PyObject*:v:+1: | |
| 727 | 727 | ||
| 728 | 728 | PyMapping_Values:PyObject*::+1: | |
@@ -735,7 +735,7 @@ PyMarshal_ReadObjectFromFile:PyObject*::+1: | |||
| 735 | 735 | PyMarshal_ReadObjectFromFile:FILE*:file:: | |
| 736 | 736 | ||
| 737 | 737 | PyMarshal_ReadObjectFromString:PyObject*::+1: | |
| 738 | - PyMarshal_ReadObjectFromString:char*:string:: | ||
| 738 | + PyMarshal_ReadObjectFromString:const char*:string:: | ||
| 739 | 739 | PyMarshal_ReadObjectFromString:int:len:: | |
| 740 | 740 | ||
| 741 | 741 | PyMarshal_WriteObjectToString:PyObject*::+1: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -144,7 +144,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ | |||
| 144 | 144 | ||
| 145 | 145 | /* Implemented elsewhere: | |
| 146 | 146 | ||
| 147 | - int PyObject_HasAttrString(PyObject *o, char *attr_name); | ||
| 147 | + int PyObject_HasAttrString(PyObject *o, const char *attr_name); | ||
| 148 | 148 | ||
| 149 | 149 | Returns 1 if o has the attribute attr_name, and 0 otherwise. | |
| 150 | 150 | This is equivalent to the Python expression: | |
@@ -156,7 +156,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ | |||
| 156 | 156 | ||
| 157 | 157 | /* Implemented elsewhere: | |
| 158 | 158 | ||
| 159 | - PyObject* PyObject_GetAttrString(PyObject *o, char *attr_name); | ||
| 159 | + PyObject* PyObject_GetAttrString(PyObject *o, const char *attr_name); | ||
| 160 | 160 | ||
| 161 | 161 | Retrieve an attributed named attr_name form object o. | |
| 162 | 162 | Returns the attribute value on success, or NULL on failure. | |
@@ -189,7 +189,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ | |||
| 189 | 189 | ||
| 190 | 190 | /* Implemented elsewhere: | |
| 191 | 191 | ||
| 192 | - int PyObject_SetAttrString(PyObject *o, char *attr_name, PyObject *v); | ||
| 192 | + int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v); | ||
| 193 | 193 | ||
| 194 | 194 | Set the value of the attribute named attr_name, for object o, | |
| 195 | 195 | to the value, v. Returns -1 on failure. This is | |
@@ -209,7 +209,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ | |||
| 209 | 209 | ||
| 210 | 210 | /* implemented as a macro: | |
| 211 | 211 | ||
| 212 | - int PyObject_DelAttrString(PyObject *o, char *attr_name); | ||
| 212 | + int PyObject_DelAttrString(PyObject *o, const char *attr_name); | ||
| 213 | 213 | ||
| 214 | 214 | Delete attribute named attr_name, for object o. Returns | |
| 215 | 215 | -1 on failure. This is the equivalent of the Python | |
@@ -434,7 +434,7 @@ PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t); | |||
| 434 | 434 | statement: o[key]=v. | |
| 435 | 435 | */ | |
| 436 | 436 | ||
| 437 | - PyAPI_FUNC(int) PyObject_DelItemString(PyObject *o, char *key); | ||
| 437 | + PyAPI_FUNC(int) PyObject_DelItemString(PyObject *o, const char *key); | ||
| 438 | 438 | ||
| 439 | 439 | /* | |
| 440 | 440 | Remove the mapping for object, key, from the object *o. | |
@@ -1156,7 +1156,7 @@ PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t); | |||
| 1156 | 1156 | ||
| 1157 | 1157 | /* implemented as a macro: | |
| 1158 | 1158 | ||
| 1159 | - int PyMapping_DelItemString(PyObject *o, char *key); | ||
| 1159 | + int PyMapping_DelItemString(PyObject *o, const char *key); | ||
| 1160 | 1160 | ||
| 1161 | 1161 | Remove the mapping for object, key, from the object *o. | |
| 1162 | 1162 | Returns -1 on failure. This is equivalent to | |
@@ -1174,7 +1174,7 @@ PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t); | |||
| 1174 | 1174 | */ | |
| 1175 | 1175 | #define PyMapping_DelItem(O,K) PyObject_DelItem((O),(K)) | |
| 1176 | 1176 | ||
| 1177 | - PyAPI_FUNC(int) PyMapping_HasKeyString(PyObject *o, char *key); | ||
| 1177 | + PyAPI_FUNC(int) PyMapping_HasKeyString(PyObject *o, const char *key); | ||
| 1178 | 1178 | ||
| 1179 | 1179 | /* | |
| 1180 | 1180 | On success, return 1 if the mapping object has the key, key, | |
@@ -1218,15 +1218,16 @@ PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t); | |||
| 1218 | 1218 | ||
| 1219 | 1219 | */ | |
| 1220 | 1220 | ||
| 1221 | - PyAPI_FUNC(PyObject *) PyMapping_GetItemString(PyObject *o, char *key); | ||
| 1221 | + PyAPI_FUNC(PyObject *) PyMapping_GetItemString(PyObject *o, | ||
| 1222 | + const char *key); | ||
| 1222 | 1223 | ||
| 1223 | 1224 | /* | |
| 1224 | 1225 | Return element of o corresponding to the object, key, or NULL | |
| 1225 | 1226 | on failure. This is the equivalent of the Python expression: | |
| 1226 | 1227 | o[key]. | |
| 1227 | 1228 | */ | |
| 1228 | 1229 | ||
| 1229 | - PyAPI_FUNC(int) PyMapping_SetItemString(PyObject *o, char *key, | ||
| 1230 | + PyAPI_FUNC(int) PyMapping_SetItemString(PyObject *o, const char *key, | ||
| 1230 | 1231 | PyObject *value); | |
| 1231 | 1232 | ||
| 1232 | 1233 | /* | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,8 +8,9 @@ extern "C" { | |||
| 8 | 8 | ||
| 9 | 9 | #define PY_STDIOTEXTMODE "b" | |
| 10 | 10 | ||
| 11 | - PyAPI_FUNC(PyObject *) PyFile_FromFd(int, char *, char *, int, char *, char *, | ||
| 12 | - char *, int); | ||
| 11 | + PyAPI_FUNC(PyObject *) PyFile_FromFd(int, const char *, const char *, int, | ||
| 12 | + const char *, const char *, | ||
| 13 | + const char *, int); | ||
| 13 | 14 | PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int); | |
| 14 | 15 | PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int); | |
| 15 | 16 | PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -69,13 +69,13 @@ typedef struct { | |||
| 69 | 69 | /* FUNCTIONS */ | |
| 70 | 70 | ||
| 71 | 71 | grammar *newgrammar(int start); | |
| 72 | - dfa *adddfa(grammar *g, int type, char *name); | ||
| 72 | + dfa *adddfa(grammar *g, int type, const char *name); | ||
| 73 | 73 | int addstate(dfa *d); | |
| 74 | 74 | void addarc(dfa *d, int from, int to, int lbl); | |
| 75 | 75 | dfa *PyGrammar_FindDFA(grammar *g, int type); | |
| 76 | 76 | ||
| 77 | - int addlabel(labellist *ll, int type, char *str); | ||
| 78 | - int findlabel(labellist *ll, int type, char *str); | ||
| 77 | + int addlabel(labellist *ll, int type, const char *str); | ||
| 78 | + int findlabel(labellist *ll, int type, const char *str); | ||
| 79 | 79 | const char *PyGrammar_LabelRepr(label *lb); | |
| 80 | 80 | void translatelabels(grammar *g); | |
| 81 | 81 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments