cantera/src/python/pyutils.h
Ray Speth 2528df0f75 Reorganized source tree structure
These changes make it unnecessary to copy header files around during
the build process, which tends to confuse IDEs and debuggers. The
headers which comprise Cantera's external C++ interface are now in
the 'include' directory.

All of the samples and demos are now in the 'samples' subdirectory.
2012-02-12 02:27:14 +00:00

29 lines
547 B
C

#ifndef CTPY_UTILS
#define CTPY_UTILS
#include "Python.h"
static PyObject* reportCanteraError()
{
char* buf = 0;
int buflen = getCanteraError(0, buf) + 1;
buf = new char[buflen+1];
getCanteraError(buflen, buf);
PyErr_SetString(ErrorObject,buf);
delete buf;
//writelogfile("log.html");
return NULL;
}
static PyObject* reportError(int n)
{
if (n == -1) {
return reportCanteraError();
} else if (n < 0) {
PyErr_SetString(ErrorObject,"Exception occurred.");
}
return NULL;
}
#endif