initial import

This commit is contained in:
Dave Goodwin 2003-06-08 14:52:11 +00:00
parent de7c965da8
commit 52e2c4c6c0
3 changed files with 61 additions and 0 deletions

11
Cantera/cxx/writelog.cpp Normal file
View file

@ -0,0 +1,11 @@
#include <string>
#include <iostream>
using namespace std;
namespace Cantera {
void writelog(const string& s) {
cout << s;
}
}

View file

@ -0,0 +1,25 @@
#include "mex.h"
#include <string>
static std::string ss = "disp('";
namespace Cantera {
void writelog(const std::string& s) {
char ch = s[0];
int n = 0;
while (ch != '\0') {
if (ch =='\n') {
ss += " ');";
mexEvalString(ss.c_str());
ss = "disp('";
}
else
ss += ch;
n++;
ch = s[n];
}
}
}

View file

@ -0,0 +1,25 @@
#include "Python.h"
#include <string>
using namespace std;
static std::string ss = "print \"";
namespace Cantera {
void writelog(const string& s) {
char ch = s[0];
int n = 0;
while (ch != '\0') {
if (ch =='\n') {
ss += "\"";
PyRun_SimpleString((char *)ss.c_str());
ss = "print \"";
}
else
ss += ch;
n++;
ch = s[n];
}
}
}