#define STRINGLIB_FASTSEARCH_H
#define FAST_COUNT …
#define FAST_SEARCH …
#define FAST_RSEARCH …
#if LONG_BIT >= 128
#define STRINGLIB_BLOOM_WIDTH …
#elif LONG_BIT >= 64
#define STRINGLIB_BLOOM_WIDTH …
#elif LONG_BIT >= 32
#define STRINGLIB_BLOOM_WIDTH …
#else
#error "LONG_BIT is smaller than 32"
#endif
#define STRINGLIB_BLOOM_ADD(mask, ch) …
#define STRINGLIB_BLOOM(mask, ch) …
#ifdef STRINGLIB_FAST_MEMCHR
#define MEMCHR_CUT_OFF …
#else
#define MEMCHR_CUT_OFF …
#endif
Py_LOCAL_INLINE(Py_ssize_t)
STRINGLIB(find_char)(const STRINGLIB_CHAR* s, Py_ssize_t n, STRINGLIB_CHAR ch)
{ … }
#undef MEMCHR_CUT_OFF
#if STRINGLIB_SIZEOF_CHAR == 1
#define MEMRCHR_CUT_OFF …
#else
#define MEMRCHR_CUT_OFF …
#endif
Py_LOCAL_INLINE(Py_ssize_t)
STRINGLIB(rfind_char)(const STRINGLIB_CHAR* s, Py_ssize_t n, STRINGLIB_CHAR ch)
{ … }
#undef MEMRCHR_CUT_OFF
#if 0 && STRINGLIB_SIZEOF_CHAR == 1
#define LOG …
#define LOG_STRING …
#define LOG_LINEUP …
#else
#define LOG …
#define LOG_STRING …
#define LOG_LINEUP …
#endif
Py_LOCAL_INLINE(Py_ssize_t)
STRINGLIB(_lex_search)(const STRINGLIB_CHAR *needle, Py_ssize_t len_needle,
Py_ssize_t *return_period, int invert_alphabet)
{ … }
Py_LOCAL_INLINE(Py_ssize_t)
STRINGLIB(_factorize)(const STRINGLIB_CHAR *needle,
Py_ssize_t len_needle,
Py_ssize_t *return_period)
{ … }
#define SHIFT_TYPE …
#define MAX_SHIFT …
#define TABLE_SIZE_BITS …
#define TABLE_SIZE …
#define TABLE_MASK …
stringlib_prework;
static void
STRINGLIB(_preprocess)(const STRINGLIB_CHAR *needle, Py_ssize_t len_needle,
STRINGLIB(prework) *p)
{ … }
static Py_ssize_t
STRINGLIB(_two_way)(const STRINGLIB_CHAR *haystack, Py_ssize_t len_haystack,
STRINGLIB(prework) *p)
{ … }
static Py_ssize_t
STRINGLIB(_two_way_find)(const STRINGLIB_CHAR *haystack,
Py_ssize_t len_haystack,
const STRINGLIB_CHAR *needle,
Py_ssize_t len_needle)
{ … }
static Py_ssize_t
STRINGLIB(_two_way_count)(const STRINGLIB_CHAR *haystack,
Py_ssize_t len_haystack,
const STRINGLIB_CHAR *needle,
Py_ssize_t len_needle,
Py_ssize_t maxcount)
{ … }
#undef SHIFT_TYPE
#undef NOT_FOUND
#undef SHIFT_OVERFLOW
#undef TABLE_SIZE_BITS
#undef TABLE_SIZE
#undef TABLE_MASK
#undef LOG
#undef LOG_STRING
#undef LOG_LINEUP
static inline Py_ssize_t
STRINGLIB(default_find)(const STRINGLIB_CHAR* s, Py_ssize_t n,
const STRINGLIB_CHAR* p, Py_ssize_t m,
Py_ssize_t maxcount, int mode)
{ … }
static Py_ssize_t
STRINGLIB(adaptive_find)(const STRINGLIB_CHAR* s, Py_ssize_t n,
const STRINGLIB_CHAR* p, Py_ssize_t m,
Py_ssize_t maxcount, int mode)
{ … }
static Py_ssize_t
STRINGLIB(default_rfind)(const STRINGLIB_CHAR* s, Py_ssize_t n,
const STRINGLIB_CHAR* p, Py_ssize_t m,
Py_ssize_t maxcount, int mode)
{ … }
static inline Py_ssize_t
STRINGLIB(count_char)(const STRINGLIB_CHAR *s, Py_ssize_t n,
const STRINGLIB_CHAR p0, Py_ssize_t maxcount)
{ … }
static inline Py_ssize_t
STRINGLIB(count_char_no_maxcount)(const STRINGLIB_CHAR *s, Py_ssize_t n,
const STRINGLIB_CHAR p0)
{ … }
Py_LOCAL_INLINE(Py_ssize_t)
FASTSEARCH(const STRINGLIB_CHAR* s, Py_ssize_t n,
const STRINGLIB_CHAR* p, Py_ssize_t m,
Py_ssize_t maxcount, int mode)
{ … }