[Python-checkins] CVS: python/dist/src/Modules stropmodule.c,2.75,2.76

Tim Peters tim_one@users.sourceforge.net
Wed, 09 May 2001 15:15:05 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv7124/python/dist/src/Modules

Modified Files:
	stropmodule.c 
Log Message:
Mechanical changes for easier edits.


Index: stropmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/stropmodule.c,v
retrieving revision 2.75
retrieving revision 2.76
diff -C2 -r2.75 -r2.76
*** stropmodule.c	2000/09/26 05:46:01	2.75
--- stropmodule.c	2001/05/09 22:15:03	2.76
***************
*** 1,10 ****
- 
  /* strop module */
  
  static char strop_module__doc__[] =
! "Common string manipulations, optimized for speed.\n\
! \n\
! Always use \"import string\" rather than referencing\n\
! this module directly.";
  
  #include "Python.h"
--- 1,9 ----
  /* strop module */
  
  static char strop_module__doc__[] =
! "Common string manipulations, optimized for speed.\n"
! "\n"
! "Always use \"import string\" rather than referencing\n"
! "this module directly.";
  
  #include "Python.h"
***************
*** 79,91 ****
  
  static char splitfields__doc__[] =
! "split(s [,sep [,maxsplit]]) -> list of strings\n\
! splitfields(s [,sep [,maxsplit]]) -> list of strings\n\
! \n\
! Return a list of the words in the string s, using sep as the\n\
! delimiter string.  If maxsplit is nonzero, splits into at most\n\
! maxsplit words.  If sep is not specified, any whitespace string\n\
! is a separator.  Maxsplit defaults to 0.\n\
! \n\
! (split and splitfields are synonymous)";
  
  static PyObject *
--- 78,90 ----
  
  static char splitfields__doc__[] =
! "split(s [,sep [,maxsplit]]) -> list of strings\n"
! "splitfields(s [,sep [,maxsplit]]) -> list of strings\n"
! "\n"
! "Return a list of the words in the string s, using sep as the\n"
! "delimiter string.  If maxsplit is nonzero, splits into at most\n"
! "maxsplit words.  If sep is not specified, any whitespace string\n"
! "is a separator.  Maxsplit defaults to 0.\n"
! "\n"
! "(split and splitfields are synonymous)";
  
  static PyObject *
***************
*** 149,160 ****
  
  static char joinfields__doc__[] =
! "join(list [,sep]) -> string\n\
! joinfields(list [,sep]) -> string\n\
! \n\
! Return a string composed of the words in list, with\n\
! intervening occurrences of sep.  Sep defaults to a single\n\
! space.\n\
! \n\
! (join and joinfields are synonymous)";
  
  static PyObject *
--- 148,159 ----
  
  static char joinfields__doc__[] =
! "join(list [,sep]) -> string\n"
! "joinfields(list [,sep]) -> string\n"
! "\n"
! "Return a string composed of the words in list, with\n"
! "intervening occurrences of sep.  Sep defaults to a single\n"
! "space.\n"
! "\n"
! "(join and joinfields are synonymous)";
  
  static PyObject *
***************
*** 280,290 ****
  
  static char find__doc__[] =
! "find(s, sub [,start [,end]]) -> in\n\
! \n\
! Return the lowest index in s where substring sub is found,\n\
! such that sub is contained within s[start,end].  Optional\n\
! arguments start and end are interpreted as in slice notation.\n\
! \n\
! Return -1 on failure.";
  
  static PyObject *
--- 279,289 ----
  
  static char find__doc__[] =
! "find(s, sub [,start [,end]]) -> in\n"
! "\n"
! "Return the lowest index in s where substring sub is found,\n"
! "such that sub is contained within s[start,end].  Optional\n"
! "arguments start and end are interpreted as in slice notation.\n"
! "\n"
! "Return -1 on failure.";
  
  static PyObject *
***************
*** 322,332 ****
  
  static char rfind__doc__[] =
! "rfind(s, sub [,start [,end]]) -> int\n\
! \n\
! Return the highest index in s where substring sub is found,\n\
! such that sub is contained within s[start,end].  Optional\n\
! arguments start and end are interpreted as in slice notation.\n\
! \n\
! Return -1 on failure.";
  
  static PyObject *
--- 321,331 ----
  
  static char rfind__doc__[] =
! "rfind(s, sub [,start [,end]]) -> int\n"
! "\n"
! "Return the highest index in s where substring sub is found,\n"
! "such that sub is contained within s[start,end].  Optional\n"
! "arguments start and end are interpreted as in slice notation.\n"
! "\n"
! "Return -1 on failure.";
  
  static PyObject *
***************
*** 398,405 ****
  
  static char strip__doc__[] =
