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.
29 lines
547 B
C
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
|