Commit Graph

21 Commits

Author SHA1 Message Date
Jeremy Hylton af68c874a6 Add const to several API functions that take char *.
In C++, it's an error to pass a string literal to a char* function
without a const_cast().  Rather than require every C++ extension
module to put a cast around string literals, fix the API to state the
const-ness.

I focused on parts of the API where people usually pass literals:
PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type
slots, etc.  Predictably, there were a large set of functions that
needed to be fixed as a result of these changes.  The most pervasive
change was to make the keyword args list passed to
PyArg_ParseTupleAndKewords() to be a const char *kwlist[].

One cast was required as a result of the changes:  A type object
mallocs the memory for its tp_doc slot and later frees it.
PyTypeObject says that tp_doc is const char *; but if the type was
created by type_new(), we know it is safe to cast to char *.
2005-12-10 18:50:16 +00:00
Raymond Hettinger 7b8e281997 SF bug #670229: doc improvement for cStringIO.h
Gernot Hillier added more detail to the internal API documentation.
2003-01-19 00:45:01 +00:00
Neal Norwitz 638437ff4d SF # 607253, header file problems by Ralf W. Grosse-Kunstleve
Don't pollute the namespace when protecting against multiple header inclusion.
Prefix with Py_ and use standard naming convention Py_FILENAME_H.
2002-10-04 12:43:02 +00:00
Jeremy Hylton f4d32df19d Remove function definition from cStringIO.h.
xxxPyCObject_Import() seems to be a copy of PyCObject_Import().
2002-08-05 18:20:01 +00:00
Guido van Rossum 2e1c09c1fd Removed old Digital Creations copyright/license notices (with
permission from Paul Everitt).  Also removed a few other references to
Digital Creations and changed the remaining ones to Zope Corporation.
2002-04-04 17:52:50 +00:00
Martin v. Löwis 522cf1f6fb Patch #536908: Add missing #include guards/extern "C". 2002-03-30 08:57:12 +00:00
Martin v. Löwis eefa964932 Cast the result of xxxPyCObject_Import to PycStringIO_CAPI*.
This fixes bug #431557.
2001-06-09 07:59:43 +00:00
Thomas Wouters 7889010731 Miscelaneous ANSIfications. I'm assuming here 'main' should take (int,
char**) and return an int even on PC platforms. If not, please fix
PC/utils/makesrc.c ;-P
2000-07-22 19:25:51 +00:00
Thomas Wouters 7e47402264 Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in either
comments, docstrings or error messages. I fixed two minor things in
test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't").

There is a minor style issue involved: Guido seems to have preferred English
grammar (behaviour, honour) in a couple places. This patch changes that to
American, which is the more prominent style in the source. I prefer English
myself, so if English is preferred, I'd be happy to supply a patch myself ;)
2000-07-16 12:04:32 +00:00
Tim Peters dbd9ba6a6c Nuke all remaining occurrences of Py_PROTO and Py_FPROTO. 2000-07-09 03:09:57 +00:00
Guido van Rossum 7999bfb235 There's a macro PycString_IMPORT which the documentation listed as
PycStringIO_IMPORT.  While arguably the name used in the documentation
is more consistent, I think it's probably safer not to change the
macro definition and instead fix the doco.
1999-01-25 21:36:13 +00:00
Guido van Rossum f0f3600d0b Undo the change here -- there's no point in declaring a static
function as DL_IMPORT()!
1998-12-08 13:23:22 +00:00
Guido van Rossum 43466ec7b0 Add DL_IMPORT(returntype) for all officially exported functions. 1998-12-04 18:48:25 +00:00
Guido van Rossum cd8732a482 Remove the last bits of log from the leading comments. 1997-12-08 15:16:08 +00:00
Guido van Rossum 36facb086e Merge between my version and Jim Fulton's version; removed RCS keywords
but otherwise unchanged.
1997-12-04 01:14:08 +00:00
Guido van Rossum eec6ef1aa2 Use K&R function prototypes. 1997-10-07 14:44:48 +00:00
Guido van Rossum 142eeb8339 cPickle release 0.3 from Jim Fulton 1997-08-13 03:14:41 +00:00
Guido van Rossum 45c3aaba56 Got rid of the static decl of PyCObject_Import, which was a 1.4
compatibility hack.
1997-04-09 18:04:08 +00:00
Guido van Rossum 0a73dd5f35 Changed the way the C API was exported. Jim Fulton. 1997-04-09 17:34:28 +00:00
Guido van Rossum d81a1baa5f Jim's latest version 1997-01-06 22:50:12 +00:00
Guido van Rossum 049cd90b93 Jim F's brainchild 1996-12-05 23:30:48 +00:00