! "strip(s) -> string\n\
! \n\
! Return a copy of the string s with leading and trailing\n\
! whitespace removed.";
  
  static PyObject *
--- 397,404 ----
  
  static char strip__doc__[] =
! "strip(s) -> string\n"
! "\n"
! "Return a copy of the string s with leading and trailing\n"
! "whitespace removed.";
  
  static PyObject *
***************
*** 411,417 ****
  
  static char lstrip__doc__[] =
! "lstrip(s) -> string\n\
! \n\
! Return a copy of the string s with leading whitespace removed.";
  
  static PyObject *
--- 410,416 ----
  
  static char lstrip__doc__[] =
! "lstrip(s) -> string\n"
! "\n"
! "Return a copy of the string s with leading whitespace removed.";
  
  static PyObject *
***************
*** 423,429 ****
  
  static char rstrip__doc__[] =
! "rstrip(s) -> string\n\
! \n\
! Return a copy of the string s with trailing whitespace removed.";
  
  static PyObject *
--- 422,428 ----
  
  static char rstrip__doc__[] =
! "rstrip(s) -> string\n"
! "\n"
! "Return a copy of the string s with trailing whitespace removed.";
  
  static PyObject *
***************
*** 435,441 ****
  
  static char lower__doc__[] =
! "lower(s) -> string\n\
! \n\
! Return a copy of the string s converted to lowercase.";
  
  static PyObject *
--- 434,440 ----
  
  static char lower__doc__[] =
! "lower(s) -> string\n"
! "\n"
! "Return a copy of the string s converted to lowercase.";
  
  static PyObject *
***************
*** 473,479 ****
  
  static char upper__doc__[] =
! "upper(s) -> string\n\
! \n\
! Return a copy of the string s converted to uppercase.";
  
  static PyObject *
--- 472,478 ----
  
  static char upper__doc__[] =
! "upper(s) -> string\n"
! "\n"
! "Return a copy of the string s converted to uppercase.";
  
  static PyObject *
***************
*** 511,518 ****
  
  static char capitalize__doc__[] =
! "capitalize(s) -> string\n\
! \n\
! Return a copy of the string s with only its first character\n\
! capitalized.";
  
  static PyObject *
--- 510,517 ----
  
  static char capitalize__doc__[] =
! "capitalize(s) -> string\n"
! "\n"
! "Return a copy of the string s with only its first character\n"
! "capitalized.";
  
  static PyObject *
***************
*** 559,568 ****
  
  static char expandtabs__doc__[] =
! "expandtabs(string, [tabsize]) -> string\n\
! \n\
! Expand tabs in a string, i.e. replace them by one or more spaces,\n\
! depending on the current column and the given tab size (default 8).\n\
! The column number is reset to zero after each newline occurring in the\n\
! string.  This doesn't understand other non-printing characters.";
  
  static PyObject *
--- 558,567 ----
  
  static char expandtabs__doc__[] =
! "expandtabs(string, [tabsize]) -> string\n"
! "\n"
! "Expand tabs in a string, i.e. replace them by one or more spaces,\n"
! "depending on the current column and the given tab size (default 8).\n"
! "The column number is reset to zero after each newline occurring in the\n"
! "string.  This doesn't understand other non-printing characters.";
  
  static PyObject *
***************
*** 630,638 ****
  
  static char count__doc__[] =
! "count(s, sub[, start[, end]]) -> int\n\
! \n\
! Return the number of occurrences of substring sub in string\n\
! s[start:end].  Optional arguments start and end are\n\
! interpreted as in slice notation.";
  
  static PyObject *
--- 629,637 ----
  
  static char count__doc__[] =
! "count(s, sub[, start[, end]]) -> int\n"
! "\n"
! "Return the number of occurrences of substring sub in string\n"
! "s[start:end].  Optional arguments start and end are\n"
! "interpreted as in slice notation.";
  
  static PyObject *
***************
*** 674,681 ****
  
  static char swapcase__doc__[] =
! "swapcase(s) -> string\n\
! \n\
! Return a copy of the string s with upper case characters\n\
! converted to lowercase and vice versa.";
  
  static PyObject *
--- 673,680 ----
  
  static char swapcase__doc__[] =
! "swapcase(s) -> string\n"
! "\n"
! "Return a copy of the string s with upper case characters\n"
! "converted to lowercase and vice versa.";
  
  static PyObject *
***************
*** 718,729 ****
  
  static char atoi__doc__[] =
! "atoi(s [,base]) -> int\n\
! \n\
! Return the integer represented by the string s in the given\n\
! base, which defaults to 10.  The string s must consist of one\n\
! or more digits, possibly preceded by a sign.  If base is 0, it\n\
! is chosen from the leading characters of s, 0 for octal, 0x or\n\
! 0X for hexadecimal.  If base is 16, a preceding 0x or 0X is\n\
! accepted.";
  
  static PyObject *
