Commit 14f8b4cf authored by Martin v. Löwis's avatar Martin v. Löwis

Patch #568124: Add doc string macros.

parent 654c11ee
......@@ -101,9 +101,9 @@ static PyObject * ProfilerError = NULL;
/* The log reader... */
static char logreader_close__doc__[] =
PyDoc_STRVAR(logreader_close__doc__,
"close()\n"
"Close the log file, preventing additional records from being read.";
"Close the log file, preventing additional records from being read.");
static PyObject *
logreader_close(LogReaderObject *self, PyObject *args)
......@@ -522,9 +522,9 @@ logreader_sq_item(LogReaderObject *self, int index)
return result;
}
static char next__doc__[] =
PyDoc_STRVAR(next__doc__,
"next() -> event-info\n"
"Return the next event record from the log file.";
"Return the next event record from the log file.");
static PyObject *
logreader_next(LogReaderObject *self, PyObject *args)
......@@ -1021,9 +1021,9 @@ is_available(ProfilerObject *self)
/* Profiler object interface methods. */
static char addinfo__doc__[] =
PyDoc_STRVAR(addinfo__doc__,
"addinfo(key, value)\n"
"Insert an ADD_INFO record into the log.";
"Insert an ADD_INFO record into the log.");
static PyObject *
profiler_addinfo(ProfilerObject *self, PyObject *args)
......@@ -1044,9 +1044,9 @@ profiler_addinfo(ProfilerObject *self, PyObject *args)
return result;
}
static char close__doc__[] =
PyDoc_STRVAR(close__doc__,
"close()\n"
"Shut down this profiler and close the log files, even if its active.";
"Shut down this profiler and close the log files, even if its active.");
static PyObject *
profiler_close(ProfilerObject *self, PyObject *args)
......@@ -1065,9 +1065,9 @@ profiler_close(ProfilerObject *self, PyObject *args)
return result;
}
static char runcall__doc__[] =
PyDoc_STRVAR(runcall__doc__,
"runcall(callable[, args[, kw]]) -> callable()\n"
"Profile a specific function call, returning the result of that call.";
"Profile a specific function call, returning the result of that call.");
static PyObject *
profiler_runcall(ProfilerObject *self, PyObject *args)
......@@ -1088,10 +1088,10 @@ profiler_runcall(ProfilerObject *self, PyObject *args)
return result;
}
static char runcode__doc__[] =
PyDoc_STRVAR(runcode__doc__,
"runcode(code, globals[, locals])\n"
"Execute a code object while collecting profile data. If locals is\n"
"omitted, globals is used for the locals as well.";
"omitted, globals is used for the locals as well.");
static PyObject *
profiler_runcode(ProfilerObject *self, PyObject *args)
......@@ -1127,9 +1127,9 @@ profiler_runcode(ProfilerObject *self, PyObject *args)
return result;
}
static char start__doc__[] =
PyDoc_STRVAR(start__doc__,
"start()\n"
"Install this profiler for the current thread.";
"Install this profiler for the current thread.");
static PyObject *
profiler_start(ProfilerObject *self, PyObject *args)
......@@ -1146,9 +1146,9 @@ profiler_start(ProfilerObject *self, PyObject *args)
return result;
}
static char stop__doc__[] =
PyDoc_STRVAR(stop__doc__,
"stop()\n"
"Remove this profiler from the current thread.";
"Remove this profiler from the current thread.");
static PyObject *
profiler_stop(ProfilerObject *self, PyObject *args)
......@@ -1225,7 +1225,7 @@ profiler_getattr(ProfilerObject *self, char *name)
}
static char profiler_object__doc__[] =
PyDoc_STRVAR(profiler_object__doc__,
"High-performance profiler object.\n"
"\n"
"Methods:\n"
......@@ -1241,7 +1241,7 @@ static char profiler_object__doc__[] =
"closed: True if the profiler has already been closed.\n"
"frametimings: True if ENTER/EXIT events collect timing information.\n"
"lineevents: True if SET_LINENO events are reported to the profiler.\n"
"linetimings: True if SET_LINENO events collect timing information.";
"linetimings: True if SET_LINENO events collect timing information.");
static PyTypeObject ProfilerType = {
PyObject_HEAD_INIT(NULL)
......@@ -1288,9 +1288,9 @@ logreader_getattr(LogReaderObject *self, char *name)
}
static char logreader__doc__[] = "\
logreader(filename) --> log-iterator\n\
Create a log-reader for the timing information file.";
PyDoc_STRVAR(logreader__doc__,
"logreader(filename) --> log-iterator\n\
Create a log-reader for the timing information file.");
static PySequenceMethods logreader_as_sequence = {
0, /* sq_length */
......@@ -1476,9 +1476,9 @@ write_header(ProfilerObject *self)
return 0;
}
static char profiler__doc__[] = "\
profiler(logfilename[, lineevents[, linetimes]]) -> profiler\n\
Create a new profiler object.";
PyDoc_STRVAR(profiler__doc__,
"profiler(logfilename[, lineevents[, linetimes]]) -> profiler\n\
Create a new profiler object.");
static PyObject *
hotshot_profiler(PyObject *unused, PyObject *args)
......@@ -1529,10 +1529,10 @@ hotshot_profiler(PyObject *unused, PyObject *args)
return (PyObject *) self;
}
static char coverage__doc__[] = "\
coverage(logfilename) -> profiler\n\
PyDoc_STRVAR(coverage__doc__,
"coverage(logfilename) -> profiler\n\
Returns a profiler that doesn't collect any timing information, which is\n\
useful in building a coverage analysis tool.";
useful in building a coverage analysis tool.");
static PyObject *
hotshot_coverage(PyObject *unused, PyObject *args)
......@@ -1552,17 +1552,22 @@ hotshot_coverage(PyObject *unused, PyObject *args)
return result;
}
static char resolution__doc__[] =
PyDoc_VAR(resolution__doc__) =
#ifdef MS_WIN32
PyDoc_STR(
"resolution() -> (performance-counter-ticks, update-frequency)\n"
"Return the resolution of the timer provided by the QueryPerformanceCounter()\n"
"function. The first value is the smallest observed change, and the second\n"
"is the result of QueryPerformanceFrequency().";
"is the result of QueryPerformanceFrequency()."
)
#else
PyDoc_STR(
"resolution() -> (gettimeofday-usecs, getrusage-usecs)\n"
"Return the resolution of the timers provided by the gettimeofday() and\n"
"getrusage() system calls, or -1 if the call is not supported.";
"getrusage() system calls, or -1 if the call is not supported."
)
#endif
;
static PyObject *
hotshot_resolution(PyObject *unused, PyObject *args)
......
......@@ -38,15 +38,14 @@ This software comes with no warranty. Use at your own risk.
char *strdup(const char *);
#endif
static char locale__doc__[] = "Support for POSIX locales.";
PyDoc_STRVAR(locale__doc__, "Support for POSIX locales.");
static PyObject *Error;
/* support functions for formatting floating point numbers */
static char setlocale__doc__[] =
"(integer,string=None) -> string. Activates/queries locale processing."
;
PyDoc_STRVAR(setlocale__doc__,
"(integer,string=None) -> string. Activates/queries locale processing.");
/* to record the LC_NUMERIC settings */
static PyObject* grouping = NULL;
......@@ -244,9 +243,8 @@ PyLocale_setlocale(PyObject* self, PyObject* args)
return result_object;
}
static char localeconv__doc__[] =
"() -> dict. Returns numeric and monetary locale-specific parameters."
;
PyDoc_STRVAR(localeconv__doc__,
"() -> dict. Returns numeric and monetary locale-specific parameters.");
static PyObject*
PyLocale_localeconv(PyObject* self)
......@@ -321,9 +319,8 @@ PyLocale_localeconv(PyObject* self)
return NULL;
}
static char strcoll__doc__[] =
"string,string -> int. Compares two strings according to the locale."
;
PyDoc_STRVAR(strcoll__doc__,
"string,string -> int. Compares two strings according to the locale.");
static PyObject*
PyLocale_strcoll(PyObject* self, PyObject* args)
......@@ -335,9 +332,8 @@ PyLocale_strcoll(PyObject* self, PyObject* args)
return PyInt_FromLong(strcoll(s1, s2));
}
static char strxfrm__doc__[] =
"string -> string. Returns a string that behaves for cmp locale-aware."
;
PyDoc_STRVAR(strxfrm__doc__,
"string -> string. Returns a string that behaves for cmp locale-aware.");
static PyObject*
PyLocale_strxfrm(PyObject* self, PyObject* args)
......@@ -521,10 +517,9 @@ struct langinfo_constant{
{0, 0}
};
static char nl_langinfo__doc__[] =
PyDoc_STRVAR(nl_langinfo__doc__,
"nl_langinfo(key) -> string\n"
"Return the value for the locale information associated with key."
;
"Return the value for the locale information associated with key.");
static PyObject*
PyLocale_nl_langinfo(PyObject* self, PyObject* args)
......@@ -545,9 +540,9 @@ PyLocale_nl_langinfo(PyObject* self, PyObject* args)
#ifdef HAVE_LIBINTL_H
static char gettext__doc__[]=
PyDoc_STRVAR(gettext__doc__,
"gettext(msg) -> string\n"
"Return translation of msg.";
"Return translation of msg.");
static PyObject*
PyIntl_gettext(PyObject* self, PyObject *args)
......@@ -558,9 +553,9 @@ PyIntl_gettext(PyObject* self, PyObject *args)
return PyString_FromString(gettext(in));
}
static char dgettext__doc__[]=
PyDoc_STRVAR(dgettext__doc__,
"dgettext(domain, msg) -> string\n"
"Return translation of msg in domain.";
"Return translation of msg in domain.");
static PyObject*
PyIntl_dgettext(PyObject* self, PyObject *args)
......@@ -571,9 +566,9 @@ PyIntl_dgettext(PyObject* self, PyObject *args)
return PyString_FromString(dgettext(domain, in));
}
static char dcgettext__doc__[]=
PyDoc_STRVAR(dcgettext__doc__,
"dcgettext(domain, msg, category) -> string\n"
"Return translation of msg in domain and category.";
"Return translation of msg in domain and category.");
static PyObject*
PyIntl_dcgettext(PyObject *self, PyObject *args)
......@@ -585,9 +580,9 @@ PyIntl_dcgettext(PyObject *self, PyObject *args)
return PyString_FromString(dcgettext(domain,msgid,category));
}
static char textdomain__doc__[]=
PyDoc_STRVAR(textdomain__doc__,
"textdomain(domain) -> string\n"
"Set the C library's textdmain to domain, returning the new domain.";
"Set the C library's textdmain to domain, returning the new domain.");
static PyObject*
PyIntl_textdomain(PyObject* self, PyObject* args)
......@@ -603,9 +598,9 @@ PyIntl_textdomain(PyObject* self, PyObject* args)
return PyString_FromString(domain);
}
static char bindtextdomain__doc__[]=
PyDoc_STRVAR(bindtextdomain__doc__,
"bindtextdomain(domain, dir) -> string\n"
"Bind the C library's domain to dir.";
"Bind the C library's domain to dir.");
static PyObject*
PyIntl_bindtextdomain(PyObject* self,PyObject*args)
......
......@@ -259,8 +259,8 @@ PySocket_ssl(PyObject *self, PyObject *args)
return (PyObject *)rv;
}
static char ssl_doc[] =
"ssl(socket, [keyfile, certfile]) -> sslobject";
PyDoc_STRVAR(ssl_doc,
"ssl(socket, [keyfile, certfile]) -> sslobject");
/* SSL object methods */
......@@ -306,11 +306,11 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
return PySSL_SetError(self, len);
}
static char PySSL_SSLwrite_doc[] =
PyDoc_STRVAR(PySSL_SSLwrite_doc,
"write(s) -> len\n\
\n\
Writes the string s into the SSL object. Returns the number\n\
of bytes written.";
of bytes written.");
static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args)
{
......@@ -336,10 +336,10 @@ static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args)
return buf;
}
static char PySSL_SSLread_doc[] =
PyDoc_STRVAR(PySSL_SSLread_doc,
"read([len]) -> string\n\
\n\
Read up to len bytes from the SSL socket.";
Read up to len bytes from the SSL socket.");
static PyMethodDef PySSLMethods[] = {
{"write", (PyCFunction)PySSL_SSLwrite, METH_VARARGS,
......@@ -392,11 +392,11 @@ PySSL_RAND_add(PyObject *self, PyObject *args)
return Py_None;
}
static char PySSL_RAND_add_doc[] =
PyDoc_STRVAR(PySSL_RAND_add_doc,
"RAND_add(string, entropy)\n\
\n\
Mix string into the OpenSSL PRNG state. entropy (a float) is a lower\n\
bound on the entropy contained in string.";
bound on the entropy contained in string.");
static PyObject *
PySSL_RAND_status(PyObject *self)
......@@ -404,12 +404,12 @@ PySSL_RAND_status(PyObject *self)
return PyInt_FromLong(RAND_status());
}
static char PySSL_RAND_status_doc[] =
PyDoc_STRVAR(PySSL_RAND_status_doc,
"RAND_status() -> 0 or 1\n\
\n\
Returns 1 if the OpenSSL PRNG has been seeded with enough data and 0 if not.\n\
It is necessary to seed the PRNG with RAND_add() on some platforms before\n\
using the ssl() function.";
using the ssl() function.");
static PyObject *
PySSL_RAND_egd(PyObject *self, PyObject *arg)
......@@ -430,12 +430,12 @@ PySSL_RAND_egd(PyObject *self, PyObject *arg)
return PyInt_FromLong(bytes);
}
static char PySSL_RAND_egd_doc[] =
PyDoc_STRVAR(PySSL_RAND_egd_doc,
"RAND_egd(path) -> bytes\n\
\n\
Queries the entropy gather daemon (EGD) on socket path. Returns number\n\
of bytes read. Raises socket.sslerror if connection to EGD fails or\n\
if it does provide enough data to seed PRNG.";
if it does provide enough data to seed PRNG.");
#endif
......@@ -456,9 +456,9 @@ static PyMethodDef PySSL_methods[] = {
};
static char module_doc[] =
PyDoc_STRVAR(module_doc,
"Implementation module for SSL socket operations. See the socket module\n\
for documentation.";
for documentation.");
DL_EXPORT(void)
init_ssl(void)
......
......@@ -5,9 +5,9 @@
((PyWeakReference **) PyObject_GET_WEAKREFS_LISTPTR(o))
static char weakref_getweakrefcount__doc__[] =
PyDoc_STRVAR(weakref_getweakrefcount__doc__,
"getweakrefcount(object) -- return the number of weak references\n"
"to 'object'.";
"to 'object'.");
static PyObject *
weakref_getweakrefcount(PyObject *self, PyObject *object)
......@@ -26,9 +26,9 @@ weakref_getweakrefcount(PyObject *self, PyObject *object)
}
static char weakref_getweakrefs__doc__[] =
PyDoc_STRVAR(weakref_getweakrefs__doc__,
"getweakrefs(object) -- return a list of all weak reference objects\n"
"that point to 'object'.";
"that point to 'object'.");
static PyObject *
weakref_getweakrefs(PyObject *self, PyObject *object)
......@@ -57,10 +57,10 @@ weakref_getweakrefs(PyObject *self, PyObject *object)
}
static char weakref_ref__doc__[] =
PyDoc_STRVAR(weakref_ref__doc__,
"new(object[, callback]) -- create a weak reference to 'object';\n"
"when 'object' is finalized, 'callback' will be called and passed\n"
"a reference to 'object'.";
"a reference to 'object'.");
static PyObject *
weakref_ref(PyObject *self, PyObject *args)
......@@ -76,10 +76,10 @@ weakref_ref(PyObject *self, PyObject *args)
}
static char weakref_proxy__doc__[] =
PyDoc_STRVAR(weakref_proxy__doc__,
"proxy(object[, callback]) -- create a proxy object that weakly\n"
"references 'object'. 'callback', if given, is called with a\n"
"reference to the proxy when it is about to be finalized.";
"reference to the proxy when it is about to be finalized.");
static PyObject *
weakref_proxy(PyObject *self, PyObject *args)
......
This diff is collapsed.
......@@ -820,10 +820,10 @@ array_count(arrayobject *self, PyObject *args)
return PyInt_FromLong((long)count);
}
static char count_doc [] =
PyDoc_STRVAR(count_doc,
"count(x)\n\
\n\
Return number of occurences of x in the array.";
Return number of occurences of x in the array.");
static PyObject *
array_index(arrayobject *self, PyObject *args)
......@@ -847,10 +847,10 @@ array_index(arrayobject *self, PyObject *args)
return NULL;
}
static char index_doc [] =
PyDoc_STRVAR(index_doc,
"index(x)\n\
\n\
Return index of first occurence of x in the array.";
Return index of first occurence of x in the array.");
static PyObject *
array_remove(arrayobject *self, PyObject *args)
......@@ -878,10 +878,10 @@ array_remove(arrayobject *self, PyObject *args)
return NULL;
}
static char remove_doc [] =
PyDoc_STRVAR(remove_doc,
"remove(x)\n\
\n\
Remove the first occurence of x in the array.";
Remove the first occurence of x in the array.");
static PyObject *
array_pop(arrayobject *self, PyObject *args)
......@@ -909,10 +909,10 @@ array_pop(arrayobject *self, PyObject *args)
return v;
}
static char pop_doc [] =
PyDoc_STRVAR(pop_doc,
"pop([i])\n\
\n\
Return the i-th element and delete it from the array. i defaults to -1.";
Return the i-th element and delete it from the array. i defaults to -1.");
static PyObject *
array_extend(arrayobject *self, PyObject *args)
......@@ -927,10 +927,10 @@ array_extend(arrayobject *self, PyObject *args)
return Py_None;
}
static char extend_doc [] =
PyDoc_STRVAR(extend_doc,
"extend(array)\n\
\n\
Append array items to the end of the array.";
Append array items to the end of the array.");
static PyObject *
array_insert(arrayobject *self, PyObject *args)
......@@ -942,10 +942,10 @@ array_insert(arrayobject *self, PyObject *args)
return ins(self, i, v);
}
static char insert_doc [] =
PyDoc_STRVAR(insert_doc,
"insert(i,x)\n\
\n\
Insert a new item x into the array before position i.";
Insert a new item x into the array before position i.");
static PyObject *
......@@ -964,13 +964,13 @@ array_buffer_info(arrayobject *self, PyObject *args)
return retval;
}
static char buffer_info_doc [] =
PyDoc_STRVAR(buffer_info_doc,
"buffer_info() -> (address, length)\n\
\n\
Return a tuple (address, length) giving the current memory address and\n\
the length in items of the buffer used to hold array's contents\n\
The length should be multiplied by the itemsize attribute to calculate\n\
the buffer length in bytes.";
the buffer length in bytes.");
static PyObject *
......@@ -982,10 +982,10 @@ array_append(arrayobject *self, PyObject *args)
return ins(self, (int) self->ob_size, v);
}
static char append_doc [] =
PyDoc_STRVAR(append_doc,
"append(x)\n\
\n\
Append new value x to the end of the array.";
Append new value x to the end of the array.");
static PyObject *
......@@ -1042,11 +1042,11 @@ array_byteswap(arrayobject *self, PyObject *args)
return Py_None;
}
static char byteswap_doc [] =
PyDoc_STRVAR(byteswap_doc,
"byteswap()\n\
\n\
Byteswap all items of the array. If the items in the array are not 1, 2,\n\
4, or 8 bytes in size, RuntimeError is raised.";
4, or 8 bytes in size, RuntimeError is raised.");
static PyObject *
array_reverse(arrayobject *self, PyObject *args)
......@@ -1078,10 +1078,10 @@ array_reverse(arrayobject *self, PyObject *args)
return Py_None;
}
static char reverse_doc [] =
PyDoc_STRVAR(reverse_doc,
"reverse()\n\
\n\
Reverse the order of the items in the array.";
Reverse the order of the items in the array.");
static PyObject *
array_fromfile(arrayobject *self, PyObject *args)
......@@ -1130,11 +1130,11 @@ array_fromfile(arrayobject *self, PyObject *args)
return Py_None;
}
static char fromfile_doc [] =
PyDoc_STRVAR(fromfile_doc,
"fromfile(f, n)\n\
\n\
Read n objects from the file object f and append them to the end of the\n\
array. Also called as read.";
array. Also called as read.");
static PyObject *
......@@ -1161,11 +1161,11 @@ array_tofile(arrayobject *self, PyObject *args)
return Py_None;
}
static char tofile_doc [] =
PyDoc_STRVAR(tofile_doc,
"tofile(f)\n\
\n\
Write all items (as machine values) to the file object f. Also called as\n\
write.";
write.");
static PyObject *
......@@ -1207,10 +1207,10 @@ array_fromlist(arrayobject *self, PyObject *args)
return Py_None;
}
static char fromlist_doc [] =
PyDoc_STRVAR(fromlist_doc,
"fromlist(list)\n\
\n\
Append items to array from list.";
Append items to array from list.");
static PyObject *
......@@ -1233,10 +1233,10 @@ array_tolist(arrayobject *self, PyObject *args)
return list;
}
static char tolist_doc [] =
PyDoc_STRVAR(tolist_doc,
"tolist() -> list\n\
\n\
Convert array to an ordinary list with the same items.";
Convert array to an ordinary list with the same items.");
static PyObject *
......@@ -1269,11 +1269,11 @@ array_fromstring(arrayobject *self, PyObject *args)
return Py_None;
}
static char fromstring_doc [] =
PyDoc_STRVAR(fromstring_doc,
"fromstring(string)\n\
\n\
Appends items from the string, interpreting it as an array of machine\n\
values,as if it had been read from a file using the fromfile() method).";
values,as if it had been read from a file using the fromfile() method).");
static PyObject *
......@@ -1285,11 +1285,11 @@ array_tostring(arrayobject *self, PyObject *args)
self->ob_size * self->ob_descr->itemsize);
}
static char tostring_doc [] =
PyDoc_STRVAR(tostring_doc,
"tostring() -> string\n\
\n\
Convert the array to an array of machine values and return the string\n\
representation.";
representation.");
......@@ -1325,13 +1325,13 @@ array_fromunicode(arrayobject *self, PyObject *args)
return Py_None;
}
static char fromunicode_doc[] =
PyDoc_STRVAR(fromunicode_doc,
"fromunicode(ustr)\n\
\n\
Extends this array with data from the unicode string ustr.\n\
The array must be a type 'u' array; otherwise a ValueError\n\
is raised. Use array.fromstring(ustr.decode(...)) to\n\
append Unicode data to an array of some other type.";
append Unicode data to an array of some other type.");
static PyObject *
......@@ -1347,13 +1347,13 @@ array_tounicode(arrayobject *self, PyObject *args)
return PyUnicode_FromUnicode((Py_UNICODE *) self->ob_item, self->ob_size);
}
static char tounicode_doc [] =
PyDoc_STRVAR(tounicode_doc,
"tounicode() -> unicode\n\
\n\
Convert the array to a unicode string. The array must be\n\
a type 'u' array; otherwise a ValueError is raised. Use\n\
array.tostring().decode() to obtain a unicode string from\n\
an array of some other type.";
an array of some other type.");
#endif /* Py_USING_UNICODE */
......@@ -1621,7 +1621,7 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
}
static char module_doc [] =
PyDoc_STRVAR(module_doc,
"This module defines an object type which can efficiently represent\n\
an array of basic values: characters, integers, floating point\n\
numbers. Arrays are sequence types and behave very much like lists,\n\
......@@ -1646,9 +1646,9 @@ is a single character. The following type codes are defined:\n\
The constructor is:\n\
\n\
array(typecode [, initializer]) -- create a new array\n\
";
");
static char arraytype_doc [] =
PyDoc_STRVAR(arraytype_doc,
"array(typecode [, initializer]) -> array\n\
\n\
Return a new array whose items are restricted by typecode, and\n\
......@@ -1683,7 +1683,7 @@ Attributes:\n\
\n\
typecode -- the typecode character used to create the array\n\
itemsize -- the length in bytes of one array item\n\
";
");
statichere PyTypeObject Arraytype = {
PyObject_HEAD_INIT(NULL)
......
......@@ -179,7 +179,7 @@ static unsigned short crctab_hqx[256] = {
0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0,
};
static char doc_a2b_uu[] = "(ascii) -> bin. Decode a line of uuencoded data";
PyDoc_STRVAR(doc_a2b_uu, "(ascii) -> bin. Decode a line of uuencoded data");
static PyObject *
binascii_a2b_uu(PyObject *self, PyObject *args)
......@@ -254,7 +254,7 @@ binascii_a2b_uu(PyObject *self, PyObject *args)
return rv;
}
static char doc_b2a_uu[] = "(bin) -> ascii. Uuencode line of data";
PyDoc_STRVAR(doc_b2a_uu, "(bin) -> ascii. Uuencode line of data");
static PyObject *
binascii_b2a_uu(PyObject *self, PyObject *args)
......@@ -330,7 +330,7 @@ binascii_find_valid(unsigned char *s, int slen, int num)
return ret;
}
static char doc_a2b_base64[] = "(ascii) -> bin. Decode a line of base64 data";
PyDoc_STRVAR(doc_a2b_base64, "(ascii) -> bin. Decode a line of base64 data");
static PyObject *
binascii_a2b_base64(PyObject *self, PyObject *args)
......@@ -417,7 +417,7 @@ binascii_a2b_base64(PyObject *self, PyObject *args)
return rv;
}
static char doc_b2a_base64[] = "(bin) -> ascii. Base64-code line of data";
PyDoc_STRVAR(doc_b2a_base64, "(bin) -> ascii. Base64-code line of data");
static PyObject *
binascii_b2a_base64(PyObject *self, PyObject *args)
......@@ -470,7 +470,7 @@ binascii_b2a_base64(PyObject *self, PyObject *args)
return rv;
}
static char doc_a2b_hqx[] = "ascii -> bin, done. Decode .hqx coding";
PyDoc_STRVAR(doc_a2b_hqx, "ascii -> bin, done. Decode .hqx coding");
static PyObject *
binascii_a2b_hqx(PyObject *self, PyObject *args)
......@@ -534,7 +534,7 @@ binascii_a2b_hqx(PyObject *self, PyObject *args)
return NULL;
}
static char doc_rlecode_hqx[] = "Binhex RLE-code binary data";
PyDoc_STRVAR(doc_rlecode_hqx, "Binhex RLE-code binary data");
static PyObject *
binascii_rlecode_hqx(PyObject *self, PyObject *args)
......@@ -581,7 +581,7 @@ binascii_rlecode_hqx(PyObject *self, PyObject *args)
return rv;
}
static char doc_b2a_hqx[] = "Encode .hqx data";
PyDoc_STRVAR(doc_b2a_hqx, "Encode .hqx data");
static PyObject *
binascii_b2a_hqx(PyObject *self, PyObject *args)
......@@ -621,7 +621,7 @@ binascii_b2a_hqx(PyObject *self, PyObject *args)
return rv;
}
static char doc_rledecode_hqx[] = "Decode hexbin RLE-coded string";
PyDoc_STRVAR(doc_rledecode_hqx, "Decode hexbin RLE-coded string");
static PyObject *
binascii_rledecode_hqx(PyObject *self, PyObject *args)
......@@ -717,8 +717,8 @@ binascii_rledecode_hqx(PyObject *self, PyObject *args)
return rv;
}
static char doc_crc_hqx[] =
"(data, oldcrc) -> newcrc. Compute hqx CRC incrementally";
PyDoc_STRVAR(doc_crc_hqx,
"(data, oldcrc) -> newcrc. Compute hqx CRC incrementally");
static PyObject *
binascii_crc_hqx(PyObject *self, PyObject *args)
......@@ -737,8 +737,8 @@ binascii_crc_hqx(PyObject *self, PyObject *args)
return Py_BuildValue("i", crc);
}
static char doc_crc32[] =
"(data, oldcrc = 0) -> newcrc. Compute CRC-32 incrementally";
PyDoc_STRVAR(doc_crc32,
"(data, oldcrc = 0) -> newcrc. Compute CRC-32 incrementally");
/* Crc - 32 BIT ANSI X3.66 CRC checksum files
Also known as: ISO 3307
......@@ -912,10 +912,10 @@ binascii_hexlify(PyObject *self, PyObject *args)
return NULL;
}
static char doc_hexlify[] =
PyDoc_STRVAR(doc_hexlify,
"b2a_hex(data) -> s; Hexadecimal representation of binary data.\n\
\n\
This function is also available as \"hexlify()\".";
This function is also available as \"hexlify()\".");
static int
......@@ -978,11 +978,11 @@ binascii_unhexlify(PyObject *self, PyObject *args)
return NULL;
}
static char doc_unhexlify[] =
PyDoc_STRVAR(doc_unhexlify,
"a2b_hex(hexstr) -> s; Binary data of hexadecimal representation.\n\
\n\
hexstr must contain an even number of hex digits (upper or lower case).\n\
This function is also available as \"unhexlify()\"";
This function is also available as \"unhexlify()\"");
static int table_hex[128] = {
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
......@@ -999,7 +999,7 @@ static int table_hex[128] = {
#define MAXLINESIZE 76
static char doc_a2b_qp[] = "Decode a string of qp-encoded data";
PyDoc_STRVAR(doc_a2b_qp, "Decode a string of qp-encoded data");
static PyObject*
binascii_a2b_qp(PyObject *self, PyObject *args, PyObject *kwargs)
......@@ -1088,13 +1088,13 @@ to_hex (unsigned char ch, unsigned char *s)
return 0;
}
static char doc_b2a_qp[] =
PyDoc_STRVAR(doc_b2a_qp,
"b2a_qp(data, quotetabs=0, istext=1, header=0) -> s; \n\
Encode a string using quoted-printable encoding. \n\
\n\
On encoding, when istext is set, newlines are not encoded, and white \n\
space at end of lines is. When istext is not set, \\r and \\n (CR/LF) are \n\
both encoded. When quotetabs is set, space and tabs are encoded.";
both encoded. When quotetabs is set, space and tabs are encoded.");
/* XXX: This is ridiculously complicated to be backward compatible
* (mostly) with the quopri module. It doesn't re-create the quopri
......@@ -1295,7 +1295,7 @@ static struct PyMethodDef binascii_module_methods[] = {
/* Initialization function for the module (*must* be called initbinascii) */
static char doc_binascii[] = "Conversion between binary data and ASCII";
PyDoc_STRVAR(doc_binascii, "Conversion between binary data and ASCII");
DL_EXPORT(void)
initbinascii(void)
......
static char cPickle_module_documentation[] =
"C implementation and optimization of the Python pickle module\n"
"\n"
"cPickle.c,v 1.71 1999/07/11 13:30:34 jim Exp\n"
;
#include "Python.h"
#include "cStringIO.h"
#include "structmember.h"
PyDoc_STRVAR(cPickle_module_documentation,
"C implementation and optimization of the Python pickle module\n"
"\n"
"cPickle.c,v 1.71 1999/07/11 13:30:34 jim Exp\n");
#ifndef Py_eval_input
#include <graminit.h>
#define Py_eval_input eval_input
......@@ -2511,8 +2510,8 @@ static PyGetSetDef Pickler_getsets[] = {
{NULL}
};
static char Picklertype__doc__[] =
"Objects that know how to pickle objects\n";
PyDoc_STRVAR(Picklertype__doc__,
"Objects that know how to pickle objects\n");
static PyTypeObject Picklertype = {
PyObject_HEAD_INIT(NULL)
......@@ -4609,8 +4608,8 @@ cpm_loads(PyObject *self, PyObject *args)
}
static char Unpicklertype__doc__[] =
"Objects that know how to unpickle";
PyDoc_STRVAR(Unpicklertype__doc__,
"Objects that know how to unpickle");
static PyTypeObject Unpicklertype = {
PyObject_HEAD_INIT(NULL)
......
static char cStringIO_module_documentation[] =
#include "Python.h"
#include "import.h"
#include "cStringIO.h"
PyDoc_STRVAR(cStringIO_module_documentation,
"A simple fast partial StringIO replacement.\n"
"\n"
"This module provides a simple useful replacement for\n"
......@@ -25,12 +30,7 @@ static char cStringIO_module_documentation[] =
"If someone else wants to provide a more complete implementation,\n"
"go for it. :-) \n"
"\n"
"cStringIO.c,v 1.29 1999/06/15 14:10:27 jim Exp\n"
;
#include "Python.h"
#include "import.h"
#include "cStringIO.h"
"cStringIO.c,v 1.29 1999/06/15 14:10:27 jim Exp\n");
#define UNLESS(E) if (!(E))
......@@ -74,7 +74,7 @@ typedef struct { /* Subtype of IOobject */
/* IOobject (common) methods */
static char IO_flush__doc__[] = "flush(): does nothing.";
PyDoc_STRVAR(IO_flush__doc__, "flush(): does nothing.");
static int
IO__opencheck(IOobject *self) {
......@@ -96,12 +96,11 @@ IO_flush(IOobject *self, PyObject *args) {
return Py_None;
}
static char IO_getval__doc__[] =
"getvalue([use_pos]) -- Get the string value."
"\n"
"If use_pos is specified and is a true value, then the string returned\n"
"will include only the text up to the current file position.\n"
;
PyDoc_STRVAR(IO_getval__doc__,
"getvalue([use_pos]) -- Get the string value."
"\n"
"If use_pos is specified and is a true value, then the string returned\n"
"will include only the text up to the current file position.\n");
static PyObject *
IO_cgetval(PyObject *self) {
......@@ -127,7 +126,7 @@ IO_getval(IOobject *self, PyObject *args) {
return PyString_FromStringAndSize(self->buf, s);
}
static char IO_isatty__doc__[] = "isatty(): always returns 0";
PyDoc_STRVAR(IO_isatty__doc__, "isatty(): always returns 0");
static PyObject *
IO_isatty(IOobject *self, PyObject *args) {
......@@ -137,9 +136,8 @@ IO_isatty(IOobject *self, PyObject *args) {
return PyInt_FromLong(0);
}
static char IO_read__doc__[] =
"read([s]) -- Read s characters, or the rest of the string"
;
PyDoc_STRVAR(IO_read__doc__,
"read([s]) -- Read s characters, or the rest of the string");
static int
IO_cread(PyObject *self, char **output, int n) {
......@@ -169,9 +167,7 @@ IO_read(IOobject *self, PyObject *args) {
return PyString_FromStringAndSize(output, n);
}
static char IO_readline__doc__[] =
"readline() -- Read one line"
;
PyDoc_STRVAR(IO_readline__doc__, "readline() -- Read one line");
static int
IO_creadline(PyObject *self, char **output) {
......@@ -207,9 +203,7 @@ IO_readline(IOobject *self, PyObject *args) {
return PyString_FromStringAndSize(output, n);
}
static char IO_readlines__doc__[] =
"readlines() -- Read all lines"
;
PyDoc_STRVAR(IO_readlines__doc__, "readlines() -- Read all lines");
static PyObject *
IO_readlines(IOobject *self, PyObject *args) {
......@@ -244,9 +238,8 @@ IO_readlines(IOobject *self, PyObject *args) {
return NULL;
}
static char IO_reset__doc__[] =
"reset() -- Reset the file position to the beginning"
;
PyDoc_STRVAR(IO_reset__doc__,
"reset() -- Reset the file position to the beginning");
static PyObject *
IO_reset(IOobject *self, PyObject *args) {
......@@ -260,8 +253,7 @@ IO_reset(IOobject *self, PyObject *args) {
return Py_None;
}
static char IO_tell__doc__[] =
"tell() -- get the current position.";
PyDoc_STRVAR(IO_tell__doc__, "tell() -- get the current position.");
static PyObject *
IO_tell(IOobject *self, PyObject *args) {
......@@ -272,8 +264,8 @@ IO_tell(IOobject *self, PyObject *args) {
return PyInt_FromLong(self->pos);
}
static char IO_truncate__doc__[] =
"truncate(): truncate the file at the current position.";
PyDoc_STRVAR(IO_truncate__doc__,
"truncate(): truncate the file at the current position.");
static PyObject *
IO_truncate(IOobject *self, PyObject *args) {
......@@ -294,9 +286,9 @@ IO_truncate(IOobject *self, PyObject *args) {
/* Read-write object methods */
static char O_seek__doc__[] =
PyDoc_STRVAR(O_seek__doc__,
"seek(position) -- set the current position\n"
"seek(position, mode) -- mode 0: absolute; 1: relative; 2: relative to EOF";
"seek(position, mode) -- mode 0: absolute; 1: relative; 2: relative to EOF");
static PyObject *
O_seek(Oobject *self, PyObject *args) {
......@@ -332,10 +324,9 @@ O_seek(Oobject *self, PyObject *args) {
return Py_None;
}
static char O_write__doc__[] =
PyDoc_STRVAR(O_write__doc__,
"write(s) -- Write a string to the file"
"\n\nNote (hack:) writing None resets the buffer"
;
"\n\nNote (hack:) writing None resets the buffer");
static int
......@@ -384,7 +375,7 @@ O_write(Oobject *self, PyObject *args) {
return Py_None;
}
static char O_close__doc__[] = "close(): explicitly release resources held.";
PyDoc_STRVAR(O_close__doc__, "close(): explicitly release resources held.");
static PyObject *
O_close(Oobject *self, PyObject *args) {
......@@ -401,8 +392,8 @@ O_close(Oobject *self, PyObject *args) {
}
static char O_writelines__doc__[] =
"writelines(sequence_of_strings): write each string";
PyDoc_STRVAR(O_writelines__doc__,
"writelines(sequence_of_strings): write each string");
static PyObject *
O_writelines(Oobject *self, PyObject *args) {
PyObject *tmp = 0;
......@@ -483,9 +474,7 @@ O_setattr(Oobject *self, char *name, PyObject *value) {
return 0;
}
static char Otype__doc__[] =
"Simple type for output to strings."
;
PyDoc_STRVAR(Otype__doc__, "Simple type for output to strings.");
static PyTypeObject Otype = {
PyObject_HEAD_INIT(NULL)
......@@ -617,9 +606,8 @@ I_getiter(Iobject *self)
}
static char Itype__doc__[] =
"Simple type for treating strings as input file streams"
;
PyDoc_STRVAR(Itype__doc__,
"Simple type for treating strings as input file streams");
static PyTypeObject Itype = {
PyObject_HEAD_INIT(NULL)
......@@ -678,9 +666,8 @@ newIobject(PyObject *s) {
/* -------------------------------------------------------- */
static char IO_StringIO__doc__[] =
"StringIO([s]) -- Return a StringIO-like stream for reading or writing"
;
PyDoc_STRVAR(IO_StringIO__doc__,
"StringIO([s]) -- Return a StringIO-like stream for reading or writing");
static PyObject *
IO_StringIO(PyObject *self, PyObject *args) {
......
......@@ -29,10 +29,10 @@ c_acos(Py_complex x)
c_sqrt(c_diff(c_one,c_prod(x,x))))))));
}
static char c_acos_doc[] =
PyDoc_STRVAR(c_acos_doc,
"acos(x)\n"
"\n"
"Return the arc cosine of x.";
"Return the arc cosine of x.");
static Py_complex
......@@ -45,10 +45,10 @@ c_acosh(Py_complex x)
return c_sum(z, z);
}
static char c_acosh_doc[] =
PyDoc_STRVAR(c_acosh_doc,
"acosh(x)\n"
"\n"
"Return the hyperbolic arccosine of x.";
"Return the hyperbolic arccosine of x.");
static Py_complex
......@@ -62,10 +62,10 @@ c_asin(Py_complex x)
) ) );
}
static char c_asin_doc[] =
PyDoc_STRVAR(c_asin_doc,
"asin(x)\n"
"\n"
"Return the arc sine of x.";
"Return the arc sine of x.");
static Py_complex
......@@ -78,10 +78,10 @@ c_asinh(Py_complex x)
return c_sum(z, z);
}
static char c_asinh_doc[] =
PyDoc_STRVAR(c_asinh_doc,
"asinh(x)\n"
"\n"
"Return the hyperbolic arc sine of x.";
"Return the hyperbolic arc sine of x.");
static Py_complex
......@@ -90,10 +90,10 @@ c_atan(Py_complex x)
return c_prod(c_halfi,c_log(c_quot(c_sum(c_i,x),c_diff(c_i,x))));
}
static char c_atan_doc[] =
PyDoc_STRVAR(c_atan_doc,
"atan(x)\n"
"\n"
"Return the arc tangent of x.";
"Return the arc tangent of x.");
static Py_complex
......@@ -102,10 +102,10 @@ c_atanh(Py_complex x)
return c_prod(c_half,c_log(c_quot(c_sum(c_one,x),c_diff(c_one,x))));
}
static char c_atanh_doc[] =
PyDoc_STRVAR(c_atanh_doc,
"atanh(x)\n"
"\n"
"Return the hyperbolic arc tangent of x.";
"Return the hyperbolic arc tangent of x.");
static Py_complex
......@@ -117,10 +117,10 @@ c_cos(Py_complex x)
return r;
}
static char c_cos_doc[] =
PyDoc_STRVAR(c_cos_doc,
"cos(x)\n"
"n"
"Return the cosine of x.";
"Return the cosine of x.");
static Py_complex
......@@ -132,10 +132,10 @@ c_cosh(Py_complex x)
return r;
}
static char c_cosh_doc[] =
PyDoc_STRVAR(c_cosh_doc,
"cosh(x)\n"
"n"
"Return the hyperbolic cosine of x.";
"Return the hyperbolic cosine of x.");
static Py_complex
......@@ -148,10 +148,10 @@ c_exp(Py_complex x)
return r;
}
static char c_exp_doc[] =
PyDoc_STRVAR(c_exp_doc,
"exp(x)\n"
"\n"
"Return the exponential value e**x.";
"Return the exponential value e**x.");
static Py_complex
......@@ -164,10 +164,10 @@ c_log(Py_complex x)
return r;
}
static char c_log_doc[] =
PyDoc_STRVAR(c_log_doc,
"log(x)\n"
"\n"
"Return the natural logarithm of x.";
"Return the natural logarithm of x.");
static Py_complex
......@@ -180,10 +180,10 @@ c_log10(Py_complex x)
return r;
}
static char c_log10_doc[] =
PyDoc_STRVAR(c_log10_doc,
"log10(x)\n"
"\n"
"Return the base-10 logarithm of x.";
"Return the base-10 logarithm of x.");
/* internal function not available from Python */
......@@ -206,10 +206,10 @@ c_sin(Py_complex x)
return r;
}
static char c_sin_doc[] =
PyDoc_STRVAR(c_sin_doc,
"sin(x)\n"
"\n"
"Return the sine of x.";
"Return the sine of x.");
static Py_complex
......@@ -221,10 +221,10 @@ c_sinh(Py_complex x)
return r;
}
static char c_sinh_doc[] =
PyDoc_STRVAR(c_sinh_doc,
"sinh(x)\n"
"\n"
"Return the hyperbolic sine of x.";
"Return the hyperbolic sine of x.");
static Py_complex
......@@ -253,10 +253,10 @@ c_sqrt(Py_complex x)
return r;
}
static char c_sqrt_doc[] =
PyDoc_STRVAR(c_sqrt_doc,
"sqrt(x)\n"
"\n"
"Return the square root of x.";
"Return the square root of x.");
static Py_complex
......@@ -280,10 +280,10 @@ c_tan(Py_complex x)
return r;
}
static char c_tan_doc[] =
PyDoc_STRVAR(c_tan_doc,
"tan(x)\n"
"\n"
"Return the tangent of x.";
"Return the tangent of x.");
static Py_complex
......@@ -307,10 +307,10 @@ c_tanh(Py_complex x)
return r;
}
static char c_tanh_doc[] =
PyDoc_STRVAR(c_tanh_doc,
"tanh(x)\n"
"\n"
"Return the hyperbolic tangent of x.";
"Return the hyperbolic tangent of x.");
/* And now the glue to make them available from Python: */
......@@ -367,9 +367,9 @@ FUNC1(cmath_tan, c_tan)
FUNC1(cmath_tanh, c_tanh)
static char module_doc[] =
PyDoc_STRVAR(module_doc,
"This module is always available. It provides access to mathematical\n"
"functions for complex numbers.";
"functions for complex numbers.");
static PyMethodDef cmath_methods[] = {
{"acos", cmath_acos, METH_VARARGS, c_acos_doc},
......
......@@ -23,13 +23,13 @@ static PyObject *crypt_crypt(PyObject *self, PyObject *args)
}
static char crypt_crypt__doc__[] = "\
crypt(word, salt) -> string\n\
PyDoc_STRVAR(crypt_crypt__doc__,
"crypt(word, salt) -> string\n\
word will usually be a user's password. salt is a 2-character string\n\
which will be used to select one of 4096 variations of DES. The characters\n\
in salt must be either \".\", \"/\", or an alphanumeric character. Returns\n\
the hashed password as a string, which will be composed of characters from\n\
the same alphabet as the salt.";
the same alphabet as the salt.");
static PyMethodDef crypt_methods[] = {
......
......@@ -43,7 +43,7 @@ _inscode(PyObject *d, PyObject *de, char *name, int code)
Py_XDECREF(v);
}
static char errno__doc__ [] =
PyDoc_STRVAR(errno__doc__,
"This module makes available standard errno system symbols.\n\
\n\
The value of each symbol is the corresponding integer value,\n\
......@@ -55,7 +55,7 @@ e.g., errno.errorcode[2] could be the string 'ENOENT'.\n\
Symbols that are not relevant to the underlying system are not defined.\n\
\n\
To map error codes to error messages, use the function os.strerror(),\n\
e.g. os.strerror(2) could return 'No such file or directory'.";
e.g. os.strerror(2) could return 'No such file or directory'.");
DL_EXPORT(void)
initerrno(void)
......
......@@ -72,8 +72,7 @@ fcntl_fcntl(PyObject *self, PyObject *args)
return PyInt_FromLong((long)ret);
}
static char fcntl_doc [] =
PyDoc_STRVAR(fcntl_doc,
"fcntl(fd, opt, [arg])\n\
\n\
Perform the requested operation on file descriptor fd. The operation\n\
......@@ -84,7 +83,7 @@ the return value of fcntl is a string of that length, containing the\n\
resulting value put in the arg buffer by the operating system.The length\n\
of the arg string is not allowed to exceed 1024 bytes. If the arg given\n\
is an integer or if none is specified, the result value is an integer\n\
corresponding to the return value of the fcntl call in the C code.";
corresponding to the return value of the fcntl call in the C code.");
/* ioctl(fd, opt, [arg]) */
......@@ -136,7 +135,7 @@ fcntl_ioctl(PyObject *self, PyObject *args)
return PyInt_FromLong((long)ret);
}
static char ioctl_doc [] =
PyDoc_STRVAR(ioctl_doc,
"ioctl(fd, opt, [arg])\n\
\n\
Perform the requested operation on file descriptor fd. The operation\n\
......@@ -147,7 +146,7 @@ given as a string, the return value of ioctl is a string of that length,\n\
containing the resulting value put in the arg buffer by the operating system.\n\
The length of the arg string is not allowed to exceed 1024 bytes. If the arg\n\
given is an integer or if none is specified, the result value is an integer\n\
corresponding to the return value of the ioctl call in the C code.";
corresponding to the return value of the ioctl call in the C code.");
/* flock(fd, operation) */
......@@ -202,12 +201,12 @@ fcntl_flock(PyObject *self, PyObject *args)
return Py_None;
}
static char flock_doc [] =
PyDoc_STRVAR(flock_doc,
"flock(fd, operation)\n\
\n\
Perform the lock operation op on file descriptor fd. See the Unix \n\
manual flock(3) for details. (On some systems, this function is\n\
emulated using fcntl().)";
emulated using fcntl().)");
/* lockf(fd, operation) */
......@@ -283,7 +282,7 @@ fcntl_lockf(PyObject *self, PyObject *args)
#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
}
static char lockf_doc [] =
PyDoc_STRVAR(lockf_doc,
"lockf (fd, operation, length=0, start=0, whence=0)\n\
\n\
This is essentially a wrapper around the fcntl() locking calls. fd is the\n\
......@@ -306,7 +305,7 @@ starts. whence is as with fileobj.seek(), specifically:\n\
\n\
0 - relative to the start of the file (SEEK_SET)\n\
1 - relative to the current buffer position (SEEK_CUR)\n\
2 - relative to the end of the file (SEEK_END)";
2 - relative to the end of the file (SEEK_END)");
/* List of functions */
......@@ -319,12 +318,11 @@ static PyMethodDef fcntl_methods[] = {
};
static char module_doc [] =
PyDoc_STRVAR(module_doc,
"This module performs file control and I/O control on file \n\
descriptors. It is an interface to the fcntl() and ioctl() Unix\n\
routines. File descriptors can be obtained with the fileno() method of\n\
a file or socket object.";
a file or socket object.");
/* Module initialisation */
......
......@@ -508,11 +508,10 @@ collect_generations(void)
return n;
}
static char gc_enable__doc__[] =
PyDoc_STRVAR(gc_enable__doc__,
"enable() -> None\n"
"\n"
"Enable automatic garbage collection.\n"
;
"Enable automatic garbage collection.\n");
static PyObject *
gc_enable(PyObject *self, PyObject *args)
......@@ -527,11 +526,10 @@ gc_enable(PyObject *self, PyObject *args)
return Py_None;
}
static char gc_disable__doc__[] =
PyDoc_STRVAR(gc_disable__doc__,
"disable() -> None\n"
"\n"
"Disable automatic garbage collection.\n"
;
"Disable automatic garbage collection.\n");
static PyObject *
gc_disable(PyObject *self, PyObject *args)
......@@ -546,11 +544,10 @@ gc_disable(PyObject *self, PyObject *args)
return Py_None;
}
static char gc_isenabled__doc__[] =
PyDoc_STRVAR(gc_isenabled__doc__,
"isenabled() -> status\n"
"\n"
"Returns true if automatic garbage collection is enabled.\n"
;
"Returns true if automatic garbage collection is enabled.\n");
static PyObject *
gc_isenabled(PyObject *self, PyObject *args)
......@@ -562,11 +559,10 @@ gc_isenabled(PyObject *self, PyObject *args)
return Py_BuildValue("i", enabled);
}
static char gc_collect__doc__[] =
PyDoc_STRVAR(gc_collect__doc__,
"collect() -> n\n"
"\n"
"Run a full collection. The number of unreachable objects is returned.\n"
;
"Run a full collection. The number of unreachable objects is returned.\n");
static PyObject *
gc_collect(PyObject *self, PyObject *args)
......@@ -588,7 +584,7 @@ gc_collect(PyObject *self, PyObject *args)
return Py_BuildValue("l", n);
}
static char gc_set_debug__doc__[] =
PyDoc_STRVAR(gc_set_debug__doc__,
"set_debug(flags) -> None\n"
"\n"
"Set the garbage collection debugging flags. Debugging information is\n"
......@@ -602,8 +598,7 @@ static char gc_set_debug__doc__[] =
" DEBUG_INSTANCES - Print instance objects.\n"
" DEBUG_OBJECTS - Print objects other than instances.\n"
" DEBUG_SAVEALL - Save objects to gc.garbage rather than freeing them.\n"
" DEBUG_LEAK - Debug leaking programs (everything but STATS).\n"
;
" DEBUG_LEAK - Debug leaking programs (everything but STATS).\n");
static PyObject *
gc_set_debug(PyObject *self, PyObject *args)
......@@ -615,11 +610,10 @@ gc_set_debug(PyObject *self, PyObject *args)
return Py_None;
}
static char gc_get_debug__doc__[] =
PyDoc_STRVAR(gc_get_debug__doc__,
"get_debug() -> flags\n"
"\n"
"Get the garbage collection debugging flags.\n"
;
"Get the garbage collection debugging flags.\n");
static PyObject *
gc_get_debug(PyObject *self, PyObject *args)
......@@ -630,12 +624,11 @@ gc_get_debug(PyObject *self, PyObject *args)
return Py_BuildValue("i", debug);
}
static char gc_set_thresh__doc__[] =
PyDoc_STRVAR(gc_set_thresh__doc__,
"set_threshold(threshold0, [threshold1, threshold2]) -> None\n"
"\n"
"Sets the collection thresholds. Setting threshold0 to zero disables\n"
"collection.\n"
;
"collection.\n");
static PyObject *
gc_set_thresh(PyObject *self, PyObject *args)
......@@ -655,11 +648,10 @@ gc_set_thresh(PyObject *self, PyObject *args)
return Py_None;
}
static char gc_get_thresh__doc__[] =
PyDoc_STRVAR(gc_get_thresh__doc__,
"get_threshold() -> (threshold0, threshold1, threshold2)\n"
"\n"
"Return the current collection thresholds\n"
;
"Return the current collection thresholds\n");
static PyObject *
gc_get_thresh(PyObject *self, PyObject *args)
......@@ -702,9 +694,9 @@ gc_referrers_for(PyObject *objs, PyGC_Head *list, PyObject *resultlist)
return 1; /* no error */
}
static char gc_get_referrers__doc__[]=
PyDoc_STRVAR(gc_get_referrers__doc__,
"get_referrers(*objs) -> list\n\
Return the list of objects that directly refer to any of objs.";
Return the list of objects that directly refer to any of objs.");
static PyObject *
gc_get_referrers(PyObject *self, PyObject *args)
......@@ -720,12 +712,11 @@ gc_get_referrers(PyObject *self, PyObject *args)
return result;
}
static char gc_get_objects__doc__[] =
PyDoc_STRVAR(gc_get_objects__doc__,
"get_objects() -> [...]\n"
"\n"
"Return a list of objects tracked by the collector (excluding the list\n"
"returned).\n"
;
"returned).\n");
/* appending objects in a GC list to a Python list */
static int
......@@ -765,7 +756,7 @@ gc_get_objects(PyObject *self, PyObject *args)
}
static char gc__doc__ [] =
PyDoc_STRVAR(gc__doc__,
"This module provides access to the garbage collector for reference cycles.\n"
"\n"
"enable() -- Enable automatic garbage collection.\n"
......@@ -777,8 +768,7 @@ static char gc__doc__ [] =
"set_threshold() -- Set the collection thresholds.\n"
"get_threshold() -- Return the current the collection thresholds.\n"
"get_objects() -- Return a list of all objects tracked by the collector.\n"
"get_referrers() -- Return the list of objects that refer to an object.\n"
;
"get_referrers() -- Return the list of objects that refer to an object.\n");
static PyMethodDef GcMethods[] = {
{"enable", gc_enable, METH_VARARGS, gc_enable__doc__},
......
......@@ -16,8 +16,8 @@
extern const char * gdbm_strerror(gdbm_error);
#endif
static char gdbmmodule__doc__[] = "\
This module provides an interface to the GNU DBM (GDBM) library.\n\
PyDoc_STRVAR(gdbmmodule__doc__,
"This module provides an interface to the GNU DBM (GDBM) library.\n\
\n\
This module is quite similar to the dbm module, but uses GDBM instead to\n\
provide some additional functionality. Please note that the file formats\n\
......@@ -26,7 +26,7 @@ created by GDBM and dbm are incompatible. \n\
GDBM objects behave like mappings (dictionaries), except that keys and\n\
values are always strings. Printing a GDBM object doesn't print the\n\
keys and values, and the items() and values() methods are not\n\
supported.";
supported.");
typedef struct {
PyObject_HEAD
......@@ -45,15 +45,15 @@ staticforward PyTypeObject Dbmtype;
static PyObject *DbmError;
static char gdbm_object__doc__[] = "\
This object represents a GDBM database.\n\
PyDoc_STRVAR(gdbm_object__doc__,
"This object represents a GDBM database.\n\
GDBM objects behave like mappings (dictionaries), except that keys and\n\
values are always strings. Printing a GDBM object doesn't print the\n\
keys and values, and the items() and values() methods are not\n\
supported.\n\
\n\
GDBM objects also support additional operations such as firstkey,\n\
nextkey, reorganize, and sync.";
nextkey, reorganize, and sync.");
static PyObject *
newdbmobject(char *file, int flags, int mode)
......@@ -183,9 +183,9 @@ static PyMappingMethods dbm_as_mapping = {
(objobjargproc)dbm_ass_sub, /*mp_ass_subscript*/
};
static char dbm_close__doc__[] = "\
close() -> None\n\
Closes the database.";
PyDoc_STRVAR(dbm_close__doc__,
"close() -> None\n\
Closes the database.");
static PyObject *
dbm_close(register dbmobject *dp, PyObject *args)
......@@ -199,9 +199,9 @@ dbm_close(register dbmobject *dp, PyObject *args)
return Py_None;
}
static char dbm_keys__doc__[] = "\
keys() -> list_of_keys\n\
Get a list of all keys in the database.";
PyDoc_STRVAR(dbm_keys__doc__,
"keys() -> list_of_keys\n\
Get a list of all keys in the database.");
static PyObject *
dbm_keys(register dbmobject *dp, PyObject *args)
......@@ -245,9 +245,9 @@ dbm_keys(register dbmobject *dp, PyObject *args)
return v;
}
static char dbm_has_key__doc__[] = "\
has_key(key) -> boolean\n\
Find out whether or not the database contains a given key.";
PyDoc_STRVAR(dbm_has_key__doc__,
"has_key(key) -> boolean\n\
Find out whether or not the database contains a given key.");
static PyObject *
dbm_has_key(register dbmobject *dp, PyObject *args)
......@@ -260,12 +260,12 @@ dbm_has_key(register dbmobject *dp, PyObject *args)
return PyInt_FromLong((long) gdbm_exists(dp->di_dbm, key));
}
static char dbm_firstkey__doc__[] = "\
firstkey() -> key\n\
PyDoc_STRVAR(dbm_firstkey__doc__,
"firstkey() -> key\n\
It's possible to loop over every key in the database using this method\n\
and the nextkey() method. The traversal is ordered by GDBM's internal\n\
hash values, and won't be sorted by the key values. This method\n\
returns the starting key.";
returns the starting key.");
static PyObject *
dbm_firstkey(register dbmobject *dp, PyObject *args)
......@@ -288,8 +288,8 @@ dbm_firstkey(register dbmobject *dp, PyObject *args)
}
}
static char dbm_nextkey__doc__[] = "\
nextkey(key) -> next_key\n\
PyDoc_STRVAR(dbm_nextkey__doc__,
"nextkey(key) -> next_key\n\
Returns the key that follows key in the traversal.\n\
The following code prints every key in the database db, without having\n\
to create a list in memory that contains them all:\n\
......@@ -297,7 +297,7 @@ to create a list in memory that contains them all:\n\
k = db.firstkey()\n\
while k != None:\n\
print k\n\
k = db.nextkey(k)";
k = db.nextkey(k)");
static PyObject *
dbm_nextkey(register dbmobject *dp, PyObject *args)
......@@ -320,13 +320,13 @@ dbm_nextkey(register dbmobject *dp, PyObject *args)
}
}
static char dbm_reorganize__doc__[] = "\
reorganize() -> None\n\
PyDoc_STRVAR(dbm_reorganize__doc__,
"reorganize() -> None\n\
If you have carried out a lot of deletions and would like to shrink\n\
the space used by the GDBM file, this routine will reorganize the\n\
database. GDBM will not shorten the length of a database file except\n\
by using this reorganization; otherwise, deleted file space will be\n\
kept and reused as new (key,value) pairs are added.";
kept and reused as new (key,value) pairs are added.");
static PyObject *
dbm_reorganize(register dbmobject *dp, PyObject *args)
......@@ -346,10 +346,10 @@ dbm_reorganize(register dbmobject *dp, PyObject *args)
return Py_None;
}
static char dbm_sync__doc__[] = "\
sync() -> None\n\
PyDoc_STRVAR(dbm_sync__doc__,
"sync() -> None\n\
When the database has been opened in fast mode, this method forces\n\
any unwritten data to be written to the disk.";
any unwritten data to be written to the disk.");
static PyObject *
dbm_sync(register dbmobject *dp, PyObject *args)
......@@ -406,8 +406,8 @@ static PyTypeObject Dbmtype = {
/* ----------------------------------------------------------------- */
static char dbmopen__doc__[] = "\
open(filename, [flags, [mode]]) -> dbm_object\n\
PyDoc_STRVAR(dbmopen__doc__,
"open(filename, [flags, [mode]]) -> dbm_object\n\
Open a dbm database and return a dbm object. The filename argument is\n\
the name of the database file.\n\
\n\
......@@ -428,7 +428,7 @@ The 's' flag causes all database operations to be synchronized to\n\
disk. The 'u' flag disables locking of the database file.\n\
\n\
The optional mode argument is the Unix mode of the file, used only\n\
when the database has to be created. It defaults to octal 0666. ";
when the database has to be created. It defaults to octal 0666. ");
static PyObject *
dbmopen(PyObject *self, PyObject *args)
......
......@@ -15,11 +15,11 @@ static PyStructSequence_Field struct_group_type_fields[] = {
{0}
};
static char struct_group__doc__[] =
PyDoc_STRVAR(struct_group__doc__,
"grp.struct_group: Results from getgr*() routines.\n\n\
This object may be accessed either as a tuple of\n\
(gr_name,gr_passwd,gr_gid,gr_mem)\n\
or via the object attributes as named in the above tuple.\n";
or via the object attributes as named in the above tuple.\n");
static PyStructSequence_Desc struct_group_type_desc = {
"grp.struct_group",
......@@ -139,7 +139,7 @@ Return a list of all available group entries, in arbitrary order."},
{NULL, NULL} /* sentinel */
};
static char grp__doc__[] =
PyDoc_STRVAR(grp__doc__,
"Access to the Unix group database.\n\
\n\
Group entries are reported as 4-tuples containing the following fields\n\
......@@ -153,7 +153,7 @@ from the group database, in order:\n\
The gid is an integer, name and password are strings. (Note that most\n\
users are not explicitly listed as members of the groups they are in\n\
according to the password database. Check both databases to get\n\
complete membership information.)";
complete membership information.)");
DL_EXPORT(void)
......
......@@ -85,13 +85,13 @@ math_2(PyObject *args, double (*func) (double, double), char *argsfmt)
static PyObject * math_##funcname(PyObject *self, PyObject *args) { \
return math_1(args, func, "d:" #funcname); \
}\
static char math_##funcname##_doc [] = docstring;
PyDoc_STRVAR(math_##funcname##_doc, docstring);
#define FUNC2(funcname, func, docstring) \
static PyObject * math_##funcname(PyObject *self, PyObject *args) { \
return math_2(args, func, "dd:" #funcname); \
}\
static char math_##funcname##_doc [] = docstring;
PyDoc_STRVAR(math_##funcname##_doc, docstring);
FUNC1(acos, acos,
"acos(x)\n\nReturn the arc cosine (measured in radians) of x.")
......@@ -155,12 +155,12 @@ math_frexp(PyObject *self, PyObject *args)
return Py_BuildValue("(di)", x, i);
}
static char math_frexp_doc [] =
PyDoc_STRVAR(math_frexp_doc,
"frexp(x)\n"
"\n"
"Return the mantissa and exponent of x, as pair (m, e).\n"
"m is a float and e is an int, such that x = m * 2.**e.\n"
"If x is 0, m and e are both 0. Else 0.5 <= abs(m) < 1.0.";
"If x is 0, m and e are both 0. Else 0.5 <= abs(m) < 1.0.");
static PyObject *
math_ldexp(PyObject *self, PyObject *args)
......@@ -180,8 +180,8 @@ math_ldexp(PyObject *self, PyObject *args)
return PyFloat_FromDouble(x);
}
static char math_ldexp_doc [] =
"ldexp(x, i) -> x * (2**i)";
PyDoc_STRVAR(math_ldexp_doc,
"ldexp(x, i) -> x * (2**i)");
static PyObject *
math_modf(PyObject *self, PyObject *args)
......@@ -206,11 +206,11 @@ math_modf(PyObject *self, PyObject *args)
return Py_BuildValue("(dd)", x, y);
}
static char math_modf_doc [] =
PyDoc_STRVAR(math_modf_doc,
"modf(x)\n"
"\n"
"Return the fractional and integer parts of x. Both results carry the sign\n"
"of x. The integer part is returned as a real.";
"of x. The integer part is returned as a real.");
/* A decent logarithm is easy to compute even for huge longs, but libm can't
do that by itself -- loghelper can. func is log or log10, and name is
......@@ -262,8 +262,8 @@ math_log(PyObject *self, PyObject *args)
return loghelper(args, log, "log");
}
static char math_log_doc[] =
"log(x) -> the natural logarithm (base e) of x.";
PyDoc_STRVAR(math_log_doc,
"log(x) -> the natural logarithm (base e) of x.");
static PyObject *
math_log10(PyObject *self, PyObject *args)
......@@ -271,8 +271,8 @@ math_log10(PyObject *self, PyObject *args)
return loghelper(args, log10, "log10");
}
static char math_log10_doc[] =
"log10(x) -> the base 10 logarithm of x.";
PyDoc_STRVAR(math_log10_doc,
"log10(x) -> the base 10 logarithm of x.");
static const double degToRad = 3.141592653589793238462643383 / 180.0;
......@@ -285,8 +285,8 @@ math_degrees(PyObject *self, PyObject *args)
return PyFloat_FromDouble(x / degToRad);
}
static char math_degrees_doc[] =
"degrees(x) -> converts angle x from radians to degrees";
PyDoc_STRVAR(math_degrees_doc,
"degrees(x) -> converts angle x from radians to degrees");
static PyObject *
math_radians(PyObject *self, PyObject *args)
......@@ -297,8 +297,8 @@ math_radians(PyObject *self, PyObject *args)
return PyFloat_FromDouble(x * degToRad);
}
static char math_radians_doc[] =
"radians(x) -> converts angle x from degrees to radians";
PyDoc_STRVAR(math_radians_doc,
"radians(x) -> converts angle x from degrees to radians");
static PyMethodDef math_methods[] = {
{"acos", math_acos, METH_VARARGS, math_acos_doc},
......@@ -330,9 +330,9 @@ static PyMethodDef math_methods[] = {
};
static char module_doc [] =
PyDoc_STRVAR(module_doc,
"This module is always available. It provides access to the\n"
"mathematical functions defined by the C standard.";
"mathematical functions defined by the C standard.");
DL_EXPORT(void)
initmath(void)
......
......@@ -61,12 +61,12 @@ md5_update(md5object *self, PyObject *args)
return Py_None;
}
static char update_doc [] =
PyDoc_STRVAR(update_doc,
"update (arg)\n\
\n\
Update the md5 object with the string arg. Repeated calls are\n\
equivalent to a single call with the concatenation of all the\n\
arguments.";
arguments.");
static PyObject *
......@@ -82,12 +82,12 @@ md5_digest(md5object *self)
return PyString_FromStringAndSize((char *)aDigest, 16);
}
static char digest_doc [] =
PyDoc_STRVAR(digest_doc,
"digest() -> string\n\
\n\
Return the digest of the strings passed to the update() method so\n\
far. This is an 16-byte string which may contain non-ASCII characters,\n\
including null bytes.";
including null bytes.");
static PyObject *
......@@ -116,10 +116,10 @@ md5_hexdigest(md5object *self)
}
static char hexdigest_doc [] =
PyDoc_STRVAR(hexdigest_doc,
"hexdigest() -> string\n\
\n\
Like digest(), but returns the digest as a string of hexadecimal digits.";
Like digest(), but returns the digest as a string of hexadecimal digits.");
static PyObject *
......@@ -135,10 +135,10 @@ md5_copy(md5object *self)
return (PyObject *)md5p;
}
static char copy_doc [] =
PyDoc_STRVAR(copy_doc,
"copy() -> md5 object\n\
\n\
Return a copy (``clone'') of the md5 object.";
Return a copy (``clone'') of the md5 object.");
static PyMethodDef md5_methods[] = {
......@@ -159,8 +159,7 @@ md5_getattr(md5object *self, char *name)
return Py_FindMethod(md5_methods, (PyObject *)self, name);
}
static char module_doc [] =
PyDoc_STRVAR(module_doc,
"This module implements the interface to RSA's MD5 message digest\n\
algorithm (see also Internet RFC 1321). Its use is quite\n\
straightforward: use the new() to create an md5 object. You can now\n\
......@@ -176,10 +175,9 @@ md5([arg]) -- DEPRECATED, same as new, but for compatibility\n\
\n\
Special Objects:\n\
\n\
MD5Type -- type object for md5 objects\n\
";
MD5Type -- type object for md5 objects");
static char md5type_doc [] =
PyDoc_STRVAR(md5type_doc,
"An md5 represents the object used to calculate the MD5 checksum of a\n\
string of information.\n\
\n\
......@@ -187,8 +185,7 @@ Methods:\n\
\n\
update() -- updates the current digest with an additional string\n\
digest() -- return the current digest value\n\
copy() -- return a copy of the current md5 object\n\
";
copy() -- return a copy of the current md5 object");
statichere PyTypeObject MD5type = {
PyObject_HEAD_INIT(NULL)
......@@ -238,11 +235,11 @@ MD5_new(PyObject *self, PyObject *args)
return (PyObject *)md5p;
}
static char new_doc [] =
PyDoc_STRVAR(new_doc,
"new([arg]) -> md5 object\n\
\n\
Return a new md5 object. If arg is present, the method call update(arg)\n\
is made.";
is made.");
/* List of functions exported by this module */
......
......@@ -4,9 +4,9 @@
#include "Python.h"
#include "compile.h"
static char new_instance_doc[] =
PyDoc_STRVAR(new_instance_doc,
"Create an instance object from (CLASS [, DICT]) without calling its\n\
__init__() method. DICT must be a dictionary or None.";
__init__() method. DICT must be a dictionary or None.");
static PyObject *
new_instance(PyObject* unused, PyObject* args)
......@@ -30,8 +30,8 @@ new_instance(PyObject* unused, PyObject* args)
return PyInstance_NewRaw(klass, dict);
}
static char new_im_doc[] =
"Create a instance method object from (FUNCTION, INSTANCE, CLASS).";
PyDoc_STRVAR(new_im_doc,
"Create a instance method object from (FUNCTION, INSTANCE, CLASS).");
static PyObject *
new_instancemethod(PyObject* unused, PyObject* args)
......@@ -53,8 +53,8 @@ new_instancemethod(PyObject* unused, PyObject* args)
return PyMethod_New(func, self, classObj);
}
static char new_function_doc[] =
"Create a function object from (CODE, GLOBALS, [NAME [, ARGDEFS]]).";
PyDoc_STRVAR(new_function_doc,
"Create a function object from (CODE, GLOBALS, [NAME [, ARGDEFS]]).");
static PyObject *
new_function(PyObject* unused, PyObject* args)
......@@ -95,10 +95,10 @@ new_function(PyObject* unused, PyObject* args)
return (PyObject *)newfunc;
}
static char new_code_doc[] =
PyDoc_STRVAR(new_code_doc,
"Create a code object from (ARGCOUNT, NLOCALS, STACKSIZE, FLAGS, CODESTRING,\n"
"CONSTANTS, NAMES, VARNAMES, FILENAME, NAME, FIRSTLINENO, LNOTAB, FREEVARS,\n"
"CELLVARS).";
"CELLVARS).");
static PyObject *
new_code(PyObject* unused, PyObject* args)
......@@ -157,8 +157,8 @@ new_code(PyObject* unused, PyObject* args)
firstlineno, lnotab);
}
static char new_module_doc[] =
"Create a module object from (NAME).";
PyDoc_STRVAR(new_module_doc,
"Create a module object from (NAME).");
static PyObject *
new_module(PyObject* unused, PyObject* args)
......@@ -170,8 +170,8 @@ new_module(PyObject* unused, PyObject* args)
return PyModule_New(name);
}
static char new_class_doc[] =
"Create a class object from (NAME, BASE_CLASSES, DICT).";
PyDoc_STRVAR(new_class_doc,
"Create a class object from (NAME, BASE_CLASSES, DICT).");
static PyObject *
new_class(PyObject* unused, PyObject* args)
......@@ -202,10 +202,10 @@ static PyMethodDef new_methods[] = {
{NULL, NULL} /* sentinel */
};
static char new_doc[] =
PyDoc_STRVAR(new_doc,
"Functions to create new objects used by the interpreter.\n\
\n\
You need to know a great deal about the interpreter to use this!";
You need to know a great deal about the interpreter to use this!");
DL_EXPORT(void)
initnew(void)
......
static char operator_doc[] = "\
Operator interface.\n\
#include "Python.h"
PyDoc_STRVAR(operator_doc,
"Operator interface.\n\
\n\
This module exports a set of functions implemented in C corresponding\n\
to the intrinsic operators of Python. For example, operator.add(x, y)\n\
is equivalent to the expression x+y. The function names are those\n\
used for special class methods; variants without leading and trailing\n\
'__' are also provided for convenience.\n\
";
#include "Python.h"
'__' are also provided for convenience.");
#define spam1(OP,AOP) static PyObject *OP(PyObject *s, PyObject *a) { \
PyObject *a1; \
......
......@@ -46,20 +46,17 @@ char *strdup(char *);
/* String constants used to initialize module attributes.
*
*/
static char*
parser_copyright_string
= "Copyright 1995-1996 by Virginia Polytechnic Institute & State\n\
static char parser_copyright_string[] =
"Copyright 1995-1996 by Virginia Polytechnic Institute & State\n\
University, Blacksburg, Virginia, USA, and Fred L. Drake, Jr., Reston,\n\
Virginia, USA. Portions copyright 1991-1995 by Stichting Mathematisch\n\
Centrum, Amsterdam, The Netherlands.";
static char*
parser_doc_string
= "This is an interface to Python's internal parser.";
PyDoc_STRVAR(parser_doc_string,
"This is an interface to Python's internal parser.");
static char*
parser_version_string = "0.5";
static char parser_version_string[] = "0.5";
typedef PyObject* (*SeqMaker) (int length);
......
This diff is collapsed.
......@@ -18,11 +18,11 @@ static PyStructSequence_Field struct_pwd_type_fields[] = {
{0}
};
static char struct_passwd__doc__[] =
PyDoc_STRVAR(struct_passwd__doc__,
"pwd.struct_passwd: Results from getpw*() routines.\n\n\
This object may be accessed either as a tuple of\n\
(pw_name,pw_passwd,pw_uid,pw_gid,pw_gecos,pw_dir,pw_shell)\n\
or via the object attributes as named in the above tuple.\n";
or via the object attributes as named in the above tuple.");
static PyStructSequence_Desc struct_pwd_type_desc = {
"pwd.struct_passwd",
......@@ -31,15 +31,15 @@ static PyStructSequence_Desc struct_pwd_type_desc = {
7,
};
static char pwd__doc__ [] = "\
This module provides access to the Unix password database.\n\
PyDoc_STRVAR(pwd__doc__,
"This module provides access to the Unix password database.\n\
It is available on all Unix versions.\n\
\n\
Password database entries are reported as 7-tuples containing the following\n\
items from the password database (see `<pwd.h>'), in order:\n\
pw_name, pw_passwd, pw_uid, pw_gid, pw_gecos, pw_dir, pw_shell.\n\
The uid and gid items are integers, all others are strings. An\n\
exception is raised if the entry asked for cannot be found.";
exception is raised if the entry asked for cannot be found.");
static PyTypeObject StructPwdType;
......@@ -74,10 +74,11 @@ mkpwent(struct passwd *p)
return v;
}
static char pwd_getpwuid__doc__[] = "\
getpwuid(uid) -> (pw_name,pw_passwd,pw_uid,pw_gid,pw_gecos,pw_dir,pw_shell)\n\
PyDoc_STRVAR(pwd_getpwuid__doc__,
"getpwuid(uid) -> (pw_name,pw_passwd,pw_uid,\n\
pw_gid,pw_gecos,pw_dir,pw_shell)\n\
Return the password database entry for the given numeric user ID.\n\
See pwd.__doc__ for more on password database entries.";
See pwd.__doc__ for more on password database entries.");
static PyObject *
pwd_getpwuid(PyObject *self, PyObject *args)
......@@ -93,10 +94,11 @@ pwd_getpwuid(PyObject *self, PyObject *args)
return mkpwent(p);
}
static char pwd_getpwnam__doc__[] = "\
getpwnam(name) -> (pw_name,pw_passwd,pw_uid,pw_gid,pw_gecos,pw_dir,pw_shell)\n\
PyDoc_STRVAR(pwd_getpwnam__doc__,
"getpwnam(name) -> (pw_name,pw_passwd,pw_uid,\n\
pw_gid,pw_gecos,pw_dir,pw_shell)\n\
Return the password database entry for the given user name.\n\
See pwd.__doc__ for more on password database entries.";
See pwd.__doc__ for more on password database entries.");
static PyObject *
pwd_getpwnam(PyObject *self, PyObject *args)
......@@ -113,11 +115,11 @@ pwd_getpwnam(PyObject *self, PyObject *args)
}
#ifdef HAVE_GETPWENT
static char pwd_getpwall__doc__[] = "\
getpwall() -> list_of_entries\n\
PyDoc_STRVAR(pwd_getpwall__doc__,
"getpwall() -> list_of_entries\n\
Return a list of all available password database entries, \
in arbitrary order.\n\
See pwd.__doc__ for more on password database entries.";
See pwd.__doc__ for more on password database entries.");
static PyObject *
pwd_getpwall(PyObject *self)
......
......@@ -625,9 +625,9 @@ VOID_HANDLER(EndDoctypeDecl, (void *userData), ("()"))
/* ---------------------------------------------------------------- */
static char xmlparse_Parse__doc__[] =
PyDoc_STRVAR(xmlparse_Parse__doc__,
"Parse(data[, isfinal])\n\
Parse XML data. `isfinal' should be true at end of input.";
Parse XML data. `isfinal' should be true at end of input.");
static PyObject *
xmlparse_Parse(xmlparseobject *self, PyObject *args)
......@@ -695,9 +695,9 @@ finally:
return len;
}
static char xmlparse_ParseFile__doc__[] =
PyDoc_STRVAR(xmlparse_ParseFile__doc__,
"ParseFile(file)\n\
Parse XML data from file-like object.";
Parse XML data from file-like object.");
static PyObject *
xmlparse_ParseFile(xmlparseobject *self, PyObject *args)
......@@ -754,9 +754,9 @@ xmlparse_ParseFile(xmlparseobject *self, PyObject *args)
return Py_BuildValue("i", rv);
}
static char xmlparse_SetBase__doc__[] =
PyDoc_STRVAR(xmlparse_SetBase__doc__,
"SetBase(base_url)\n\
Set the base URL for the parser.";
Set the base URL for the parser.");
static PyObject *
xmlparse_SetBase(xmlparseobject *self, PyObject *args)
......@@ -772,9 +772,9 @@ xmlparse_SetBase(xmlparseobject *self, PyObject *args)
return Py_None;
}
static char xmlparse_GetBase__doc__[] =
PyDoc_STRVAR(xmlparse_GetBase__doc__,
"GetBase() -> url\n\
Return base URL string for the parser.";
Return base URL string for the parser.");
static PyObject *
xmlparse_GetBase(xmlparseobject *self, PyObject *args)
......@@ -785,11 +785,11 @@ xmlparse_GetBase(xmlparseobject *self, PyObject *args)
return Py_BuildValue("z", XML_GetBase(self->itself));
}
static char xmlparse_GetInputContext__doc__[] =
PyDoc_STRVAR(xmlparse_GetInputContext__doc__,
"GetInputContext() -> string\n\
Return the untranslated text of the input that caused the current event.\n\
If the event was generated by a large amount of text (such as a start tag\n\
for an element with many attributes), not all of the text may be available.";
for an element with many attributes), not all of the text may be available.");
static PyObject *
xmlparse_GetInputContext(xmlparseobject *self, PyObject *args)
......@@ -817,10 +817,10 @@ xmlparse_GetInputContext(xmlparseobject *self, PyObject *args)
return result;
}
static char xmlparse_ExternalEntityParserCreate__doc__[] =
PyDoc_STRVAR(xmlparse_ExternalEntityParserCreate__doc__,
"ExternalEntityParserCreate(context[, encoding])\n\
Create a parser for parsing an external entity based on the\n\
information passed to the ExternalEntityRefHandler.";
information passed to the ExternalEntityRefHandler.");
static PyObject *
xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
......@@ -892,13 +892,13 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
return (PyObject *)new_parser;
}
static char xmlparse_SetParamEntityParsing__doc__[] =
PyDoc_STRVAR(xmlparse_SetParamEntityParsing__doc__,
"SetParamEntityParsing(flag) -> success\n\
Controls parsing of parameter entities (including the external DTD\n\
subset). Possible flag values are XML_PARAM_ENTITY_PARSING_NEVER,\n\
XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE and\n\
XML_PARAM_ENTITY_PARSING_ALWAYS. Returns true if setting the flag\n\
was successful.";
was successful.");
static PyObject*
xmlparse_SetParamEntityParsing(xmlparseobject *p, PyObject* args)
......@@ -1225,8 +1225,7 @@ xmlparse_clear(xmlparseobject *op)
}
#endif
static char Xmlparsetype__doc__[] =
"XML parser";
PyDoc_STRVAR(Xmlparsetype__doc__, "XML parser");
static PyTypeObject Xmlparsetype = {
PyObject_HEAD_INIT(NULL)
......@@ -1267,9 +1266,9 @@ static PyTypeObject Xmlparsetype = {
/* End of code for xmlparser objects */
/* -------------------------------------------------------- */
static char pyexpat_ParserCreate__doc__[] =
PyDoc_STRVAR(pyexpat_ParserCreate__doc__,
"ParserCreate([encoding[, namespace_separator]]) -> parser\n\
Return a new XML parser object.";
Return a new XML parser object.");
static PyObject *
pyexpat_ParserCreate(PyObject *notused, PyObject *args, PyObject *kw)
......@@ -1291,9 +1290,9 @@ pyexpat_ParserCreate(PyObject *notused, PyObject *args, PyObject *kw)
return newxmlparseobject(encoding, namespace_separator);
}
static char pyexpat_ErrorString__doc__[] =
PyDoc_STRVAR(pyexpat_ErrorString__doc__,
"ErrorString(errno) -> string\n\
Returns string error for given number.";
Returns string error for given number.");
static PyObject *
pyexpat_ErrorString(PyObject *self, PyObject *args)
......@@ -1318,8 +1317,8 @@ static struct PyMethodDef pyexpat_methods[] = {
/* Module docstring */
static char pyexpat_module_documentation[] =
"Python wrapper for Expat parser.";
PyDoc_STRVAR(pyexpat_module_documentation,
"Python wrapper for Expat parser.");
#if PY_VERSION_HEX < 0x20000F0
......
......@@ -46,10 +46,9 @@ parse_and_bind(PyObject *self, PyObject *args)
return Py_None;
}
static char doc_parse_and_bind[] = "\
parse_and_bind(string) -> None\n\
Parse and execute single line of a readline init file.\
";
PyDoc_STRVAR(doc_parse_and_bind,
"parse_and_bind(string) -> None\n\
Parse and execute single line of a readline init file.");
/* Exported function to parse a readline init file */
......@@ -67,11 +66,10 @@ read_init_file(PyObject *self, PyObject *args)
return Py_None;
}
static char doc_read_init_file[] = "\
read_init_file([filename]) -> None\n\
PyDoc_STRVAR(doc_read_init_file,
"read_init_file([filename]) -> None\n\
Parse a readline initialization file.\n\
The default filename is the last filename used.\
";
The default filename is the last filename used.");
/* Exported function to load a readline history file */
......@@ -90,11 +88,10 @@ read_history_file(PyObject *self, PyObject *args)
}
static int history_length = -1; /* do not truncate history by default */
static char doc_read_history_file[] = "\
read_history_file([filename]) -> None\n\
PyDoc_STRVAR(doc_read_history_file,
"read_history_file([filename]) -> None\n\
Load a readline history file.\n\
The default filename is ~/.history.\
";
The default filename is ~/.history.");
/* Exported function to save a readline history file */
......@@ -114,19 +111,17 @@ write_history_file(PyObject *self, PyObject *args)
return Py_None;
}
static char doc_write_history_file[] = "\
write_history_file([filename]) -> None\n\
PyDoc_STRVAR(doc_write_history_file,
"write_history_file([filename]) -> None\n\
Save a readline history file.\n\
The default filename is ~/.history.\
";
The default filename is ~/.history.");
static char set_history_length_doc[] = "\
set_history_length(length) -> None\n\
PyDoc_STRVAR(set_history_length_doc,
"set_history_length(length) -> None\n\
set the maximal number of items which will be written to\n\
the history file. A negative length is used to inhibit\n\
history truncation.\n\
";
history truncation.");
static PyObject*
set_history_length(PyObject *self, PyObject *args)
......@@ -141,11 +136,10 @@ set_history_length(PyObject *self, PyObject *args)
static char get_history_length_doc[] = "\
get_history_length() -> int\n\
PyDoc_STRVAR(get_history_length_doc,
"get_history_length() -> int\n\
return the maximum number of items that will be written to\n\
the history file.\n\
";
the history file.");
static PyObject*
get_history_length(PyObject *self, PyObject *args)
......@@ -204,12 +198,11 @@ set_startup_hook(PyObject *self, PyObject *args)
return set_hook("startup_hook", &startup_hook, &startup_hook_tstate, args);
}
static char doc_set_startup_hook[] = "\
set_startup_hook([function]) -> None\n\
PyDoc_STRVAR(doc_set_startup_hook,
"set_startup_hook([function]) -> None\n\
Set or remove the startup_hook function.\n\
The function is called with no arguments just\n\
before readline prints the first prompt.\n\
";
before readline prints the first prompt.");
#ifdef HAVE_RL_PRE_INPUT_HOOK
static PyObject *
......@@ -218,13 +211,12 @@ set_pre_input_hook(PyObject *self, PyObject *args)
return set_hook("pre_input_hook", &pre_input_hook, &pre_input_hook_tstate, args);
}
static char doc_set_pre_input_hook[] = "\
set_pre_input_hook([function]) -> None\n\
PyDoc_STRVAR(doc_set_pre_input_hook,
"set_pre_input_hook([function]) -> None\n\
Set or remove the pre_input_hook function.\n\
The function is called with no arguments after the first prompt\n\
has been printed and just before readline starts reading input\n\
characters.\n\
";
characters.");
#endif
/* Exported function to specify a word completer in Python */
......@@ -243,9 +235,9 @@ get_begidx(PyObject *self)
return begidx;
}
static char doc_get_begidx[] = "\
get_begidx() -> int\n\
get the beginning index of the readline tab-completion scope";
PyDoc_STRVAR(doc_get_begidx,
"get_begidx() -> int\n\
get the beginning index of the readline tab-completion scope");
/* get the ending index for the scope of the tab-completion */
static PyObject *
......@@ -255,9 +247,9 @@ get_endidx(PyObject *self)
return endidx;
}
static char doc_get_endidx[] = "\
get_endidx() -> int\n\
get the ending index of the readline tab-completion scope";
PyDoc_STRVAR(doc_get_endidx,
"get_endidx() -> int\n\
get the ending index of the readline tab-completion scope");
/* set the tab-completion word-delimiters that readline uses */
......@@ -276,9 +268,9 @@ set_completer_delims(PyObject *self, PyObject *args)
return Py_None;
}
static char doc_set_completer_delims[] = "\
set_completer_delims(string) -> None\n\
set the readline word delimiters for tab-completion";
PyDoc_STRVAR(doc_set_completer_delims,
"set_completer_delims(string) -> None\n\
set the readline word delimiters for tab-completion");
static PyObject *
py_add_history(PyObject *self, PyObject *args)
......@@ -293,9 +285,9 @@ py_add_history(PyObject *self, PyObject *args)
return Py_None;
}
static char doc_add_history[] = "\
add_history(string) -> None\n\
add a line to the history buffer";
PyDoc_STRVAR(doc_add_history,
"add_history(string) -> None\n\
add a line to the history buffer");
/* get the tab-completion word-delimiters that readline uses */
......@@ -306,9 +298,9 @@ get_completer_delims(PyObject *self)
return PyString_FromString(rl_completer_word_break_characters);
}
static char doc_get_completer_delims[] = "\
get_completer_delims() -> string\n\
get the readline word delimiters for tab-completion";
PyDoc_STRVAR(doc_get_completer_delims,
"get_completer_delims() -> string\n\
get the readline word delimiters for tab-completion");
static PyObject *
set_completer(PyObject *self, PyObject *args)
......@@ -316,13 +308,12 @@ set_completer(PyObject *self, PyObject *args)
return set_hook("completer", &completer, &completer_tstate, args);
}
static char doc_set_completer[] = "\
set_completer([function]) -> None\n\
PyDoc_STRVAR(doc_set_completer,
"set_completer([function]) -> None\n\
Set or remove the completer function.\n\
The function is called as function(text, state),\n\
for state in 0, 1, 2, ..., until it returns a non-string.\n\
It should return the next possible completion starting with 'text'.\
";
It should return the next possible completion starting with 'text'.");
/* Exported function to get any element of history */
......@@ -342,10 +333,9 @@ get_history_item(PyObject *self, PyObject *args)
}
}
static char doc_get_history_item[] = "\
get_history_item() -> string\n\
return the current contents of history item at index.\
";
PyDoc_STRVAR(doc_get_history_item,
"get_history_item() -> string\n\
return the current contents of history item at index.");
/* Exported function to get current length of history */
......@@ -358,10 +348,9 @@ get_current_history_length(PyObject *self)
return PyInt_FromLong(hist_st ? (long) hist_st->length : (long) 0);
}
static char doc_get_current_history_length[] = "\
get_current_history_length() -> integer\n\
return the current (not the maximum) length of history.\
";
PyDoc_STRVAR(doc_get_current_history_length,
"get_current_history_length() -> integer\n\
return the current (not the maximum) length of history.");
/* Exported function to read the current line buffer */
......@@ -371,10 +360,9 @@ get_line_buffer(PyObject *self)
return PyString_FromString(rl_line_buffer);
}
static char doc_get_line_buffer[] = "\
get_line_buffer() -> string\n\
return the current contents of the line buffer.\
";
PyDoc_STRVAR(doc_get_line_buffer,
"get_line_buffer() -> string\n\
return the current contents of the line buffer.");
/* Exported function to insert text into the line buffer */
......@@ -389,10 +377,9 @@ insert_text(PyObject *self, PyObject *args)
return Py_None;
}
static char doc_insert_text[] = "\
insert_text(string) -> None\n\
Insert text into the command line.\
";
PyDoc_STRVAR(doc_insert_text,
"insert_text(string) -> None\n\
Insert text into the command line.");
static PyObject *
redisplay(PyObject *self)
......@@ -402,11 +389,10 @@ redisplay(PyObject *self)
return Py_None;
}
static char doc_redisplay[] = "\
redisplay() -> None\n\
PyDoc_STRVAR(doc_redisplay,
"redisplay() -> None\n\
Change what's displayed on the screen to reflect the current\n\
contents of the line buffer.\
";
contents of the line buffer.");
/* Table of functions exported by the module */
......@@ -663,8 +649,8 @@ call_readline(char *prompt)
/* Initialize the module */
static char doc_module[] =
"Importing this module enables command line editing using GNU readline.";
PyDoc_STRVAR(doc_module,
"Importing this module enables command line editing using GNU readline.");
DL_EXPORT(void)
initreadline(void)
......
......@@ -17,12 +17,12 @@
static PyObject *ResourceError;
static char struct_rusage__doc__[] =
"struct_rusage: Result from getrusage.\n\n"
"This object may be accessed either as a tuple of\n"
" (utime,stime,maxrss,ixrss,idrss,isrss,minflt,majflt,\n"
" nswap,inblock,oublock,msgsnd,msgrcv,nsignals,nvcsw,nivcsw)\n"
"or via the attributes ru_utime, ru_stime, ru_maxrss, and so on.\n";
PyDoc_STRVAR(struct_rusage__doc__,
"struct_rusage: Result from getrusage.\n\n"
"This object may be accessed either as a tuple of\n"
" (utime,stime,maxrss,ixrss,idrss,isrss,minflt,majflt,\n"
" nswap,inblock,oublock,msgsnd,msgrcv,nsignals,nvcsw,nivcsw)\n"
"or via the attributes ru_utime, ru_stime, ru_maxrss, and so on.");
static PyStructSequence_Field struct_rusage_fields[] = {
{"ru_utime", "user time used"},
......
......@@ -351,12 +351,12 @@ update_ufd_array(pollObject *self)
return 1;
}
static char poll_register_doc[] =
PyDoc_STRVAR(poll_register_doc,
"register(fd [, eventmask] ) -> None\n\n\
Register a file descriptor with the polling object.\n\
fd -- either an integer, or an object with a fileno() method returning an\n\
int.\n\
events -- an optional bitmask describing the type of events to check for";
events -- an optional bitmask describing the type of events to check for");
static PyObject *
poll_register(pollObject *self, PyObject *args)
......@@ -394,9 +394,9 @@ poll_register(pollObject *self, PyObject *args)
return Py_None;
}
static char poll_unregister_doc[] =
PyDoc_STRVAR(poll_unregister_doc,
"unregister(fd) -> None\n\n\
Remove a file descriptor being tracked by the polling object.";
Remove a file descriptor being tracked by the polling object.");
static PyObject *
poll_unregister(pollObject *self, PyObject *args)
......@@ -431,10 +431,10 @@ poll_unregister(pollObject *self, PyObject *args)
return Py_None;
}
static char poll_poll_doc[] =
PyDoc_STRVAR(poll_poll_doc,
"poll( [timeout] ) -> list of (fd, event) 2-tuples\n\n\
Polls the set of registered file descriptors, returning a list containing \n\
any descriptors that have events or errors to report.";
any descriptors that have events or errors to report.");
static PyObject *
poll_poll(pollObject *self, PyObject *args)
......@@ -580,9 +580,9 @@ statichere PyTypeObject poll_Type = {
0, /*tp_hash*/
};
static char poll_doc[] =
PyDoc_STRVAR(poll_doc,
"Returns a polling object, which supports registering and\n\
unregistering file descriptors, and then polling them for I/O events.";
unregistering file descriptors, and then polling them for I/O events.");
static PyObject *
select_poll(PyObject *self, PyObject *args)
......@@ -598,7 +598,7 @@ select_poll(PyObject *self, PyObject *args)
}
#endif /* HAVE_POLL */
static char select_doc[] =
PyDoc_STRVAR(select_doc,
"select(rlist, wlist, xlist[, timeout]) -> (rlist, wlist, xlist)\n\
\n\
Wait until one or more file descriptors are ready for some kind of I/O.\n\
......@@ -619,7 +619,7 @@ arguments; each contains the subset of the corresponding file descriptors\n\
that are ready.\n\
\n\
*** IMPORTANT NOTICE ***\n\
On Windows, only sockets are supported; on Unix, all file descriptors.";
On Windows, only sockets are supported; on Unix, all file descriptors.");
static PyMethodDef select_methods[] = {
{"select", select_select, METH_VARARGS, select_doc},
......@@ -629,11 +629,11 @@ static PyMethodDef select_methods[] = {
{0, 0}, /* sentinel */
};
static char module_doc[] =
PyDoc_STRVAR(module_doc,
"This module supports asynchronous I/O on multiple file descriptors.\n\
\n\
*** IMPORTANT NOTICE ***\n\
On Windows, only sockets are supported; on Unix, all file descriptors.";
On Windows, only sockets are supported; on Unix, all file descriptors.");
DL_EXPORT(void)
initselect(void)
......
......@@ -350,8 +350,7 @@ SHA_dealloc(PyObject *ptr)
/* External methods for a hashing object */
static char SHA_copy__doc__[] =
"Return a copy of the hashing object.";
PyDoc_STRVAR(SHA_copy__doc__, "Return a copy of the hashing object.");
static PyObject *
SHA_copy(SHAobject *self, PyObject *args)
......@@ -368,8 +367,8 @@ SHA_copy(SHAobject *self, PyObject *args)
return (PyObject *)newobj;
}
static char SHA_digest__doc__[] =
"Return the digest value as a string of binary data.";
PyDoc_STRVAR(SHA_digest__doc__,
"Return the digest value as a string of binary data.");
static PyObject *
SHA_digest(SHAobject *self, PyObject *args)
......@@ -385,8 +384,8 @@ SHA_digest(SHAobject *self, PyObject *args)
return PyString_FromStringAndSize((const char *)digest, sizeof(digest));
}
static char SHA_hexdigest__doc__[] =
"Return the digest value as a string of hexadecimal digits.";
PyDoc_STRVAR(SHA_hexdigest__doc__,
"Return the digest value as a string of hexadecimal digits.");
static PyObject *
SHA_hexdigest(SHAobject *self, PyObject *args)
......@@ -427,8 +426,8 @@ SHA_hexdigest(SHAobject *self, PyObject *args)
return retval;
}
static char SHA_update__doc__[] =
"Update this hashing object's state with the provided string.";
PyDoc_STRVAR(SHA_update__doc__,
"Update this hashing object's state with the provided string.");
static PyObject *
SHA_update(SHAobject *self, PyObject *args)
......@@ -479,10 +478,10 @@ static PyTypeObject SHAtype = {
/* The single module-level function: new() */
static char SHA_new__doc__[] =
"Return a new SHA hashing object. An optional string "
"argument may be provided; if present, this string will be "
" automatically hashed.";
PyDoc_STRVAR(SHA_new__doc__,
"Return a new SHA hashing object. An optional string argument\n\
may be provided; if present, this string will be automatically\n\
hashed.");
static PyObject *
SHA_new(PyObject *self, PyObject *args, PyObject *kwdict)
......
......@@ -96,11 +96,11 @@ signal_default_int_handler(PyObject *self, PyObject *args)
return NULL;
}
static char default_int_handler_doc[] =
PyDoc_STRVAR(default_int_handler_doc,
"default_int_handler(...)\n\
\n\
The default handler for SIGINT instated by Python.\n\
It raises KeyboardInterrupt.";
It raises KeyboardInterrupt.");
static int
......@@ -155,10 +155,10 @@ signal_alarm(PyObject *self, PyObject *args)
return PyInt_FromLong((long)alarm(t));
}
static char alarm_doc[] =
PyDoc_STRVAR(alarm_doc,
"alarm(seconds)\n\
\n\
Arrange for SIGALRM to arrive after the given number of seconds.";
Arrange for SIGALRM to arrive after the given number of seconds.");
#endif
#ifdef HAVE_PAUSE
......@@ -177,10 +177,10 @@ signal_pause(PyObject *self)
Py_INCREF(Py_None);
return Py_None;
}
static char pause_doc[] =
PyDoc_STRVAR(pause_doc,
"pause()\n\
\n\
Wait until a signal arrives.";
Wait until a signal arrives.");
#endif
......@@ -231,7 +231,7 @@ signal_signal(PyObject *self, PyObject *args)
return old_handler;
}
static char signal_doc[] =
PyDoc_STRVAR(signal_doc,
"signal(sig, action) -> action\n\
\n\
Set the action for the given signal. The action can be SIG_DFL,\n\
......@@ -240,7 +240,7 @@ returned. See getsignal() for possible return values.\n\
\n\
*** IMPORTANT NOTICE ***\n\
A signal handler function is called with two arguments:\n\
the first is the signal number, the second is the interrupted stack frame.";
the first is the signal number, the second is the interrupted stack frame.");
static PyObject *
......@@ -260,15 +260,14 @@ signal_getsignal(PyObject *self, PyObject *args)
return old_handler;
}
static char getsignal_doc[] =
PyDoc_STRVAR(getsignal_doc,
"getsignal(sig) -> action\n\
\n\
Return the current action for the given signal. The return value can be:\n\
SIG_IGN -- if the signal is being ignored\n\
SIG_DFL -- if the default action for the signal is in effect\n\
None -- if an unknown handler is in effect\n\
anything else -- the callable Python object used as a handler\n\
";
anything else -- the callable Python object used as a handler");
#ifdef HAVE_SIGPROCMASK /* we assume that having SIGPROCMASK is enough
to guarantee full POSIX signal handling */
......@@ -353,7 +352,7 @@ signal_sigprocmask(PyObject* self, PyObject* args)
return _signal_sigset_to_list(&oldset);
}
static char sigprocmask_doc[] =
PyDoc_STRVAR(sigprocmask_doc,
"sigprocmask(how, sigset) -> sigset\n\
\n\
Change the list of currently blocked signals. The parameter how should be\n\
......@@ -371,7 +370,7 @@ of how:\n\
SIG_SETMASK\n\
The set of blocked signals is set to the argument set.\n\
\n\
A list contating the numbers of the previously blocked signals is returned.";
A list contating the numbers of the previously blocked signals is returned.");
static PyObject*
signal_sigpending(PyObject* self)
......@@ -385,11 +384,11 @@ signal_sigpending(PyObject* self)
return _signal_sigset_to_list(&set);
}
static char sigpending_doc[] =
PyDoc_STRVAR(sigpending_doc,
"sigpending() -> sigset\n\
\n\
Return the set of pending signals, i.e. a list containing the numbers of\n\
those signals that have been raised while blocked.";
those signals that have been raised while blocked.");
static PyObject*
signal_sigsuspend(PyObject* self, PyObject* arg)
......@@ -411,11 +410,11 @@ signal_sigsuspend(PyObject* self, PyObject* arg)
return Py_None;
}
static char sigsuspend_doc[] =
PyDoc_STRVAR(sigsuspend_doc,
"sigsuspend(sigset) -> None\n\
\n\
Temporarily replace the signal mask with sigset (which should be a sequence\n\
of signal numbers) and suspend the process until a signal is received.";
of signal numbers) and suspend the process until a signal is received.");
#endif
/* List of functions defined in the module */
......@@ -443,7 +442,7 @@ static PyMethodDef signal_methods[] = {
};
static char module_doc[] =
PyDoc_STRVAR(module_doc,
"This module provides mechanisms to use signal handlers in Python.\n\
\n\
Functions:\n\
......@@ -468,7 +467,7 @@ SIGINT, SIGTERM, etc. -- signal numbers\n\
\n\
*** IMPORTANT NOTICE ***\n\
A signal handler function is called with two arguments:\n\
the first is the signal number, the second is the interrupted stack frame.";
the first is the signal number, the second is the interrupted stack frame.");
DL_EXPORT(void)
initsignal(void)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -458,7 +458,7 @@ static PyMethodDef unicodedata_functions[] = {
{NULL, NULL} /* sentinel */
};
static char *unicodedata_docstring = "unicode character database";
PyDoc_STRVAR(unicodedata_docstring, "unicode character database");
DL_EXPORT(void)
initunicodedata(void)
......
#include "Python.h"
static char xreadlines_doc [] =
PyDoc_STRVAR(xreadlines_doc,
"xreadlines(f)\n\
\n\
Return an xreadlines object for the file f.";
Return an xreadlines object for the file f.");
typedef struct {
PyObject_HEAD
......@@ -112,7 +112,7 @@ xreadlines_next(PyXReadlinesObject *a, PyObject *args)
return res;
}
static char next_doc[] = "x.next() -> the next line or raise StopIteration";
PyDoc_STRVAR(next_doc, "x.next() -> the next line or raise StopIteration");
static PyMethodDef xreadlines_methods[] = {
{"next", (PyCFunction)xreadlines_next, METH_VARARGS, next_doc},
......
#include "Python.h"
#include "structmember.h"
static char xxsubtype__doc__[] =
PyDoc_STRVAR(xxsubtype__doc__,
"xxsubtype is an example module showing how to subtype builtin types from C.\n"
"test_descr.py in the standard test suite requires it in order to complete.\n"
"If you don't care about the examples, and don't intend to run the Python\n"
"test suite, you can recompile Python without Modules/xxsubtype.c.";
"test suite, you can recompile Python without Modules/xxsubtype.c.");
/* We link this module statically for convenience. If compiled as a shared
library instead, some compilers don't allow addresses of Python objects
......
This diff is collapsed.
......@@ -93,12 +93,12 @@ bool_xor(PyObject *a, PyObject *b)
/* Doc string */
static char bool_doc[] =
PyDoc_STRVAR(bool_doc,
"bool(x) -> bool\n\
\n\
Returns True when the argument x is true, False otherwise.\n\
The builtins True and False are the only two instances of the class bool.\n\
The class bool is a subclass of the class int, and cannot be subclassed.";
The class bool is a subclass of the class int, and cannot be subclassed.");
/* Arithmetic methods -- only so we can override &, |, ^. */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment