Making memorypool.c reentrant and adding test

This commit is contained in:
Michael Tryby
2018-08-30 15:30:34 -04:00
parent 7d374338a7
commit 21f40f0daf
6 changed files with 412 additions and 6 deletions

View File

@@ -185,6 +185,29 @@ int DLLEXPORT ENepanet(const char *f1, const char *f2, const char *f3, void (*pv
return (errcode);
}
int DLLEXPORT EN_runproject(EN_ProjectHandle ph, const char *f1, const char *f2,
const char *f3, void (*pviewprog)(char *))
{
int errcode = 0;
EN_Project *p = NULL;
ERRCODE(EN_open(ph, f1, f2, f3));
p = (EN_Project*)(ph);
p->viewprog = pviewprog;
if (p->out_files.Hydflag != USE) {
ERRCODE(EN_solveH(ph));
}
ERRCODE(EN_solveQ(ph));
ERRCODE(EN_report(ph));
EN_close(ph);
return errcode;
}
int DLLEXPORT ENinit(char *f2, char *f3, int UnitsType,
int HeadlossFormula) {
int errcode = 0;