summaryrefslogtreecommitdiff
path: root/Objects/stringlib/stringdefs.h
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-01-13 07:55:48 +0000
committerAntoine Pitrou <solipsis@pitrou.net>2010-01-13 07:55:48 +0000
commit6467213bfd10dd45f0ae6fa607c8052a3bdaec23 (patch)
tree2d2e16c4f8451c981f75a00bbcc6372561070a18 /Objects/stringlib/stringdefs.h
parentd0ff51c43f7d851f2e3beb230f346c1739152ab0 (diff)
downloadcpython-git-6467213bfd10dd45f0ae6fa607c8052a3bdaec23.tar.gz
Issue #7622: Improve the split(), rsplit(), splitlines() and replace()
methods of bytes, bytearray and unicode objects by using a common implementation based on stringlib's fast search. Patch by Florent Xicluna.
Diffstat (limited to 'Objects/stringlib/stringdefs.h')
-rw-r--r--Objects/stringlib/stringdefs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/stringlib/stringdefs.h b/Objects/stringlib/stringdefs.h
index 4a95258e1b..84e461628e 100644
--- a/Objects/stringlib/stringdefs.h
+++ b/Objects/stringlib/stringdefs.h
@@ -11,6 +11,8 @@
#define STRINGLIB_TYPE_NAME "string"
#define STRINGLIB_PARSE_CODE "S"
#define STRINGLIB_EMPTY nullstring
+#define STRINGLIB_ISSPACE Py_ISSPACE
+#define STRINGLIB_ISLINEBREAK(x) ((x == '\n') || (x == '\r'))
#define STRINGLIB_ISDECIMAL(x) ((x >= '0') && (x <= '9'))
#define STRINGLIB_TODECIMAL(x) (STRINGLIB_ISDECIMAL(x) ? (x - '0') : -1)
#define STRINGLIB_TOUPPER Py_TOUPPER
@@ -21,8 +23,11 @@
#define STRINGLIB_NEW PyString_FromStringAndSize
#define STRINGLIB_RESIZE _PyString_Resize
#define STRINGLIB_CHECK PyString_Check
+#define STRINGLIB_CHECK_EXACT PyString_CheckExact
#define STRINGLIB_TOSTR PyObject_Str
#define STRINGLIB_GROUPING _PyString_InsertThousandsGrouping
#define STRINGLIB_GROUPING_LOCALE _PyString_InsertThousandsGroupingLocale
+#define STRINGLIB_WANT_CONTAINS_OBJ 1
+
#endif /* !STRINGLIB_STRINGDEFS_H */