--- 717,728 ----
  
  static char atoi__doc__[] =
! "atoi(s [,base]) -> int\n"
! "\n"
! "Return the integer represented by the string s in the given\n"
! "base, which defaults to 10.  The string s must consist of one\n"
! "or more digits, possibly preceded by a sign.  If base is 0, it\n"
! "is chosen from the leading characters of s, 0 for octal, 0x or\n"
! "0X for hexadecimal.  If base is 16, a preceding 0x or 0X is\n"
! "accepted.";
  
  static PyObject *
***************
*** 770,782 ****
  
  static char atol__doc__[] =
! "atol(s [,base]) -> long\n\
! \n\
! Return the long integer represented by the string s in the\n\
! given base, which defaults to 10.  The string s must consist\n\
! of one or more digits, possibly preceded by a sign.  If base\n\
! is 0, it is chosen from the leading characters of s, 0 for\n\
! octal, 0x or 0X for hexadecimal.  If base is 16, a preceding\n\
! 0x or 0X is accepted.  A trailing L or l is not accepted,\n\
! unless base is 0.";
  
  static PyObject *
--- 769,781 ----
  
  static char atol__doc__[] =
! "atol(s [,base]) -> long\n"
! "\n"
! "Return the long integer represented by the string s in the\n"
! "given base, which defaults to 10.  The string s must consist\n"
! "of one or more digits, possibly preceded by a sign.  If base\n"
! "is 0, it is chosen from the leading characters of s, 0 for\n"
! "octal, 0x or 0X for hexadecimal.  If base is 16, a preceding\n"
! "0x or 0X is accepted.  A trailing L or l is not accepted,\n"
! "unless base is 0.";
  
  static PyObject *
***************
*** 820,826 ****
  
  static char atof__doc__[] =
! "atof(s) -> float\n\
! \n\
! Return the floating point number represented by the string s.";
  
  static PyObject *
--- 819,825 ----
  
  static char atof__doc__[] =
! "atof(s) -> float\n"
! "\n"
! "Return the floating point number represented by the string s.";
  
  static PyObject *
***************
*** 861,869 ****
  
  static char maketrans__doc__[] =
! "maketrans(frm, to) -> string\n\
! \n\
! Return a translation table (a string of 256 bytes long)\n\
! suitable for use in string.translate.  The strings frm and to\n\
! must be of the same length.";
  
  static PyObject *
--- 860,868 ----
  
  static char maketrans__doc__[] =
! "maketrans(frm, to) -> string\n"
! "\n"
! "Return a translation table (a string of 256 bytes long)\n"
! "suitable for use in string.translate.  The strings frm and to\n"
! "must be of the same length.";
  
  static PyObject *
***************
*** 897,906 ****
  
  static char translate__doc__[] =
! "translate(s,table [,deletechars]) -> string\n\
! \n\
! Return a copy of the string s, where all characters occurring\n\
! in the optional argument deletechars are removed, and the\n\
! remaining characters have been mapped through the given\n\
! translation table, which must be a string of length 256.";
  
  static PyObject *
--- 896,905 ----
  
  static char translate__doc__[] =
! "translate(s,table [,deletechars]) -> string\n"
! "\n"
! "Return a copy of the string s, where all characters occurring\n"
! "in the optional argument deletechars are removed, and the\n"
! "remaining characters have been mapped through the given\n"
! "translation table, which must be a string of length 256.";
  
  static PyObject *
***************
*** 983,987 ****
    MEM, the function returns -1.
  */
