rethinking the python wrapper (#511)
* renames certain function parameter declarations and removes double pointer call from the deleteproject function * deprecates conditonal compilation, removes python-specific headers and function renaming * fixes tests and docs * fixes test
This commit is contained in:
18
src/epanet.c
18
src/epanet.c
@@ -51,7 +51,7 @@ int DLLEXPORT EN_createproject(EN_Project *p)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int DLLEXPORT EN_deleteproject(EN_Project *p)
|
||||
int DLLEXPORT EN_deleteproject(EN_Project p)
|
||||
/*----------------------------------------------------------------
|
||||
** Input: none
|
||||
** Output: none
|
||||
@@ -60,13 +60,15 @@ int DLLEXPORT EN_deleteproject(EN_Project *p)
|
||||
**----------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
if (*p == NULL) return -1;
|
||||
if ((*p)->Openflag) EN_close(*p);
|
||||
remove((*p)->TmpHydFname);
|
||||
remove((*p)->TmpOutFname);
|
||||
remove((*p)->TmpStatFname);
|
||||
free(*p);
|
||||
*p = NULL;
|
||||
if (p == NULL) return -1;
|
||||
if (p->Openflag) {
|
||||
EN_close(p);
|
||||
}
|
||||
remove(p->TmpHydFname);
|
||||
remove(p->TmpOutFname);
|
||||
remove(p->TmpStatFname);
|
||||
free(p);
|
||||
p = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user