| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1072,6 +1072,15 @@ They all return *NULL* or ``-1`` if an exception occurs. | |||
| 1072 | 1072 | occurred and an exception has been set. | |
| 1073 | 1073 | ||
| 1074 | 1074 | ||
| 1075 | + .. c:function:: Py_ssize_t PyUnicode_FindChar(PyObject *str, Py_UCS4 ch, Py_ssize_t start, Py_ssize_t end, int direction) | ||
| 1076 | + | ||
| 1077 | + Return the first position of the character *ch* in ``str[start:end]`` using | ||
| 1078 | + the given *direction* (*direction* == 1 means to do a forward search, | ||
| 1079 | + *direction* == -1 a backward search). The return value is the index of the | ||
| 1080 | + first match; a value of ``-1`` indicates that no match was found, and ``-2`` | ||
| 1081 | + indicates that an error occurred and an exception has been set. | ||
| 1082 | + | ||
| 1083 | + | ||
| 1075 | 1084 | .. c:function:: Py_ssize_t PyUnicode_Count(PyObject *str, PyObject *substr, Py_ssize_t start, Py_ssize_t end) | |
| 1076 | 1085 | ||
| 1077 | 1086 | Return the number of non-overlapping occurrences of *substr* in | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -160,4 +160,9 @@ PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name); | |||
| 160 | 160 | #define PyDoc_STR(str) "" | |
| 161 | 161 | #endif | |
| 162 | 162 | ||
| 163 | + #define PY_ARRAY_LENGTH(array) (sizeof(array) / sizeof((array)[0])) | ||
| 164 | + | ||
| 165 | + #define PY_MIN(x, y) (((x) > (y)) ? (y) : (x)) | ||
| 166 | + #define PY_MAX(x, y) (((x) > (y)) ? (x) : (y)) | ||
| 167 | + | ||
| 163 | 168 | #endif /* !Py_PYTHON_H */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -64,8 +64,9 @@ PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op); | |||
| 64 | 64 | (Advanced String Formatting). */ | |
| 65 | 65 | #ifndef Py_LIMITED_API | |
| 66 | 66 | PyAPI_FUNC(PyObject *) _PyComplex_FormatAdvanced(PyObject *obj, | |
| 67 | - Py_UNICODE *format_spec, | ||
| 68 | - Py_ssize_t format_spec_len); | ||
| 67 | + PyObject *format_spec, | ||
| 68 | + Py_ssize_t start, | ||
| 69 | + Py_ssize_t end); | ||
| 69 | 70 | #endif | |
| 70 | 71 | ||
| 71 | 72 | #ifdef __cplusplus | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -113,8 +113,9 @@ PyAPI_FUNC(int) PyFloat_ClearFreeList(void); | |||
| 113 | 113 | /* Format the object based on the format_spec, as defined in PEP 3101 | |
| 114 | 114 | (Advanced String Formatting). */ | |
| 115 | 115 | PyAPI_FUNC(PyObject *) _PyFloat_FormatAdvanced(PyObject *obj, | |
| 116 | - Py_UNICODE *format_spec, | ||
| 117 | - Py_ssize_t format_spec_len); | ||
| 116 | + PyObject *format_spec, | ||
| 117 | + Py_ssize_t start, | ||
| 118 | + Py_ssize_t end); | ||
| 118 | 119 | #endif /* Py_LIMITED_API */ | |
| 119 | 120 | ||
| 120 | 121 | #ifdef __cplusplus | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -80,6 +80,7 @@ PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLongAndOverflow(PyObject *, int *); | |||
| 80 | 80 | PyAPI_FUNC(PyObject *) PyLong_FromString(char *, char **, int); | |
| 81 | 81 | #ifndef Py_LIMITED_API | |
| 82 | 82 | PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int); | |
| 83 | + PyAPI_FUNC(PyObject *) PyLong_FromUnicodeObject(PyObject *u, int base); | ||
| 83 | 84 | #endif | |
| 84 | 85 | ||
| 85 | 86 | #ifndef Py_LIMITED_API | |
@@ -155,8 +156,9 @@ PyAPI_FUNC(PyObject *) _PyLong_Format(PyObject *aa, int base); | |||
| 155 | 156 | /* Format the object based on the format_spec, as defined in PEP 3101 | |
| 156 | 157 | (Advanced String Formatting). */ | |
| 157 | 158 | PyAPI_FUNC(PyObject *) _PyLong_FormatAdvanced(PyObject *obj, | |
| 158 | - Py_UNICODE *format_spec, | ||
| 159 | - Py_ssize_t format_spec_len); | ||
| 159 | + PyObject *format_spec, | ||
| 160 | + Py_ssize_t start, | ||
| 161 | + Py_ssize_t end); | ||
| 160 | 162 | #endif /* Py_LIMITED_API */ | |
| 161 | 163 | ||
| 162 | 164 | /* These aren't really part of the long object, but they're handy. The | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -301,6 +301,12 @@ PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create( | |||
| 301 | 301 | Py_ssize_t end, | |
| 302 | 302 | const char *reason /* UTF-8 encoded string */ | |
| 303 | 303 | ); | |
| 304 | + PyAPI_FUNC(PyObject *) _PyUnicodeTranslateError_Create( | ||
| 305 | + PyObject *object, | ||
| 306 | + Py_ssize_t start, | ||
| 307 | + Py_ssize_t end, | ||
| 308 | + const char *reason /* UTF-8 encoded string */ | ||
| 309 | + ); | ||
| 304 | 310 | #endif | |
| 305 | 311 | ||
| 306 | 312 | /* get the encoding attribute */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -286,12 +286,15 @@ typedef size_t Py_uhash_t; | |||
| 286 | 286 | /* fastest possible local call under MSVC */ | |
| 287 | 287 | #define Py_LOCAL(type) static type __fastcall | |
| 288 | 288 | #define Py_LOCAL_INLINE(type) static __inline type __fastcall | |
| 289 | + #define Py_LOCAL_CALLBACK(name) (__fastcall *name) | ||
| 289 | 290 | #elif defined(USE_INLINE) | |
| 290 | 291 | #define Py_LOCAL(type) static type | |
| 291 | 292 | #define Py_LOCAL_INLINE(type) static inline type | |
| 293 | + #define Py_LOCAL_CALLBACK(name) (*name) | ||
| 292 | 294 | #else | |
| 293 | 295 | #define Py_LOCAL(type) static type | |
| 294 | 296 | #define Py_LOCAL_INLINE(type) static type | |
| 297 | + #define Py_LOCAL_CALLBACK(name) (*name) | ||
| 295 | 298 | #endif | |
| 296 | 299 | ||
| 297 | 300 | /* Py_MEMCPY can be used instead of memcpy in cases where the copied blocks | |
| Back | FazBrowse Home | New Git URL |
0 commit comments