void *str,
const void *bytes,
Py_ssize_t size);
-
-/* Substring Search.
-
- Returns the index of the first occurence of
- a substring ("needle") in a larger text ("haystack").
- If the needle is not found, return -1.
- If the needle is found, add offset to the index.
-*/
-
-PyAPI_FUNC(Py_ssize_t)
-_PyBytes_Find(const char *haystack, Py_ssize_t len_haystack,
- const char *needle, Py_ssize_t len_needle,
- Py_ssize_t offset);
-
-/* Same as above, but search right-to-left */
-PyAPI_FUNC(Py_ssize_t)
-_PyBytes_ReverseFind(const char *haystack, Py_ssize_t len_haystack,
- const char *needle, Py_ssize_t len_needle,
- Py_ssize_t offset);
extern PyStatus _PyBytes_InitTypes(PyInterpreterState *);
+/* Substring Search.
+
+ Returns the index of the first occurence of
+ a substring ("needle") in a larger text ("haystack").
+ If the needle is not found, return -1.
+ If the needle is found, add offset to the index.
+*/
+
+PyAPI_FUNC(Py_ssize_t)
+_PyBytes_Find(const char *haystack, Py_ssize_t len_haystack,
+ const char *needle, Py_ssize_t len_needle,
+ Py_ssize_t offset);
+
+/* Same as above, but search right-to-left */
+PyAPI_FUNC(Py_ssize_t)
+_PyBytes_ReverseFind(const char *haystack, Py_ssize_t len_haystack,
+ const char *needle, Py_ssize_t len_needle,
+ Py_ssize_t offset);
+
#ifdef __cplusplus
}
#endif
#define PY_SSIZE_T_CLEAN
#include <Python.h>
+#include "pycore_bytesobject.h" // _PyBytes_Find()
#include "pycore_fileutils.h" // _Py_stat_struct
#include "structmember.h" // PyMemberDef
#include <stddef.h> // offsetof()
#include "Python.h"
#include "pycore_abstract.h" // _PyIndex_Check()
+#include "pycore_bytesobject.h" // _PyBytes_Find()
#include "pycore_bytes_methods.h" // _Py_bytes_startswith()
#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_format.h" // F_LJUST