@@ -162,16 +162,33 @@ The following functions provide locale-independent string to number conversions.
162162 .. versionadded :: 3.1
163163
164164
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)
166167
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.
169171
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.
170174
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*.
172178
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.
175192
176193
177194Character classification and conversion
0 commit comments