EPANET icon indicating copy to clipboard operation
EPANET copied to clipboard

adds client callback API function

Open samhatchett opened this issue 3 years ago • 3 comments

This addition should be viewed as a helpful counterpart to the pviewprog callback that can be passed into the ENepanet function, but with the inclusion of the project handle and a user-supplied context pointer. If the user supplies a reporting callback, their function will be called each time EPANET wants to log anything that used to go into the report file.

samhatchett avatar Jul 27 '22 20:07 samhatchett

Picky comment: the new functions don't follow the practice of using all lower case for API function names.

Also, can ENsetreportcallback(void (*callback)(void *userData, void EN_projectHandle, char) and ENsetreportcallbackuserdata(void *userData) functions be added to epanet2.h and epanet2.c to have both single- and multi-threaded versions like we do for all of the other API functions?

LRossman avatar Jul 28 '22 14:07 LRossman

@LRossman good catch. I get so used to camel case... and I can totally add mirror functions to the legacy API.

samhatchett avatar Jul 28 '22 20:07 samhatchett

ok, i think this one is good to review and merge based on above feedback.

samhatchett avatar Aug 08 '22 16:08 samhatchett