summaryrefslogtreecommitdiffstats
path: root/Objects/stringlib/partition.h
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2011-09-28 05:41:54 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2011-09-28 05:41:54 (GMT)
commitd63a3b8beb4a0841cb59fb3515347ccaab34b733 (patch)
tree3b4e3cc63151c5a5a910c3550a190aefaea96ad4 /Objects/stringlib/partition.h
parent48d49497c50e79d14e9df9527d766ca3a0a38be5 (diff)
downloadcpython-d63a3b8beb4a0841cb59fb3515347ccaab34b733.zip
cpython-d63a3b8beb4a0841cb59fb3515347ccaab34b733.tar.gz
cpython-d63a3b8beb4a0841cb59fb3515347ccaab34b733.tar.bz2
Implement PEP 393.
Diffstat (limited to 'Objects/stringlib/partition.h')
-rw-r--r--Objects/stringlib/partition.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/Objects/stringlib/partition.h b/Objects/stringlib/partition.h
index 0170bdd..40cb512 100644
--- a/Objects/stringlib/partition.h
+++ b/Objects/stringlib/partition.h
@@ -1,14 +1,11 @@
/* stringlib: partition implementation */
-#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_INLINE(PyObject*)
-stringlib_partition(PyObject* str_obj,
+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)
@@ -25,7 +22,7 @@ stringlib_partition(PyObject* str_obj,
if (!out)
return NULL;
- pos = fastsearch(str, str_len, sep, sep_len, -1, FAST_SEARCH);
+ pos = FASTSEARCH(str, str_len, sep, sep_len, -1, FAST_SEARCH);
if (pos < 0) {
#if STRINGLIB_MUTABLE
@@ -58,7 +55,7 @@ stringlib_partition(PyObject* str_obj,
}
Py_LOCAL_INLINE(PyObject*)
-stringlib_rpartition(PyObject* str_obj,
+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)
@@ -75,7 +72,7 @@ stringlib_rpartition(PyObject* str_obj,
if (!out)
return NULL;
- pos = fastsearch(str, str_len, sep, sep_len, -1, FAST_RSEARCH);
+ pos = FASTSEARCH(str, str_len, sep, sep_len, -1, FAST_RSEARCH);
if (pos < 0) {
#if STRINGLIB_MUTABLE
@@ -107,4 +104,3 @@ stringlib_rpartition(PyObject* str_obj,
return out;
}
-#endif