/* XXX This file assumes that the <ctype.h> is*() functions
XXX are defined for all 8-bit characters! */
+#define WARN if (PyErr_Warn(PyExc_DeprecationWarning, \
+ "strop functions are obsolete; use string methods")) \
+ return NULL
+
/* The lstrip(), rstrip() and strip() functions are implemented
in do_strip(), which uses an additional parameter to indicate what
type of strip should occur. */
char *s, *sub;
PyObject *list, *item;
+ WARN;
sub = NULL;
n = 0;
splitcount = 0;
char* p = NULL;
intargfunc getitemfunc;
+ WARN;
if (!PyArg_ParseTuple(args, "O|t#:join", &seq, &sep, &seplen))
return NULL;
if (sep == NULL) {
char *s, *sub;
int len, n, i = 0, last = INT_MAX;
+ WARN;
if (!PyArg_ParseTuple(args, "t#t#|ii:find", &s, &len, &sub, &n, &i, &last))
return NULL;
int len, n, j;
int i = 0, last = INT_MAX;
+ WARN;
if (!PyArg_ParseTuple(args, "t#t#|ii:rfind", &s, &len, &sub, &n, &i, &last))
return NULL;
static PyObject *
strop_strip(PyObject *self, PyObject *args)
{
+ WARN;
return do_strip(args, BOTHSTRIP);
}
static PyObject *
strop_lstrip(PyObject *self, PyObject *args)
{
+ WARN;
return do_strip(args, LEFTSTRIP);
}
static PyObject *
strop_rstrip(PyObject *self, PyObject *args)
{
+ WARN;
return do_strip(args, RIGHTSTRIP);
}
PyObject *new;
int changed;
+ WARN;
if (!PyArg_Parse(args, "t#", &s, &n))
return NULL;
new = PyString_FromStringAndSize(NULL, n);
PyObject *new;
int changed;
+ WARN;
if (!PyArg_Parse(args, "t#", &s, &n))
return NULL;
new = PyString_FromStringAndSize(NULL, n);
PyObject *new;
int changed;
+ WARN;
if (!PyArg_Parse(args, "t#", &s, &n))
return NULL;
new = PyString_FromStringAndSize(NULL, n);
int stringlen;
int tabsize = 8;
+ WARN;
/* Get arguments */
if (!PyArg_ParseTuple(args, "s#|i:expandtabs", &string, &stringlen, &tabsize))
return NULL;
int i = 0, last = INT_MAX;
int m, r;
+ WARN;
if (!PyArg_ParseTuple(args, "t#t#|ii:count", &s, &len, &sub, &n, &i, &last))
return NULL;
if (last > len)
PyObject *new;
int changed;
+ WARN;
if (!PyArg_Parse(args, "t#", &s, &n))
return NULL;
new = PyString_FromStringAndSize(NULL, n);
long x;
char buffer[256]; /* For errors */
+ WARN;
if (!PyArg_ParseTuple(args, "s|i:atoi", &s, &base))
return NULL;
PyObject *x;
char buffer[256]; /* For errors */
+ WARN;
if (!PyArg_ParseTuple(args, "s|i:atol", &s, &base))
return NULL;
double x;
char buffer[256]; /* For errors */
+ WARN;
if (!PyArg_ParseTuple(args, "s:atof", &s))
return NULL;
while (*s && isspace(Py_CHARMASK(*s)))
PyObject *result;
int trans_table[256];
+ WARN;
if (!PyArg_ParseTuple(args, "St#|t#:translate", &input_obj,
&table1, &tablen, &del_table, &dellen))
return NULL;
int count = -1;
PyObject *new;
+ WARN;
if (!PyArg_ParseTuple(args, "t#t#t#|i:replace",
&str, &len, &pat, &pat_len, &sub, &sub_len,
&count))