Skip to content

Commit

Permalink
Merge pull request #12 from dbhart/python-toolkit
Browse files Browse the repository at this point in the history
Added two pass-through functions for ENopen and ENclose
  • Loading branch information
cbuahin authored Mar 20, 2024
2 parents 39b7c19 + f5ee097 commit ebabedf
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/solver/include/epanetmsx.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
** LAST UPDATE: 11/01/10
*******************************************************************************/

#include "epanet2.h" // EPANET toolkit header file

#ifndef EPANETMSX_H
#define EPANETMSX_H

Expand Down Expand Up @@ -53,6 +55,8 @@ extern "C" {

// --- declare MSX functions

int MSXDLLEXPORT MSXENopen(const char *inpFile, const char *rptFile,
const char *outFile);
int MSXDLLEXPORT MSXopen(char *fname);
int MSXDLLEXPORT MSXsolveH(void);
int MSXDLLEXPORT MSXusehydfile(char *fname);
Expand All @@ -63,6 +67,7 @@ int MSXDLLEXPORT MSXsaveoutfile(char *fname);
int MSXDLLEXPORT MSXsavemsxfile(char *fname);
int MSXDLLEXPORT MSXreport(void);
int MSXDLLEXPORT MSXclose(void);
int MSXDLLEXPORT MSXENclose(void);

int MSXDLLEXPORT MSXgetindex(int type, char *id, int *index);
int MSXDLLEXPORT MSXgetIDlen(int type, int index, int *len);
Expand Down
32 changes: 32 additions & 0 deletions src/solver/msxtoolkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,38 @@ int MSXfile_save(FILE *f);

//=============================================================================

int MSXDLLEXPORT MSXENopen(const char *inpFile, const char *rptFile, const char *outFile)
/*
** Purpose:
** pass-thru to open the EPANET toolkit system
**
** Input:
** inpFile = name of the EPANET input file
** rptFile = name of the EPANET report file
** outFile = name of the EPANET binary file
**
** Returns:
** an error code (or 0 for no error);
*/
{
int err = 0;
err = ENopen(inpFile, rptFile, outFile);
return err;
}

int MSXDLLEXPORT MSXENclose(void)
/*
** Purpose:
** pass-thru to open the EPANET toolkit system
**
*/
{
int err = 0;
err = ENclose();
return err;
}


int MSXDLLEXPORT MSXopen(char *fname)
/*
** Purpose:
Expand Down

0 comments on commit ebabedf

Please sign in to comment.