needforspeed: stringlib refactoring, continued. added count and

find helpers; updated unicodeobject to use stringlib_count
This commit is contained in:
Fredrik Lundh 2006-05-26 19:24:53 +00:00
parent a26de2a80f
commit 58b5e84d52
5 changed files with 136 additions and 57 deletions

View file

@ -3,9 +3,15 @@
#ifndef STRINGLIB_PARTITION_H
#define STRINGLIB_PARTITION_H
#ifndef STRINGLIB_FASTSEARCH_H
#error must include "stringlib/fastsearch.h" before including this module
#endif
Py_LOCAL(PyObject*)
partition(PyObject* str_obj, const STRINGLIB_CHAR* str, Py_ssize_t str_len,
PyObject* sep_obj, const STRINGLIB_CHAR* sep, Py_ssize_t sep_len)
stringlib_partition(
PyObject* str_obj, const STRINGLIB_CHAR* str, Py_ssize_t str_len,
PyObject* sep_obj, const STRINGLIB_CHAR* sep, Py_ssize_t sep_len
)
{
PyObject* out;
Py_ssize_t pos;
@ -46,8 +52,10 @@ partition(PyObject* str_obj, const STRINGLIB_CHAR* str, Py_ssize_t str_len,
}
Py_LOCAL(PyObject*)
rpartition(PyObject* str_obj, const STRINGLIB_CHAR* str, Py_ssize_t str_len,
PyObject* sep_obj, const STRINGLIB_CHAR* sep, Py_ssize_t sep_len)
stringlib_rpartition(
PyObject* str_obj, const STRINGLIB_CHAR* str, Py_ssize_t str_len,
PyObject* sep_obj, const STRINGLIB_CHAR* sep, Py_ssize_t sep_len
)
{
PyObject* out;
Py_ssize_t pos;