static PyObject *
-split_whitespace(s, len, maxsplit)
- char *s;
- int len;
- int maxsplit;
+split_whitespace(char *s, int len, int maxsplit)
{
int i = 0, j, err;
int countsplit = 0;
(split and splitfields are synonymous)";
static PyObject *
-strop_splitfields(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_splitfields(PyObject *self, PyObject *args)
{
int len, n, i, j, err;
int splitcount, maxsplit;
(join and joinfields are synonymous)";
static PyObject *
-strop_joinfields(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_joinfields(PyObject *self, PyObject *args)
{
PyObject *seq;
char *sep = NULL;
Return -1 on failure.";
static PyObject *
-strop_find(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_find(PyObject *self, PyObject *args)
{
char *s, *sub;
int len, n, i = 0, last = INT_MAX;
Return -1 on failure.";
static PyObject *
-strop_rfind(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_rfind(PyObject *self, PyObject *args)
{
char *s, *sub;
int len, n, j;
static PyObject *
-do_strip(args, striptype)
- PyObject *args;
- int striptype;
+do_strip(PyObject *args, int striptype)
{
char *s;
int len, i, j;
whitespace removed.";
static PyObject *
-strop_strip(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_strip(PyObject *self, PyObject *args)
{
return do_strip(args, BOTHSTRIP);
}
Return a copy of the string s with leading whitespace removed.";
static PyObject *
-strop_lstrip(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_lstrip(PyObject *self, PyObject *args)
{
return do_strip(args, LEFTSTRIP);
}
Return a copy of the string s with trailing whitespace removed.";
static PyObject *
-strop_rstrip(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_rstrip(PyObject *self, PyObject *args)
{
return do_strip(args, RIGHTSTRIP);
}
Return a copy of the string s converted to lowercase.";
static PyObject *
-strop_lower(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_lower(PyObject *self, PyObject *args)
{
char *s, *s_new;
int i, n;
Return a copy of the string s converted to uppercase.";
static PyObject *
-strop_upper(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_upper(PyObject *self, PyObject *args)
{
char *s, *s_new;
int i, n;
capitalized.";
static PyObject *
-strop_capitalize(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_capitalize(PyObject *self, PyObject *args)
{
char *s, *s_new;
int i, n;
string. This doesn't understand other non-printing characters.";
static PyObject *
-strop_expandtabs(self, args)
- PyObject *self;
- PyObject *args;
+strop_expandtabs(PyObject *self, PyObject *args)
{
/* Original by Fredrik Lundh */
char* e;
interpreted as in slice notation.";
static PyObject *
-strop_count(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_count(PyObject *self, PyObject *args)
{
char *s, *sub;
int len, n;
converted to lowercase and vice versa.";
static PyObject *
-strop_swapcase(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_swapcase(PyObject *self, PyObject *args)
{
char *s, *s_new;
int i, n;
accepted.";
static PyObject *
-strop_atoi(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_atoi(PyObject *self, PyObject *args)
{
char *s, *end;
int base = 10;
unless base is 0.";
static PyObject *
-strop_atol(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_atol(PyObject *self, PyObject *args)
{
char *s, *end;
int base = 10;
Return the floating point number represented by the string s.";
static PyObject *
-strop_atof(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_atof(PyObject *self, PyObject *args)
{
extern double strtod(const char *, char **);
char *s, *end;
must be of the same length.";
static PyObject *
-strop_maketrans(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_maketrans(PyObject *self, PyObject *args)
{
unsigned char *c, *from=NULL, *to=NULL;
int i, fromlen=0, tolen=0;
translation table, which must be a string of length 256.";
static PyObject *
-strop_translate(self, args)
- PyObject *self;
- PyObject *args;
+strop_translate(PyObject *self, PyObject *args)
{
register char *input, *table, *output;
register int i, c, changed = 0;
found, or -1 if not found. If len of PAT is greater than length of
MEM, the function returns -1.
*/
-static int mymemfind(mem, len, pat, pat_len)
- char *mem;
- int len;
- char *pat;
- int pat_len;
+static int mymemfind(char *mem, int len, char *pat, int pat_len)
{
register int ii;
meaning mem=1111 and pat==11 returns 2.
mem=11111 and pat==11 also return 2.
*/
-static int mymemcnt(mem, len, pat, pat_len)
- char *mem;
- int len;
- char *pat;
- int pat_len;
+static int mymemcnt(char *mem, int len, char *pat, int pat_len)
{
register int offset = 0;
int nfound = 0;
the new string allocated locally, or
NULL if an error occurred.
*/
-static char *mymemreplace(str, len, pat, pat_len, sub, sub_len, count, out_len)
- char *str;
- int len; /* input string */
- char *pat;
- int pat_len; /* pattern string to find */
- char *sub;
- int sub_len; /* substitution string */
- int count; /* number of replacements, 0 == all */
- int *out_len;
-
+static char *mymemreplace(char *str, int len, char *pat, int pat_len, char *sub, int sub_len, int count, int *out_len)
{
char *out_s;
char *new_s;
given, only the first maxsplit occurrences are replaced.";
static PyObject *
-strop_replace(self, args)
- PyObject *self; /* Not used */
- PyObject *args;
+strop_replace(PyObject *self, PyObject *args)
{
char *str, *pat,*sub,*new_s;
int len,pat_len,sub_len,out_len;