[Python-checkins] python/dist/src/Modules _csv.c,NONE,1.1

montanaro@users.sourceforge.net montanaro@users.sourceforge.net
Thu, 20 Mar 2003 15:29:14 -0800


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

Added Files:
	_csv.c 
Log Message:
new CSV file processing module - see PEP 305


--- NEW FILE: _csv.c ---
/* TODO:
*/

#include "Python.h"
#include "structmember.h"

/* begin 2.2 compatibility macros */
#ifndef PyDoc_STRVAR
/* Define macros for inline documentation. */
#define PyDoc_VAR(name) static char name[]
#define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
#ifdef WITH_DOC_STRINGS
#define PyDoc_STR(str) str
#else
#define PyDoc_STR(str) ""
#endif
#endif /* ifndef PyDoc_STRVAR */

#ifndef PyMODINIT_FUNC
[...1426 lines suppressed...]
	/* Add quote styles into dictionary */
	for (style = quote_styles; style->name; style++) {
		v = PyInt_FromLong(style->style);
		if (v == NULL)
			return;
		res = PyModule_AddObject(module, style->name, v);
		if (res < 0)
			return;
	}

        /* Add the Dialect type */
        if (PyModule_AddObject(module, "Dialect", (PyObject *)&Dialect_Type))
                return;

	/* Add the CSV exception object to the module. */
	error_obj = PyErr_NewException("_csv.Error", NULL, NULL);
	if (error_obj == NULL)
		return;
	PyModule_AddObject(module, "Error", error_obj);
}