! static int mymemfind(char *mem, int len, char *pat, int pat_len)
  {
  	register int ii;
--- 982,987 ----
    MEM, the function returns -1.
  */
! static int 
! mymemfind(char *mem, int len, char *pat, int pat_len)
  {
  	register int ii;
***************
*** 1007,1011 ****
             mem=11111 and pat==11 also return 2.
   */
! static int mymemcnt(char *mem, int len, char *pat, int pat_len)
  {
  	register int offset = 0;
--- 1007,1012 ----
             mem=11111 and pat==11 also return 2.
   */
! static int 
! mymemcnt(char *mem, int len, char *pat, int pat_len)
  {
  	register int offset = 0;
***************
*** 1042,1046 ****
         NULL if an error occurred.
  */
! 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;
--- 1043,1051 ----
         NULL if an error occurred.
  */
! 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;
***************
*** 1096,1104 ****
  
  static char replace__doc__[] =
! "replace (str, old, new[, maxsplit]) -> string\n\
! \n\
! Return a copy of string str with all occurrences of substring\n\
! old replaced by new. If the optional argument maxsplit is\n\
! given, only the first maxsplit occurrences are replaced.";
  
  static PyObject *
--- 1101,1109 ----
  
  static char replace__doc__[] =
! "replace (str, old, new[, maxsplit]) -> string\n"
! "\n"
! "Return a copy of string str with all occurrences of substring\n"
! "old replaced by new. If the optional argument maxsplit is\n"
! "given, only the first maxsplit occurrences are replaced.";
  
  static PyObject *
***************
*** 1140,1185 ****
  static PyMethodDef
  strop_methods[] = {
! 	{"atof",	strop_atof, 
! 	 METH_VARARGS, atof__doc__},
! 	{"atoi",	strop_atoi, 
! 	 METH_VARARGS, atoi__doc__},
! 	{"atol",	strop_atol, 
! 	 METH_VARARGS, atol__doc__},
! 	{"capitalize",	strop_capitalize, 
! 	 METH_OLDARGS, capitalize__doc__},
! 	{"count",	strop_count, 
! 	 METH_VARARGS, count__doc__},
! 	{"expandtabs",	strop_expandtabs, 
! 	 METH_VARARGS, expandtabs__doc__},
! 	{"find",	strop_find, 
! 	 METH_VARARGS, find__doc__},
! 	{"join",	strop_joinfields, 
! 	 METH_VARARGS, joinfields__doc__},
! 	{"joinfields",	strop_joinfields, 
! 	 METH_VARARGS, joinfields__doc__},
! 	{"lstrip",	strop_lstrip, 
! 	 METH_OLDARGS, lstrip__doc__},
! 	{"lower",	strop_lower, 
! 	 METH_OLDARGS, lower__doc__},
! 	{"maketrans",	strop_maketrans, 
! 	 METH_VARARGS, maketrans__doc__},
! 	{"replace",	strop_replace, 
! 	 METH_VARARGS, replace__doc__},
! 	{"rfind",	strop_rfind, 
! 	 METH_VARARGS, rfind__doc__},
! 	{"rstrip",	strop_rstrip, 
! 	 METH_OLDARGS, rstrip__doc__},
! 	{"split",	strop_splitfields, 
! 	 METH_VARARGS, splitfields__doc__},
! 	{"splitfields",	strop_splitfields, 
! 	 METH_VARARGS, splitfields__doc__},
! 	{"strip",	strop_strip, 
! 	 METH_OLDARGS, strip__doc__},
! 	{"swapcase",	strop_swapcase, 
! 	 METH_OLDARGS, swapcase__doc__},
! 	{"translate",	strop_translate, 
! 	 METH_VARARGS, translate__doc__},
! 	{"upper",	strop_upper, 
! 	 METH_OLDARGS, upper__doc__},
  	{NULL,		NULL}	/* sentinel */
  };
--- 1145,1169 ----
  static PyMethodDef
  strop_methods[] = {
! 	{"atof",	strop_atof,	   METH_VARARGS, atof__doc__},
! 	{"atoi",	strop_atoi,	   METH_VARARGS, atoi__doc__},
! 	{"atol",	strop_atol,	   METH_VARARGS, atol__doc__},
! 	{"capitalize",	strop_capitalize,  METH_OLDARGS, capitalize__doc__},
! 	{"count",	strop_count,	   METH_VARARGS, count__doc__},
! 	{"expandtabs",	strop_expandtabs,  METH_VARARGS, expandtabs__doc__},
! 	{"find",	strop_find,	   METH_VARARGS, find__doc__},
! 	{"join",	strop_joinfields,  METH_VARARGS, joinfields__doc__},
! 	{"joinfields",	strop_joinfields,  METH_VARARGS, joinfields__doc__},
! 	{"lstrip",	strop_lstrip,	   METH_OLDARGS, lstrip__doc__},
! 	{"lower",	strop_lower,	   METH_OLDARGS, lower__doc__},
! 	{"maketrans",	strop_maketrans,   METH_VARARGS, maketrans__doc__},
! 	{"replace",	strop_replace,	   METH_VARARGS, replace__doc__},
! 	{"rfind",	strop_rfind,	   METH_VARARGS, rfind__doc__},
! 	{"rstrip",	strop_rstrip,	   METH_OLDARGS, rstrip__doc__},
! 	{"split",	strop_splitfields, METH_VARARGS, splitfields__doc__},
! 	{"splitfields",	strop_splitfields, METH_VARARGS, splitfields__doc__},
! 	{"strip",	strop_strip,	   METH_OLDARGS, strip__doc__},
! 	{"swapcase",	strop_swapcase,    METH_OLDARGS, swapcase__doc__},
! 	{"translate",	strop_translate,   METH_VARARGS, translate__doc__},
! 	{"upper",	strop_upper,	   METH_OLDARGS, upper__doc__},
  	{NULL,		NULL}	/* sentinel */
  };