| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8669894 commit fffa6c9
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -162,16 +162,33 @@ The following functions provide locale-independent string to number conversions. | |||
| 162 | 162 | .. versionadded:: 3.1 | |
| 163 | 163 | ||
| 164 | 164 | ||
| 165 | - .. c:function:: int PyOS_stricmp(const char *s1, const char *s2) | ||
| 165 | + .. c:function:: int PyOS_mystricmp(const char *str1, const char *str2) | ||
| 166 | + int PyOS_mystrnicmp(const char *str1, const char *str2, Py_ssize_t size) | ||
| 166 | 167 | ||
| 167 | - Case insensitive comparison of strings. The function works almost | ||
| 168 | - identically to :c:func:`!strcmp` except that it ignores the case. | ||
| 168 | + Case insensitive comparison of strings. These functions work almost | ||
| 169 | + identically to :c:func:`!strcmp` and :c:func:`!strncmp` (respectively), | ||
| 170 | + except that they ignore the case of ASCII characters. | ||
| 169 | 171 | ||
| 172 | + Return ``0`` if the strings are equal, a negative value if *str1* sorts | ||
| 173 | + lexicographically before *str2*, or a positive value if it sorts after. | ||
| 170 | 174 | ||
| 171 | - .. c:function:: int PyOS_strnicmp(const char *s1, const char *s2, Py_ssize_t size) | ||
| 175 | + In the *str1* or *str2* arguments, a NUL byte marks the end of the string. | ||
| 176 | + For :c:func:`!PyOS_mystrnicmp`, the *size* argument gives the maximum size | ||
| 177 | + of the string, as if NUL was present at the index given by *size*. | ||
| 172 | 178 | ||
| 173 | - Case insensitive comparison of strings. The function works almost | ||
| 174 | - identically to :c:func:`!strncmp` except that it ignores the case. | ||
| 179 | + These functions do not use the locale. | ||
| 180 | + | ||
| 181 | + | ||
| 182 | + .. c:function:: int PyOS_stricmp(const char *str1, const char *str2) | ||
| 183 | + int PyOS_strnicmp(const char *str1, const char *str2, Py_ssize_t size) | ||
| 184 | + | ||
| 185 | + Case insensitive comparison of strings. | ||
| 186 | + | ||
| 187 | + On Windows, these are aliases of :c:func:`!stricmp` and :c:func:`!strnicmp`, | ||
| 188 | + respectively. | ||
| 189 | + | ||
| 190 | + On other platforms, they are aliases of :c:func:`PyOS_mystricmp` and | ||
| 191 | + :c:func:`PyOS_mystrnicmp`, respectively. | ||
| 175 | 192 | ||
| 176 | 193 | ||
| 177 | 194 | Character classification and conversion | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3275,8 +3275,8 @@ Types created with :c:func:`PyType_FromSpec` now make any signature in their | |||
| 3275 | 3275 | .. nonce: u6Xfr2 | |
| 3276 | 3276 | .. section: C API | |
| 3277 | 3277 | ||
| 3278 | - Fix bug in PyOS_mystrnicmp and PyOS_mystricmp that incremented pointers | ||
| 3279 | - beyond the end of a string. | ||
| 3278 | + Fix bug in :c:func:`PyOS_mystrnicmp` and :c:func:`PyOS_mystricmp` that | ||
| 3279 | + incremented pointers beyond the end of a string. | ||
| 3280 | 3280 | ||
| 3281 | 3281 | .. | |
| 3282 | 3282 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments