[clib] Improve consistency of function names

This commit is contained in:
Ray Speth 2016-11-06 00:26:27 -04:00
parent 8b9499160a
commit 902ab5cccd
16 changed files with 39 additions and 49 deletions

View file

@ -152,14 +152,15 @@ extern "C" {
CANTERA_CAPI int trans_getMassFluxes(int n, const double* state1,
const double* state2, double delta, double* fluxes);
CANTERA_CAPI int getCanteraError(int buflen, char* buf);
CANTERA_CAPI int setLogWriter(void* logger);
CANTERA_CAPI int addCanteraDirectory(size_t buflen, const char* buf);
CANTERA_CAPI int ct_getCanteraError(int buflen, char* buf);
CANTERA_CAPI int ct_setLogWriter(void* logger);
CANTERA_CAPI int ct_addCanteraDirectory(size_t buflen, const char* buf);
CANTERA_CAPI int ct_getDataDirectories(int buflen, char* buf, const char* sep);
CANTERA_CAPI int clearStorage();
CANTERA_CAPI int ct_clearStorage();
CANTERA_CAPI int ck_to_cti(const char* in_file, const char* db_file,
const char* tr_file, const char* id_tag, int debug, int validate);
CANTERA_CAPI int ct_ck2cti(const char* in_file, const char* db_file,
const char* tr_file, const char* id_tag,
int debug, int validate);
#ifdef __cplusplus
}

View file

@ -16,11 +16,11 @@ extern "C" {
CANTERA_CAPI int func_new(int type, size_t n, size_t lenp, const double* p);
CANTERA_CAPI int func_del(int i);
CANTERA_CAPI int func_clear();
CANTERA_CAPI double func_value(int i, double t);
CANTERA_CAPI int func_derivative(int i);
CANTERA_CAPI int func_duplicate(int i);
CANTERA_CAPI int func_write(int i, size_t lennm, const char* arg, char* nm);
CANTERA_CAPI int ct_clearFunc();
#ifdef __cplusplus
}

View file

@ -16,7 +16,7 @@ extern "C" {
CANTERA_CAPI int mix_new();
CANTERA_CAPI int mix_del(int i);
CANTERA_CAPI int mix_clear();
CANTERA_CAPI int ct_clearMix();
CANTERA_CAPI int mix_addPhase(int i, int j, double moles);
CANTERA_CAPI int mix_init(int i);
CANTERA_CAPI int mix_updatePhases(int i);

View file

@ -14,7 +14,7 @@
extern "C" {
#endif
CANTERA_CAPI int domain_clear();
CANTERA_CAPI int ct_clearOneDim();
CANTERA_CAPI int domain_del(int i);
CANTERA_CAPI int domain_type(int i);
CANTERA_CAPI size_t domain_index(int i);
@ -64,7 +64,6 @@ extern "C" {
size_t m, const double* temp);
CANTERA_CAPI int stflow_solveEnergyEqn(int i, int flag);
CANTERA_CAPI int sim1D_clear();
CANTERA_CAPI int sim1D_new(size_t nd, const int* domains);
CANTERA_CAPI int sim1D_del(int i);
CANTERA_CAPI int sim1D_setValue(int i, int dom, int comp, int localPoint, double value);

View file

@ -80,7 +80,7 @@ extern "C" {
CANTERA_CAPI int reactorsurface_setArea(int i, double v);
CANTERA_CAPI int reactorsurface_addSensitivityReaction(int i, int rxn);
CANTERA_CAPI int clear_reactors();
CANTERA_CAPI int ct_clearReactors();
#ifdef __cplusplus
}

View file

@ -42,7 +42,7 @@ extern "C" {
CANTERA_CAPI int rbuild_build(int i, int k, const char* el, const char* dotfile,
int idiag, int iquiet);
CANTERA_CAPI int clear_rxnpath();
CANTERA_CAPI int ct_clearReactionPath();
#ifdef __cplusplus
}

View file

@ -17,7 +17,6 @@ extern "C" {
CANTERA_CAPI int xml_new(const char* name);
CANTERA_CAPI int xml_get_XML_File(const char* file, int debug);
CANTERA_CAPI int xml_del(int i);
CANTERA_CAPI int xml_clear();
CANTERA_CAPI int xml_copy(int i);
CANTERA_CAPI int xml_build(int i, const char* file);
CANTERA_CAPI int xml_attrib(int i, const char* key, size_t lenval, char* value);
@ -34,6 +33,7 @@ extern "C" {
CANTERA_CAPI int xml_addChildNode(int i, int j);
CANTERA_CAPI int xml_write(int i, const char* file);
CANTERA_CAPI int xml_removeChild(int i, int j);
CANTERA_CAPI int ct_clearXML();
#ifdef __cplusplus
}

View file

@ -1389,7 +1389,7 @@ extern "C" {
}
}
int getCanteraError(int buflen, char* buf)
int ct_getCanteraError(int buflen, char* buf)
{
try {
string e = Application::Instance()->lastErrorMessage();
@ -1400,7 +1400,7 @@ extern "C" {
}
}
int addCanteraDirectory(size_t buflen, const char* buf)
int ct_addCanteraDirectory(size_t buflen, const char* buf)
{
try {
addDirectory(buf);
@ -1419,7 +1419,7 @@ extern "C" {
}
}
int setLogWriter(void* logger)
int ct_setLogWriter(void* logger)
{
try {
Logger* logwriter = (Logger*)logger;
@ -1430,7 +1430,7 @@ extern "C" {
}
}
int clearStorage()
int ct_clearStorage()
{
try {
ThermoCabinet::clear();
@ -1472,7 +1472,7 @@ extern "C" {
}
}
int ck_to_cti(const char* in_file, const char* db_file, const char* tr_file,
int ct_ck2cti(const char* in_file, const char* db_file, const char* tr_file,
const char* id_tag, int debug, int validate)
{
try {

View file

@ -111,7 +111,7 @@ extern "C" {
}
}
int func_clear()
int ct_clearFunc()
{
try {
FuncCabinet::clear();

View file

@ -40,7 +40,7 @@ extern "C" {
}
}
int mix_clear()
int ct_clearMix()
{
try {
mixCabinet::clear();

View file

@ -31,10 +31,11 @@ typedef Cabinet<Transport> TransportCabinet;
extern "C" {
int domain_clear()
int ct_clearOneDim()
{
try {
DomainCabinet::clear();
SimCabinet::clear();
return 0;
} catch (...) {
return handleAllExceptions(-1, ERR);
@ -472,16 +473,6 @@ extern "C" {
}
}
int sim1D_clear()
{
try {
SimCabinet::clear();
return 0;
} catch (...) {
return handleAllExceptions(-1, ERR);
}
}
int sim1D_del(int i)
{
try {

View file

@ -670,7 +670,7 @@ extern "C" {
}
}
int clear_reactors()
int ct_clearReactors()
{
try {
ReactorCabinet::clear();

View file

@ -303,7 +303,7 @@ extern "C" {
}
}
int clear_rxnpath()
int ct_clearReactionPath()
{
try {
DiagramCabinet::clear();

View file

@ -48,7 +48,7 @@ extern "C" {
}
}
int xml_clear()
int ct_clearXML()
{
try {
XmlCabinet::clear();

View file

@ -23,9 +23,9 @@ void reportError()
{
int buflen = 0;
char* output_buf = 0;
buflen = getCanteraError(buflen, output_buf) + 1;
buflen = ct_getCanteraError(buflen, output_buf) + 1;
output_buf = (char*)mxCalloc(buflen, sizeof(char));
getCanteraError(buflen, output_buf);
ct_getCanteraError(buflen, output_buf);
mexErrMsgTxt(output_buf);
}
@ -51,14 +51,14 @@ void ctfunctions(int nlhs, mxArray* plhs[],
idtag = getString(prhs[5]);
dbg = getInt(prhs[6]);
validate = getInt(prhs[7]);
iok = ck_to_cti(infile, dbfile, trfile, idtag, dbg, validate);
iok = ct_ck2cti(infile, dbfile, trfile, idtag, dbg, validate);
break;
// get Cantera error
case 2:
buflen = getCanteraError(buflen, output_buf) + 1;
buflen = ct_getCanteraError(buflen, output_buf) + 1;
output_buf = (char*)mxCalloc(buflen, sizeof(char));
iok = getCanteraError(buflen, output_buf);
iok = ct_getCanteraError(buflen, output_buf);
plhs[0] = mxCreateString(output_buf);
iok = 0;
return;
@ -66,19 +66,18 @@ void ctfunctions(int nlhs, mxArray* plhs[],
// add directory
case 3:
infile = getString(prhs[2]);
iok = addCanteraDirectory(strlen(infile), infile);
iok = ct_addCanteraDirectory(strlen(infile), infile);
break;
// clear storage
case 4:
iok = domain_clear();
iok = sim1D_clear();
iok = mix_clear();
iok = xml_clear();
iok = func_clear();
iok = clearStorage();
iok = clear_reactors();
iok = clear_rxnpath();
iok = ct_clearOneDim();
iok = ct_clearMix();
iok = ct_clearXML();
iok = ct_clearFunc();
iok = ct_clearStorage();
iok = ct_clearReactors();
iok = ct_clearReactionPath();
break;
// get string of data directories

View file

@ -86,7 +86,7 @@ void initLogger()
if (!_logger) {
_logger = new Cantera::ML_Logger;
// Call the DLL program to set the logger
setLogWriter(_logger);
ct_setLogWriter(_logger);
}
}