@model-create/epanet-engine 0.8.0 → 0.9.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Generated from epanet2_2.h on 2026-03-01T05:30:29.185Z
1
+ // Generated from epanet2_2.h on 2026-03-01T05:44:24.589Z
2
2
  // WARNING: This file is auto-generated. Do not edit manually.
3
3
 
4
4
  type Pointer = number;
@@ -84,7 +84,7 @@ from an input file then there is no need to call this function.
84
84
  _EN_init(ph: Pointer, rptFile: Pointer, outFile: Pointer, unitsType: number, headLossType: number): number;
85
85
 
86
86
  /**
87
- * Opens an EPANET input file & reads in network data.
87
+ * Reads an EPANET input file with no errors allowed.
88
88
  *
89
89
  * @param ph an EPANET project handle.
90
90
  * @param inpFile the name of an existing EPANET-formatted input file.
@@ -92,10 +92,25 @@ from an input file then there is no need to call this function.
92
92
  * @param outFile the name of a binary output file to be created (or "" if not needed).
93
93
  * @returns an error code.
94
94
  This function should be called immediately after ::EN_createproject if an EPANET-formatted
95
- input file will be used to supply network data.
95
+ input file will be used to supply network data. If errors are detected then the project is
96
+ not opened and will not accept toolkit function calls.
96
97
  */
97
98
  _EN_open(ph: Pointer, inpFile: Pointer, rptFile: Pointer, outFile: Pointer): number;
98
99
 
100
+ /**
101
+ * Reads an EPANET input file with errors allowed.
102
+ *
103
+ * @param ph an EPANET project handle.
104
+ * @param inpFile the name of an existing EPANET-formatted input file.
105
+ * @param rptFile the name of a report file to be created (or "" if not needed).
106
+ * @param outFile the name of a binary output file to be created (or "" if not needed).
107
+ * @returns an error code.
108
+ This function should be called immediately after ::EN_createproject if an EPANET-formatted
109
+ input file will be used to supply network data. If formatting errors are detected (error
110
+ code = 200) then the project remains open and will accept toolkit function calls.
111
+ */
112
+ _EN_openX(ph: Pointer, inpFile: Pointer, rptFile: Pointer, outFile: Pointer): number;
113
+
99
114
  /**
100
115
  * Retrieves the title lines of the project
101
116
  *
@@ -135,27 +150,49 @@ input file will be used to supply network data.
135
150
  * @param ph an EPANET project handle.
136
151
  * @param object a type of object (either EN_NODE, EN_LINK, EN_TIMEPAT or EN_CURVE)
137
152
  * @param index the object's index starting from 1
138
- * @param comment [out] the comment string assigned to the object
153
+ * @param comment the comment string assigned to the object
139
154
  * @returns an error code
140
155
  */
141
156
  _EN_setcomment(ph: Pointer, object: number, index: number, comment: Pointer): number;
142
157
 
158
+ /**
159
+ * Retrieves a tag string assigned to a Node or Link.
160
+ *
161
+ * @param ph an EPANET project handle.
162
+ * @param object a type of object (either EN_NODE or EN_LINK)
163
+ * @param index the object's index starting from 1
164
+ * @param out_tag [out] the tag string assigned to the object
165
+ * @returns an error code
166
+ */
167
+ _EN_gettag(ph: Pointer, object: number, index: number, out_tag: Pointer): number;
168
+
169
+ /**
170
+ * Assigns a tag string to a Node or Link.
171
+ *
172
+ * @param ph an EPANET project handle.
173
+ * @param object a type of object (either EN_NODE or EN_LINK)
174
+ * @param index the object's index starting from 1
175
+ * @param tag the tag string assigned to the object
176
+ * @returns an error code
177
+ */
178
+ _EN_settag(ph: Pointer, object: number, index: number, tag: Pointer): number;
179
+
143
180
  /**
144
181
  * Retrieves the number of objects of a given type in a project.
145
182
  *
146
183
  * @param ph an EPANET project handle.
147
184
  * @param object a type of object to count (see @ref EN_CountType)
148
- * @param count [out] number of objects of the specified type
185
+ * @param out_count [out] number of objects of the specified type
149
186
  * @returns an error code
150
187
  */
151
- _EN_getcount(ph: Pointer, object: number, count: Pointer): number;
188
+ _EN_getcount(ph: Pointer, object: number, out_count: Pointer): number;
152
189
 
153
190
  /**
154
191
  * Saves a project's data to an EPANET-formatted text file.
155
192
  *
156
193
  * @param ph an EPANET project handle.
157
194
  * @param filename the name of the file to create.
158
- * @returns Error code
195
+ * @returns an error code
159
196
  */
160
197
  _EN_saveinpfile(ph: Pointer, filename: Pointer): number;
161
198
 
@@ -163,7 +200,7 @@ input file will be used to supply network data.
163
200
  * Closes a project and frees all of its memory.
164
201
  *
165
202
  * @param ph an EPANET project handle.
166
- * @returns Error code
203
+ * @returns an error code
167
204
  This function clears all existing data from a project but does not delete the
168
205
  project, so it can be re-used with another set of network data. Use ::EN_deleteproject
169
206
  to actually delete a project from memory.
@@ -251,27 +288,27 @@ and ::EN_getlinkvalue.
251
288
  * Computes a hydraulic solution for the current point in time.
252
289
  *
253
290
  * @param ph an EPANET project handle.
254
- * @param currentTime [out] the current simulation time in seconds.
291
+ * @param out_currentTime [out] the current simulation time in seconds.
255
292
  * @returns an error or warning code.
256
293
  This function is used in a loop with ::EN_nextH to run an extended period hydraulic
257
- simulation. This process automatically updates the simulation clock time so \b currentTime
294
+ simulation. This process automatically updates the simulation clock time so `currentTime`
258
295
  should be treated as a read-only variable.
259
296
  ::EN_initH must have been called prior to running the ::EN_runH - ::EN_nextH loop.
260
297
  See ::EN_nextH for an example of using this function.
261
298
  */
262
- _EN_runH(ph: Pointer, currentTime: Pointer): number;
299
+ _EN_runH(ph: Pointer, out_currentTime: Pointer): number;
263
300
 
264
301
  /**
265
302
  * Determines the length of time until the next hydraulic event occurs in an
266
303
  extended period simulation.
267
304
  *
268
305
  * @param ph an EPANET project handle.
269
- * @param tStep [out] the time (in seconds) until the next hydraulic event or 0 if at
306
+ * @param out_tStep [out] the time (in seconds) until the next hydraulic event or 0 if at
270
307
  the end of the full simulation duration.
271
308
  * @returns an error code.
272
309
  This function is used in a loop with ::EN_runH to run an extended period hydraulic
273
310
  simulation.
274
- The value of \b tstep should be treated as a read-only variable. It is automatically
311
+ The value of `out_tstep` should be treated as a read-only variable. It is automatically
275
312
  computed as the smaller of:
276
313
  - the time interval until the next hydraulic time step begins
277
314
  - the time interval until the next reporting time step begins
@@ -291,7 +328,7 @@ EN_nextH(ph, &tstep);
291
328
  EN_closeH(ph);
292
329
  \endcode
293
330
  */
294
- _EN_nextH(ph: Pointer, tStep: Pointer): number;
331
+ _EN_nextH(ph: Pointer, out_tStep: Pointer): number;
295
332
 
296
333
  /**
297
334
  * Transfers a project's hydraulics results from its temporary hydraulics file
@@ -317,7 +354,7 @@ The hydraulics file contains nodal demands and heads and link flows, status, and
317
354
  for all hydraulic time steps, even intermediate ones.
318
355
  Before calling this function hydraulic results must have been generated and saved by having
319
356
  called ::EN_solveH or the ::EN_initH - ::EN_runH - ::EN_nextH sequence with the initflag
320
- argument of ::EN_initH set to \b EN_SAVE or \b EN_SAVE_AND_INIT.
357
+ argument of ::EN_initH set to `EN_SAVE` or `EN_SAVE_AND_INIT`.
321
358
  */
322
359
  _EN_savehydfile(ph: Pointer, filename: Pointer): number;
323
360
 
@@ -351,7 +388,7 @@ periods.
351
388
  /**
352
389
  * Opens a project's water quality solver.
353
390
  *
354
- * @param ph n EPANET project handle.
391
+ * @param ph an EPANET project handle.
355
392
  * @returns an error code.
356
393
  Call ::EN_openQ prior to running the first water quality analysis using an
357
394
  ::EN_initQ - ::EN_runQ - ::EN_nextQ (or ::EN_stepQ) sequence. Multiple water
@@ -366,8 +403,8 @@ using ::EN_solveQ.
366
403
  * Initializes a network prior to running a water quality analysis.
367
404
  *
368
405
  * @param ph an EPANET project handle.
369
- * @param saveFlag set to \b EN_SAVE (1) if results are to be saved to the project's
370
- binary output file, or to \b EN_NOSAVE (0) if not.
406
+ * @param saveFlag set to `EN_SAVE` (1) if results are to be saved to the project's
407
+ binary output file, or to `EN_NOSAVE` (0) if not.
371
408
  * @returns an error code.
372
409
  Call ::EN_initQ prior to running a water quality analysis using ::EN_runQ in
373
410
  conjunction with either ::EN_nextQ or ::EN_stepQ.
@@ -381,7 +418,7 @@ Do not call ::EN_initQ if a complete water quality analysis will be made using :
381
418
  period available to a project's water quality solver.
382
419
  *
383
420
  * @param ph an EPANET project handle.
384
- * @param currentTime [out] current simulation time in seconds.
421
+ * @param out_currentTime [out] current simulation time in seconds.
385
422
  * @returns an error code.
386
423
  Use ::EN_runQ along with ::EN_nextQ in a loop to access water quality results at the
387
424
  start of each hydraulic period in an extended period simulation. Or use it in a loop
@@ -389,24 +426,24 @@ with ::EN_stepQ to access results at the start of each water quality time step.
389
426
  each of these functions for examples of how to code such loops.
390
427
  ::EN_initQ must have been called prior to running an ::EN_runQ - ::EN_nextQ
391
428
  (or ::EN_stepQ) loop.
392
- The current time of the simulation is determined from information saved with the
393
- hydraulic analysis that preceded the water quality analysis. Treat it as a read-only
394
- variable.
429
+ The current time of the simulation, `out_currentTime`, is determined from information
430
+ saved with the hydraulic analysis that preceded the water quality analysis. Treat it
431
+ as a read-only variable.
395
432
  */
396
- _EN_runQ(ph: Pointer, currentTime: Pointer): number;
433
+ _EN_runQ(ph: Pointer, out_currentTime: Pointer): number;
397
434
 
398
435
  /**
399
436
  * Advances a water quality simulation over the time until the next hydraulic event.
400
437
  *
401
438
  * @param ph an EPANET project handle.
402
- * @param tStep [out] time (in seconds) until the next hydraulic event or 0 if at the end
439
+ * @param out_tStep [out] time (in seconds) until the next hydraulic event or 0 if at the end
403
440
  of the full simulation duration.
404
441
  * @returns an error code.
405
442
  This function is used in a loop with ::EN_runQ to perform an extended period water
406
443
  quality analysis. It reacts and routes a project's water quality constituent over a
407
444
  time step determined by when the next hydraulic event occurs. Use ::EN_stepQ instead
408
445
  if you wish to generate results over each water quality time step.
409
- The value of \b tStep is determined from information produced by the hydraulic analysis
446
+ The value of `out_tStep` is determined from information produced by the hydraulic analysis
410
447
  that preceded the water quality analysis. Treat it as a read-only variable.
411
448
  <b>Example:</b>
412
449
  \code {.c}
@@ -423,22 +460,22 @@ EN_nextQ(ph, &tStep);
423
460
  EN_closeQ(ph);
424
461
  \endcode
425
462
  */
426
- _EN_nextQ(ph: Pointer, tStep: Pointer): number;
463
+ _EN_nextQ(ph: Pointer, out_tStep: Pointer): number;
427
464
 
428
465
  /**
429
466
  * Advances a water quality simulation by a single water quality time step.
430
467
  *
431
468
  * @param ph an EPANET project handle.
432
- * @param timeLeft [out] time left (in seconds) to the overall simulation duration.
469
+ * @param out_timeLeft [out] time left (in seconds) to the overall simulation duration.
433
470
  * @returns an error code.
434
471
  This function is used in a loop with ::EN_runQ to perform an extended period water
435
472
  quality simulation. It allows one to generate water quality results at each water
436
473
  quality time step of the simulation, rather than over each hydraulic event period
437
474
  as with ::EN_nextQ.
438
- Use the argument \b timeLeft to determine when no more calls to ::EN_runQ are needed
439
- because the end of the simulation period has been reached (i.e., when \b timeLeft = 0).
475
+ Use the argument `out_timeLeft` to determine when no more calls to ::EN_runQ are needed
476
+ because the end of the simulation period has been reached (i.e., when `out_timeLeft` = 0).
440
477
  */
441
- _EN_stepQ(ph: Pointer, timeLeft: Pointer): number;
478
+ _EN_stepQ(ph: Pointer, out_timeLeft: Pointer): number;
442
479
 
443
480
  /**
444
481
  * Closes the water quality solver, freeing all of its allocated memory.
@@ -451,12 +488,44 @@ Do not call this function if ::EN_solveQ is being used.
451
488
  */
452
489
  _EN_closeQ(ph: Pointer): number;
453
490
 
491
+ /**
492
+ * Sets a user-supplied callback function for reporting
493
+ *
494
+ * @param ph an EPANET project handle.
495
+ * @param callback a function pointer used for reporting.
496
+ * @returns an error code.
497
+ The callback function replaces the project's report file as
498
+ the destination for all output written by ::EN_writeline. It must have
499
+ the following signature:
500
+ `void(void *userData, void *EN_projectHandle p, const char* s)`
501
+ The `userData` parameter is a pointer to a client-side data object.
502
+ It can be changed using the ::EN_setreportcallbackuserdata function.
503
+ The parameter `s` is a placeholder for the EPANET-generated string
504
+ that was passed into ::EN_writeline. Setting the callback function to
505
+ NULL reverts to having ::EN_writeline use the project's report file.
506
+ */
507
+ _EN_setreportcallback(ph: Pointer, callback: Pointer): number;
508
+
509
+ /**
510
+ * Sets a pointer to a client-side data object
511
+ *
512
+ * @param ph an EPANET project handle.
513
+ * @param userData a pointer to a client-side data object.
514
+ * @returns an error code.
515
+ The data pointer supplied by this function is passed into the callback
516
+ function declared in ::EN_setreportcallback that replaces a project's
517
+ report file as the destination for output written with ::EN_writeline.
518
+ */
519
+ _EN_setreportcallbackuserdata(ph: Pointer, userData: Pointer): number;
520
+
454
521
  /**
455
522
  * Writes a line of text to a project's report file.
456
523
  *
457
524
  * @param ph an EPANET project handle.
458
525
  * @param line a text string to write.
459
526
  * @returns an error code.
527
+ ::EN_setreportcallback can be used to assign an alternative destination
528
+ to write `line` to in place of the project's report file.
460
529
  */
461
530
  _EN_writeline(ph: Pointer, line: Pointer): number;
462
531
 
@@ -530,25 +599,25 @@ using the ::EN_report function.
530
599
  * @returns an error code.
531
600
  Status reporting writes changes in the hydraulics status of network elements to a
532
601
  project's report file as a hydraulic simulation unfolds. There are three levels
533
- of reporting: \b EN_NO_REPORT (no status reporting), \b EN_NORMAL_REPORT (normal
534
- reporting) \b EN_FULL_REPORT (full status reporting).
602
+ of reporting: `EN_NO_REPORT` (no status reporting), `EN_NORMAL_REPORT` (normal
603
+ reporting) `EN_FULL_REPORT` (full status reporting).
535
604
  The full status report contains information at each trial of the solution to the
536
605
  system hydraulic equations at each time step of a simulation. It is useful mainly
537
606
  for debugging purposes.
538
607
  If many hydraulic analyses will be run in the application it is recommended that
539
- status reporting be turned off (<b>level = EN_NO_REPORT</b>).
608
+ status reporting be turned off (`level` = `EN_NO_REPORT`).
540
609
  */
541
610
  _EN_setstatusreport(ph: Pointer, level: number): number;
542
611
 
543
612
  /**
544
613
  * Retrieves the toolkit API version number.
545
614
  *
546
- * @param version [out] the version of the OWA-EPANET toolkit.
615
+ * @param out_version [out] the version of the OWA-EPANET toolkit.
547
616
  * @returns an error code.
548
617
  The version number is to be interpreted with implied decimals, i.e.,
549
618
  "20100" == "2(.)01(.)00"
550
619
  */
551
- _EN_getversion(version: Pointer): number;
620
+ _EN_getversion(out_version: Pointer): number;
552
621
 
553
622
  /**
554
623
  * Returns the text of an error message generated by an error code.
@@ -557,7 +626,7 @@ The version number is to be interpreted with implied decimals, i.e.,
557
626
  * @param out_errmsg [out] the error message generated by the error code
558
627
  * @param maxLen maximum number of characters that errmsg can hold
559
628
  * @returns an error code
560
- Error message strings should be at least @ref EN_SizeLimits "EN_MAXMSG" characters in length.
629
+ Error message strings should be greater than @ref EN_SizeLimits "EN_MAXMSG" characters in length.
561
630
  */
562
631
  _EN_geterror(errcode: number, out_errmsg: Pointer, maxLen: number): number;
563
632
 
@@ -566,10 +635,21 @@ Error message strings should be at least @ref EN_SizeLimits "EN_MAXMSG" characte
566
635
  *
567
636
  * @param ph an EPANET project handle.
568
637
  * @param type the type of statistic to retrieve (see @ref EN_AnalysisStatistic).
569
- * @param value [out] the value of the statistic.
638
+ * @param out_value [out] the value of the statistic.
570
639
  * @returns an error code
571
640
  */
572
- _EN_getstatistic(ph: Pointer, type: number, value: Pointer): number;
641
+ _EN_getstatistic(ph: Pointer, type: number, out_value: Pointer): number;
642
+
643
+ /**
644
+ * Gets information about when the next hydraulic time step occurs.
645
+ *
646
+ * @param ph an EPANET project handle.
647
+ * @param eventType [out] the type of event that will occur (see @ref EN_TimestepEvent).
648
+ * @param duration [out] the amount of time in the future this event will occur
649
+ * @param elementIndex [out] the index of the element causing the event.
650
+ * @returns an error code.
651
+ */
652
+ _EN_timetonextevent(ph: Pointer, eventType: Pointer, duration: Pointer, elementIndex: Pointer): number;
573
653
 
574
654
  /**
575
655
  * Retrieves the order in which a node or link appears in an @ref OutFile "output file".
@@ -577,27 +657,27 @@ Error message strings should be at least @ref EN_SizeLimits "EN_MAXMSG" characte
577
657
  * @param ph an EPANET project handle.
578
658
  * @param type a type of element (either @ref EN_NODE or @ref EN_LINK).
579
659
  * @param index the element's current index (starting from 1).
580
- * @param value [out] the order in which the element's results were written to file.
660
+ * @param out_value [out] the order in which the element's results were written to file.
581
661
  * @returns an error code.
582
662
  If the element does not appear in the file then its result index is 0.
583
663
  This function can be used to correctly retrieve results from an EPANET binary output file
584
664
  after the order of nodes or links in a network's database has been changed due to editing
585
665
  operations.
586
666
  */
587
- _EN_getresultindex(ph: Pointer, type: number, index: number, value: Pointer): number;
667
+ _EN_getresultindex(ph: Pointer, type: number, index: number, out_value: Pointer): number;
588
668
 
589
669
  /**
590
670
  * Retrieves the value of an analysis option.
591
671
  *
592
672
  * @param ph an EPANET project handle.
593
673
  * @param option a type of analysis option (see @ref EN_Option).
594
- * @param value [out] the current value of the option.
674
+ * @param out_value [out] the current value of the option.
595
675
  * @returns an error code
596
676
  */
597
- _EN_getoption(ph: Pointer, option: number, value: Pointer): number;
677
+ _EN_getoption(ph: Pointer, option: number, out_value: Pointer): number;
598
678
 
599
679
  /**
600
- * Sets the value for an anlysis option.
680
+ * Sets the value for an analysis option.
601
681
  *
602
682
  * @param ph an EPANET project handle.
603
683
  * @param option a type of analysis option (see @ref EN_Option).
@@ -611,12 +691,12 @@ operations.
611
691
  * Retrieves a project's flow units.
612
692
  *
613
693
  * @param ph an EPANET project handle.
614
- * @param units [out] a flow units code (see @ref EN_FlowUnits)
694
+ * @param out_units [out] a flow units code (see @ref EN_FlowUnits)
615
695
  * @returns an error code.
616
696
  Flow units in liters or cubic meters implies that SI metric units are used for all
617
697
  other quantities in addition to flow. Otherwise US Customary units are employed.
618
698
  */
619
- _EN_getflowunits(ph: Pointer, units: Pointer): number;
699
+ _EN_getflowunits(ph: Pointer, out_units: Pointer): number;
620
700
 
621
701
  /**
622
702
  * Sets a project's flow units.
@@ -634,10 +714,10 @@ other quantities in addition to flow. Otherwise US Customary units are employed.
634
714
  *
635
715
  * @param ph an EPANET project handle.
636
716
  * @param param a time parameter code (see @ref EN_TimeParameter).
637
- * @param value [out] the current value of the time parameter (in seconds).
717
+ * @param out_value [out] the current value of the time parameter (in seconds).
638
718
  * @returns an error code.
639
719
  */
640
- _EN_gettimeparam(ph: Pointer, param: number, value: Pointer): number;
720
+ _EN_gettimeparam(ph: Pointer, param: number, out_value: Pointer): number;
641
721
 
642
722
  /**
643
723
  * Sets the value of a time parameter.
@@ -653,23 +733,23 @@ other quantities in addition to flow. Otherwise US Customary units are employed.
653
733
  * Gets information about the type of water quality analysis requested.
654
734
  *
655
735
  * @param ph an EPANET project handle.
656
- * @param qualType [out] type of analysis to run (see @ref EN_QualityType).
736
+ * @param out_qualType [out] type of analysis to run (see @ref EN_QualityType).
657
737
  * @param out_chemName [out] name of chemical constituent.
658
738
  * @param out_chemUnits [out] concentration units of the constituent.
659
- * @param traceNode [out] index of the node being traced (if applicable).
739
+ * @param out_traceNode [out] index of the node being traced (if applicable).
660
740
  * @returns an error code.
661
741
  */
662
- _EN_getqualinfo(ph: Pointer, qualType: Pointer, out_chemName: Pointer, out_chemUnits: Pointer, traceNode: Pointer): number;
742
+ _EN_getqualinfo(ph: Pointer, out_qualType: Pointer, out_chemName: Pointer, out_chemUnits: Pointer, out_traceNode: Pointer): number;
663
743
 
664
744
  /**
665
745
  * Retrieves the type of water quality analysis to be run.
666
746
  *
667
747
  * @param ph an EPANET project handle.
668
- * @param qualType [out] the type of analysis to run (see @ref EN_QualityType).
669
- * @param traceNode [out] the index of node being traced, if <b>qualType = EN_TRACE</b>.
748
+ * @param out_qualType [out] the type of analysis to run (see @ref EN_QualityType).
749
+ * @param out_traceNode [out] the index of node being traced if `out_qualType` = `EN_TRACE`.
670
750
  * @returns an error code.
671
751
  */
672
- _EN_getqualtype(ph: Pointer, qualType: Pointer, traceNode: Pointer): number;
752
+ _EN_getqualtype(ph: Pointer, out_qualType: Pointer, out_traceNode: Pointer): number;
673
753
 
674
754
  /**
675
755
  * Sets the type of water quality analysis to run.
@@ -678,7 +758,7 @@ other quantities in addition to flow. Otherwise US Customary units are employed.
678
758
  * @param qualType the type of analysis to run (see @ref EN_QualityType).
679
759
  * @param chemName the name of the quality constituent.
680
760
  * @param chemUnits the concentration units of the constituent.
681
- * @param traceNode the ID name of the node being traced if <b>qualType = EN_TRACE</b>.
761
+ * @param traceNode the ID name of the node being traced if `qualType` = `EN_TRACE`.
682
762
  * @returns an error code.
683
763
  Chemical name and units can be an empty string if the analysis is not for a chemical.
684
764
  The same holds for the trace node if the analysis is not for source tracing.
@@ -692,11 +772,11 @@ Note that the trace node is specified by ID name and not by index.
692
772
  * @param ph an EPANET project handle.
693
773
  * @param id the ID name of the node to be added.
694
774
  * @param nodeType the type of node being added (see @ref EN_NodeType)
695
- * @param index [out] the index of the newly added node
775
+ * @param out_index [out] the index of the newly added node
696
776
  * @returns an error code.
697
777
  When a new node is created all of its properties (see @ref EN_NodeProperty) are set to 0.
698
778
  */
699
- _EN_addnode(ph: Pointer, id: Pointer, nodeType: number, index: Pointer): number;
779
+ _EN_addnode(ph: Pointer, id: Pointer, nodeType: number, out_index: Pointer): number;
700
780
 
701
781
  /**
702
782
  * Deletes a node from a project.
@@ -705,9 +785,9 @@ When a new node is created all of its properties (see @ref EN_NodeProperty) are
705
785
  * @param index the index of the node to be deleted.
706
786
  * @param actionCode the action taken if any control contains the node and its links.
707
787
  * @returns an error code.
708
- If \b actionCode is \b EN_UNCONDITIONAL then the node, its incident links and all
788
+ If `actionCode` is `EN_UNCONDITIONAL` then the node, its incident links and all
709
789
  simple and rule-based controls that contain them are deleted. If set to
710
- \b EN_CONDITIONAL then the node is not deleted if it or its incident links appear
790
+ `EN_CONDITIONAL` then the node is not deleted if it or its incident links appear
711
791
  in any controls and error code 261 is returned.
712
792
  */
713
793
  _EN_deletenode(ph: Pointer, index: number, actionCode: number): number;
@@ -717,10 +797,10 @@ in any controls and error code 261 is returned.
717
797
  *
718
798
  * @param ph an EPANET project handle.
719
799
  * @param id a node ID name.
720
- * @param index [out] the node's index (starting from 1).
800
+ * @param out_index [out] the node's index (starting from 1).
721
801
  * @returns an error code
722
802
  */
723
- _EN_getnodeindex(ph: Pointer, id: Pointer, index: Pointer): number;
803
+ _EN_getnodeindex(ph: Pointer, id: Pointer, out_index: Pointer): number;
724
804
 
725
805
  /**
726
806
  * Gets the ID name of a node given its index.
@@ -729,7 +809,7 @@ in any controls and error code 261 is returned.
729
809
  * @param index a node's index (starting from 1).
730
810
  * @param out_id [out] the node's ID name.
731
811
  * @returns an error code
732
- The ID name must be sized to hold at least @ref EN_SizeLimits "EN_MAXID" characters.
812
+ The ID name must be sized to hold at least @ref EN_SizeLimits "EN_MAXID+1" characters.
733
813
  */
734
814
  _EN_getnodeid(ph: Pointer, index: number, out_id: Pointer): number;
735
815
 
@@ -749,23 +829,10 @@ The ID name must not be longer than @ref EN_SizeLimits "EN_MAXID" characters.
749
829
  *
750
830
  * @param ph an EPANET project handle.
751
831
  * @param index a node's index (starting from 1).
752
- * @param nodeType [out] the node's type (see @ref EN_NodeType).
753
- * @returns an error code.
754
- */
755
- _EN_getnodetype(ph: Pointer, index: number, nodeType: Pointer): number;
756
-
757
- /**
758
- * Retrieves a property value for a node.
759
- *
760
- * @param ph an EPANET project handle.
761
- * @param index a node's index.
762
- * @param property the property to retrieve (see @ref EN_NodeProperty).
763
- * @param value [out] the current value of the property.
832
+ * @param out_nodeType [out] the node's type (see @ref EN_NodeType).
764
833
  * @returns an error code.
765
- Values are returned in units that depend on the units used for flow rate
766
- (see @ref Units).
767
834
  */
768
- _EN_getnodevalue(ph: Pointer, index: number, property: number, value: Pointer): number;
835
+ _EN_getnodetype(ph: Pointer, index: number, out_nodeType: Pointer): number;
769
836
 
770
837
  /**
771
838
  * Sets a property value for a node.
@@ -814,11 +881,11 @@ These properties have units that depend on the units used for flow rate (see @re
814
881
  *
815
882
  * @param ph an EPANET project handle.
816
883
  * @param index a node index (starting from 1).
817
- * @param x [out] the node's X-coordinate value.
818
- * @param y [out] the node's Y-coordinate value.
884
+ * @param out_x [out] the node's X-coordinate value.
885
+ * @param out_y [out] the node's Y-coordinate value.
819
886
  * @returns an error code.
820
887
  */
821
- _EN_getcoord(ph: Pointer, index: number, x: Pointer, y: Pointer): number;
888
+ _EN_getcoord(ph: Pointer, index: number, out_x: Pointer, out_y: Pointer): number;
822
889
 
823
890
  /**
824
891
  * Sets the (x,y) coordinates of a node.
@@ -835,14 +902,14 @@ These properties have units that depend on the units used for flow rate (see @re
835
902
  * Retrieves the type of demand model in use and its parameters.
836
903
  *
837
904
  * @param ph an EPANET project handle.
838
- * @param type [out] Type of demand model (see @ref EN_DemandModel).
839
- * @param pmin [out] Pressure below which there is no demand.
840
- * @param preq [out] Pressure required to deliver full demand.
841
- * @param pexp [out] Pressure exponent in demand function.
905
+ * @param out_type [out] Type of demand model (see @ref EN_DemandModel).
906
+ * @param out_pmin [out] Pressure below which there is no demand.
907
+ * @param out_preq [out] Pressure required to deliver full demand.
908
+ * @param out_pexp [out] Pressure exponent in demand function.
842
909
  * @returns an error code.
843
- Parameters <b>pmin, preq,</b> and \b pexp are only used when the demand model is \b EN_PDA.
910
+ Parameters `out_pmin`, `out_preq`, and `out_pexp` are only used when the demand model is `EN_PDA`.
844
911
  */
845
- _EN_getdemandmodel(ph: Pointer, type: Pointer, pmin: Pointer, preq: Pointer, pexp: Pointer): number;
912
+ _EN_getdemandmodel(ph: Pointer, out_type: Pointer, out_pmin: Pointer, out_preq: Pointer, out_pexp: Pointer): number;
846
913
 
847
914
  /**
848
915
  * Sets the type of demand model to use and its parameters.
@@ -853,14 +920,12 @@ Parameters <b>pmin, preq,</b> and \b pexp are only used when the demand model is
853
920
  * @param preq Pressure required to deliver full demand.
854
921
  * @param pexp Pressure exponent in demand function.
855
922
  * @returns an error code.
856
- Set \b type to \b EN_DDA for a traditional demand driven analysis (in which case the
857
- remaining three parameter values are ignored) or to \b EN_PDA for a pressure driven
858
- analysis. In the latter case a node's demand is computed as:
859
- > `Dfull * [ (P - pmin) / (preq - pmin) ] ^ pexp`
923
+ Set `type` to `EN_DDA` for a traditional demand driven analysis (in which case the
924
+ remaining three parameter values are ignored) or to `EN_PDA` for a pressure driven
925
+ analysis. In the latter case a node's demand is 0 when pressure is below `pmin`, is at full demand when pressure is above `preq`, or is otherwise computed as:\n
926
+ `Dfull * [ (P - pmin) / (preq - pmin) ] ^ pexp`\n
860
927
  where `Dfull` is the full demand and `P` is the current pressure.
861
- Setting \b preq equal to \b pmin will result in a solution with the smallest amount of
862
- demand reductions needed to insure that no node delivers positive demand at a pressure
863
- below \b pmin.
928
+ A valid value for `preq` must be at least 0.1 pressure units larger than `pmin`.
864
929
  */
865
930
  _EN_setdemandmodel(ph: Pointer, type: number, pmin: number, preq: number, pexp: number): number;
866
931
 
@@ -894,20 +959,20 @@ that no time pattern or category name is associated with the demand.
894
959
  * @param ph an EPANET project handle.
895
960
  * @param nodeIndex the index of a node (starting from 1)
896
961
  * @param demandName the name of a demand category for the node
897
- * @param demandIndex [out] the index of the demand being sought
962
+ * @param out_demandIndex [out] the index of the demand being sought
898
963
  * @returns an error code
899
964
  */
900
- _EN_getdemandindex(ph: Pointer, nodeIndex: number, demandName: Pointer, demandIndex: Pointer): number;
965
+ _EN_getdemandindex(ph: Pointer, nodeIndex: number, demandName: Pointer, out_demandIndex: Pointer): number;
901
966
 
902
967
  /**
903
968
  * Retrieves the number of demand categories for a junction node.
904
969
  *
905
970
  * @param ph an EPANET project handle.
906
971
  * @param nodeIndex the index of a node (starting from 1).
907
- * @param numDemands [out] the number of demand categories assigned to the node.
972
+ * @param out_numDemands [out] the number of demand categories assigned to the node.
908
973
  * @returns an error code.
909
974
  */
910
- _EN_getnumdemands(ph: Pointer, nodeIndex: number, numDemands: Pointer): number;
975
+ _EN_getnumdemands(ph: Pointer, nodeIndex: number, out_numDemands: Pointer): number;
911
976
 
912
977
  /**
913
978
  * Gets the base demand for one of a node's demand categories.
@@ -915,10 +980,10 @@ that no time pattern or category name is associated with the demand.
915
980
  * @param ph an EPANET project handle.
916
981
  * @param nodeIndex a node's index (starting from 1).
917
982
  * @param demandIndex the index of a demand category for the node (starting from 1).
918
- * @param baseDemand [out] the category's base demand.
983
+ * @param out_baseDemand [out] the category's base demand.
919
984
  * @returns an error code.
920
985
  */
921
- _EN_getbasedemand(ph: Pointer, nodeIndex: number, demandIndex: number, baseDemand: Pointer): number;
986
+ _EN_getbasedemand(ph: Pointer, nodeIndex: number, demandIndex: number, out_baseDemand: Pointer): number;
922
987
 
923
988
  /**
924
989
  * Sets the base demand for one of a node's demand categories.
@@ -937,12 +1002,12 @@ that no time pattern or category name is associated with the demand.
937
1002
  * @param ph an EPANET project handle.
938
1003
  * @param nodeIndex the node's index (starting from 1).
939
1004
  * @param demandIndex the index of a demand category for the node (starting from 1).
940
- * @param patIndex [out] the index of the category's time pattern.
1005
+ * @param out_patIndex [out] the index of the category's time pattern.
941
1006
  * @returns an error code.
942
1007
  A returned pattern index of 0 indicates that no time pattern has been assigned to the
943
1008
  demand category.
944
1009
  */
945
- _EN_getdemandpattern(ph: Pointer, nodeIndex: number, demandIndex: number, patIndex: Pointer): number;
1010
+ _EN_getdemandpattern(ph: Pointer, nodeIndex: number, demandIndex: number, out_patIndex: Pointer): number;
946
1011
 
947
1012
  /**
948
1013
  * Sets the index of a time pattern used for one of a node's demand categories.
@@ -965,7 +1030,7 @@ demand category.
965
1030
  * @param demandIndex the index of one of the node's demand categories (starting from 1).
966
1031
  * @param out_demandName [out] The name of the selected category.
967
1032
  * @returns an error code.
968
- \b demandName must be sized to contain at least @ref EN_SizeLimits "EN_MAXID" characters.
1033
+ `out_demandName` must be sized to contain at least @ref EN_SizeLimits "EN_MAXID+1" characters.
969
1034
  */
970
1035
  _EN_getdemandname(ph: Pointer, nodeIndex: number, demandIndex: number, out_demandName: Pointer): number;
971
1036
 
@@ -976,7 +1041,7 @@ demand category.
976
1041
  * @param nodeIndex a node's index (starting from 1).
977
1042
  * @param demandIdx the index of one of the node's demand categories (starting from 1).
978
1043
  * @param demandName the new name assigned to the category.
979
- * @returns Error code.
1044
+ * @returns an error code.
980
1045
  The category name must contain no more than @ref EN_SizeLimits "EN_MAXID" characters.
981
1046
  */
982
1047
  _EN_setdemandname(ph: Pointer, nodeIndex: number, demandIdx: number, demandName: Pointer): number;
@@ -989,7 +1054,7 @@ The category name must contain no more than @ref EN_SizeLimits "EN_MAXID" charac
989
1054
  * @param linkType The type of link being added (see @ref EN_LinkType)
990
1055
  * @param fromNode The ID name of the link's starting node.
991
1056
  * @param toNode The ID name of the link's ending node.
992
- * @param index [out] the index of the newly added link.
1057
+ * @param out_index [out] the index of the newly added link.
993
1058
  * @returns an error code.
994
1059
  A new pipe is assigned a diameter of 10 inches (254 mm) and a length of 330
995
1060
  feet (~ 100 meters). Its roughness coefficient depends on the head loss formula in effect (see @ref EN_HeadLossType) as follows:
@@ -997,12 +1062,12 @@ feet (~ 100 meters). Its roughness coefficient depends on the head loss formula
997
1062
  - Darcy-Weisbach formula: 0.5 millifeet (0.15 mm)
998
1063
  - Chezy-Manning formula: 0.01
999
1064
  All other pipe properties are set to 0.
1000
- A new pump has a status of \b EN_OPEN, a speed setting of 1, and has no pump
1065
+ A new pump has a status of `EN_OPEN`, a speed setting of 1, and has no pump
1001
1066
  curve or power rating assigned to it.
1002
1067
  A new valve has a diameter of 10 inches (254 mm) and all other properties set to 0.
1003
1068
  See @ref EN_LinkProperty.
1004
1069
  */
1005
- _EN_addlink(ph: Pointer, id: Pointer, linkType: number, fromNode: Pointer, toNode: Pointer, index: Pointer): number;
1070
+ _EN_addlink(ph: Pointer, id: Pointer, linkType: number, fromNode: Pointer, toNode: Pointer, out_index: Pointer): number;
1006
1071
 
1007
1072
  /**
1008
1073
  * Deletes a link from the project.
@@ -1011,8 +1076,8 @@ See @ref EN_LinkProperty.
1011
1076
  * @param index the index of the link to be deleted.
1012
1077
  * @param actionCode The action taken if any control contains the link.
1013
1078
  * @returns an error code.
1014
- If \b actionCode is \b EN_UNCONDITIONAL then the link and all simple and rule-based
1015
- controls that contain it are deleted. If set to \b EN_CONDITIONAL then the link
1079
+ If `actionCode` is `EN_UNCONDITIONAL` then the link and all simple and rule-based
1080
+ controls that contain it are deleted. If set to `EN_CONDITIONAL` then the link
1016
1081
  is not deleted if it appears in any control and error 261 is returned.
1017
1082
  */
1018
1083
  _EN_deletelink(ph: Pointer, index: number, actionCode: number): number;
@@ -1022,10 +1087,10 @@ is not deleted if it appears in any control and error 261 is returned.
1022
1087
  *
1023
1088
  * @param ph an EPANET project handle.
1024
1089
  * @param id a link's ID name.
1025
- * @param index [out] the link's index (starting from 1).
1090
+ * @param out_index [out] the link's index (starting from 1).
1026
1091
  * @returns an error code.
1027
1092
  */
1028
- _EN_getlinkindex(ph: Pointer, id: Pointer, index: Pointer): number;
1093
+ _EN_getlinkindex(ph: Pointer, id: Pointer, out_index: Pointer): number;
1029
1094
 
1030
1095
  /**
1031
1096
  * Gets the ID name of a link given its index.
@@ -1034,7 +1099,7 @@ is not deleted if it appears in any control and error 261 is returned.
1034
1099
  * @param index a link's index (starting from 1).
1035
1100
  * @param out_id [out] The link's ID name.
1036
1101
  * @returns an error code.
1037
- The ID name must be sized to hold at least @ref EN_SizeLimits "EN_MAXID" characters.
1102
+ The ID name must be sized to hold at least @ref EN_SizeLimits "EN_MAXID+1" characters.
1038
1103
  */
1039
1104
  _EN_getlinkid(ph: Pointer, index: number, out_id: Pointer): number;
1040
1105
 
@@ -1044,7 +1109,7 @@ The ID name must be sized to hold at least @ref EN_SizeLimits "EN_MAXID" charact
1044
1109
  * @param ph an EPANET project handle.
1045
1110
  * @param index a link's index (starting from 1).
1046
1111
  * @param newid the new ID name for the link.
1047
- * @returns Error code.
1112
+ * @returns an error code.
1048
1113
  The ID name must not be longer than @ref EN_SizeLimits "EN_MAXID" characters.
1049
1114
  */
1050
1115
  _EN_setlinkid(ph: Pointer, index: number, newid: Pointer): number;
@@ -1054,10 +1119,10 @@ The ID name must not be longer than @ref EN_SizeLimits "EN_MAXID" characters.
1054
1119
  *
1055
1120
  * @param ph an EPANET project handle.
1056
1121
  * @param index a link's index (starting from 1).
1057
- * @param linkType [out] the link's type (see @ref EN_LinkType).
1122
+ * @param out_linkType [out] the link's type (see @ref EN_LinkType).
1058
1123
  * @returns an error code.
1059
1124
  */
1060
- _EN_getlinktype(ph: Pointer, index: number, linkType: Pointer): number;
1125
+ _EN_getlinktype(ph: Pointer, index: number, out_linkType: Pointer): number;
1061
1126
 
1062
1127
  /**
1063
1128
  * Changes a link's type.
@@ -1067,10 +1132,11 @@ The ID name must not be longer than @ref EN_SizeLimits "EN_MAXID" characters.
1067
1132
  * @param linkType the new type to change the link to (see @ref EN_LinkType).
1068
1133
  * @param actionCode the action taken if any controls contain the link.
1069
1134
  * @returns an error code.
1070
- If \b actionCode is \b EN_UNCONDITIONAL then all simple and rule-based controls that
1135
+ If `actionCode` is `EN_UNCONDITIONAL` then all simple and rule-based controls that
1071
1136
  contain the link are deleted when the link's type is changed. If set to
1072
- \b EN_CONDITIONAL then the type change is cancelled if the link appears in any
1137
+ `EN_CONDITIONAL` then the type change is cancelled if the link appears in any
1073
1138
  control and error 261 is returned.
1139
+ To only change a valve's type (such as from PRV to PSV) use ::EN_setlinkvalue with property `EN_VALVE_TYPE` whose value is selected from the valves in @ref EN_LinkType.
1074
1140
  */
1075
1141
  _EN_setlinktype(ph: Pointer, inout_index: Pointer, linkType: number, actionCode: number): number;
1076
1142
 
@@ -1079,11 +1145,11 @@ control and error 261 is returned.
1079
1145
  *
1080
1146
  * @param ph an EPANET project handle.
1081
1147
  * @param index a link's index (starting from 1).
1082
- * @param node1 [out] the index of the link's start node (starting from 1).
1083
- * @param node2 [out] the index of the link's end node (starting from 1).
1148
+ * @param out_node1 [out] the index of the link's start node (starting from 1).
1149
+ * @param out_node2 [out] the index of the link's end node (starting from 1).
1084
1150
  * @returns an error code.
1085
1151
  */
1086
- _EN_getlinknodes(ph: Pointer, index: number, node1: Pointer, node2: Pointer): number;
1152
+ _EN_getlinknodes(ph: Pointer, index: number, out_node1: Pointer, out_node2: Pointer): number;
1087
1153
 
1088
1154
  /**
1089
1155
  * Sets the indexes of a link's start- and end-nodes.
@@ -1102,11 +1168,22 @@ control and error 261 is returned.
1102
1168
  * @param ph an EPANET project handle.
1103
1169
  * @param index a link's index (starting from 1).
1104
1170
  * @param property the property to retrieve (see @ref EN_LinkProperty).
1105
- * @param value [out] the current value of the property.
1171
+ * @param out_value [out] the current value of the property.
1106
1172
  * @returns an error code.
1107
1173
  Values are returned in units that depend on the units used for flow rate (see @ref Units).
1108
1174
  */
1109
- _EN_getlinkvalue(ph: Pointer, index: number, property: number, value: Pointer): number;
1175
+ _EN_getlinkvalue(ph: Pointer, index: number, property: number, out_value: Pointer): number;
1176
+
1177
+ /**
1178
+ * Retrieves an array of property values for all links.
1179
+ *
1180
+ * @param ph an EPANET project handle.
1181
+ * @param property the property to retrieve (see @ref EN_LinkProperty).
1182
+ * @param out_values [out] an array of values for all links.
1183
+ * @returns an error code.
1184
+ Values are returned in units that depend on the units used for flow rate (see @ref Units).
1185
+ */
1186
+ _EN_getlinkvalues(ph: Pointer, property: number, out_values: Pointer): number;
1110
1187
 
1111
1188
  /**
1112
1189
  * Sets a property value for a link.
@@ -1139,22 +1216,34 @@ These properties have units that depend on the units used for flow rate (see @re
1139
1216
  *
1140
1217
  * @param ph an EPANET project handle.
1141
1218
  * @param index a link's index (starting from 1).
1142
- * @param count [out] the number of vertex points that describe the link's shape.
1219
+ * @param out_count [out] the number of vertex points that describe the link's shape.
1220
+ * @returns an error code.
1221
+ */
1222
+ _EN_getvertexcount(ph: Pointer, index: number, out_count: Pointer): number;
1223
+
1224
+ /**
1225
+ * Retrieves the coordinates of a vertex point assigned to a link.
1226
+ *
1227
+ * @param ph an EPANET project handle.
1228
+ * @param index a link's index (starting from 1).
1229
+ * @param vertex a vertex point index (starting from 1).
1230
+ * @param out_x [out] the vertex's X-coordinate value.
1231
+ * @param out_y [out] the vertex's Y-coordinate value.
1143
1232
  * @returns an error code.
1144
1233
  */
1145
- _EN_getvertexcount(ph: Pointer, index: number, count: Pointer): number;
1234
+ _EN_getvertex(ph: Pointer, index: number, vertex: number, out_x: Pointer, out_y: Pointer): number;
1146
1235
 
1147
1236
  /**
1148
- * Retrieves the coordinate's of a vertex point assigned to a link.
1237
+ * Sets the coordinates of a vertex point assigned to a link.
1149
1238
  *
1150
1239
  * @param ph an EPANET project handle.
1151
1240
  * @param index a link's index (starting from 1).
1152
1241
  * @param vertex a vertex point index (starting from 1).
1153
- * @param x [out] the vertex's X-coordinate value.
1154
- * @param y [out] the vertex's Y-coordinate value.
1242
+ * @param x the vertex's X-coordinate value.
1243
+ * @param y the vertex's Y-coordinate value.
1155
1244
  * @returns an error code.
1156
1245
  */
1157
- _EN_getvertex(ph: Pointer, index: number, vertex: number, x: Pointer, y: Pointer): number;
1246
+ _EN_setvertex(ph: Pointer, index: number, vertex: number, x: number, y: number): number;
1158
1247
 
1159
1248
  /**
1160
1249
  * Assigns a set of internal vertex points to a link.
@@ -1174,20 +1263,20 @@ Replaces any existing vertices previously assigned to the link.
1174
1263
  *
1175
1264
  * @param ph an EPANET project handle.
1176
1265
  * @param linkIndex the index of a pump link (starting from 1).
1177
- * @param pumpType [out] the type of head curve used by the pump (see @ref EN_PumpType).
1266
+ * @param out_pumpType [out] the type of head curve used by the pump (see @ref EN_PumpType).
1178
1267
  * @returns an error code.
1179
1268
  */
1180
- _EN_getpumptype(ph: Pointer, linkIndex: number, pumpType: Pointer): number;
1269
+ _EN_getpumptype(ph: Pointer, linkIndex: number, out_pumpType: Pointer): number;
1181
1270
 
1182
1271
  /**
1183
1272
  * Retrieves the curve assigned to a pump's head curve.
1184
1273
  *
1185
1274
  * @param ph an EPANET project handle.
1186
1275
  * @param linkIndex the index of a pump link (starting from 1).
1187
- * @param curveIndex [out] the index of the curve assigned to the pump's head curve.
1276
+ * @param out_curveIndex [out] the index of the curve assigned to the pump's head curve.
1188
1277
  * @returns an error code.
1189
1278
  */
1190
- _EN_getheadcurveindex(ph: Pointer, linkIndex: number, curveIndex: Pointer): number;
1279
+ _EN_getheadcurveindex(ph: Pointer, linkIndex: number, out_curveIndex: Pointer): number;
1191
1280
 
1192
1281
  /**
1193
1282
  * Assigns a curve to a pump's head curve.
@@ -1223,10 +1312,10 @@ The new pattern contains a single time period whose factor is 1.0.
1223
1312
  *
1224
1313
  * @param ph an EPANET project handle.
1225
1314
  * @param id the ID name of a time pattern.
1226
- * @param index [out] the time pattern's index (starting from 1).
1315
+ * @param out_index [out] the time pattern's index (starting from 1).
1227
1316
  * @returns an error code.
1228
1317
  */
1229
- _EN_getpatternindex(ph: Pointer, id: Pointer, index: Pointer): number;
1318
+ _EN_getpatternindex(ph: Pointer, id: Pointer, out_index: Pointer): number;
1230
1319
 
1231
1320
  /**
1232
1321
  * Retrieves the ID name of a time pattern given its index.
@@ -1235,7 +1324,7 @@ The new pattern contains a single time period whose factor is 1.0.
1235
1324
  * @param index a time pattern index (starting from 1).
1236
1325
  * @param out_id [out] the time pattern's ID name.
1237
1326
  * @returns an error code.
1238
- The ID name must be sized to hold at least @ref EN_SizeLimits "EN_MAXID" characters.
1327
+ The ID name must be sized to hold at least @ref EN_SizeLimits "EN_MAXID+1" characters.
1239
1328
  */
1240
1329
  _EN_getpatternid(ph: Pointer, index: number, out_id: Pointer): number;
1241
1330
 
@@ -1255,10 +1344,10 @@ The new ID name must not exceed @ref EN_SizeLimits "EN_MAXID" characters.
1255
1344
  *
1256
1345
  * @param ph an EPANET project handle.
1257
1346
  * @param index a time pattern index (starting from 1).
1258
- * @param len [out] the number of time periods in the pattern.
1347
+ * @param out_len [out] the number of time periods in the pattern.
1259
1348
  * @returns an error code.
1260
1349
  */
1261
- _EN_getpatternlen(ph: Pointer, index: number, len: Pointer): number;
1350
+ _EN_getpatternlen(ph: Pointer, index: number, out_len: Pointer): number;
1262
1351
 
1263
1352
  /**
1264
1353
  * Retrieves a time pattern's factor for a given time period.
@@ -1266,10 +1355,10 @@ The new ID name must not exceed @ref EN_SizeLimits "EN_MAXID" characters.
1266
1355
  * @param ph an EPANET project handle.
1267
1356
  * @param index a time pattern index (starting from 1).
1268
1357
  * @param period a time period in the pattern (starting from 1).
1269
- * @param value [out] the pattern factor for the given time period.
1358
+ * @param out_value [out] the pattern factor for the given time period.
1270
1359
  * @returns an error code.
1271
1360
  */
1272
- _EN_getpatternvalue(ph: Pointer, index: number, period: number, value: Pointer): number;
1361
+ _EN_getpatternvalue(ph: Pointer, index: number, period: number, out_value: Pointer): number;
1273
1362
 
1274
1363
  /**
1275
1364
  * Sets a time pattern's factor for a given time period.
@@ -1287,10 +1376,10 @@ The new ID name must not exceed @ref EN_SizeLimits "EN_MAXID" characters.
1287
1376
  *
1288
1377
  * @param ph an EPANET project handle.
1289
1378
  * @param index a time pattern index (starting from 1).
1290
- * @param value [out] The average of all of the time pattern's factors.
1379
+ * @param out_value [out] The average of all of the time pattern's factors.
1291
1380
  * @returns an error code.
1292
1381
  */
1293
- _EN_getaveragepatternvalue(ph: Pointer, index: number, value: Pointer): number;
1382
+ _EN_getaveragepatternvalue(ph: Pointer, index: number, out_value: Pointer): number;
1294
1383
 
1295
1384
  /**
1296
1385
  * Sets the pattern factors for a given time pattern.
@@ -1300,12 +1389,22 @@ The new ID name must not exceed @ref EN_SizeLimits "EN_MAXID" characters.
1300
1389
  * @param values an array of new pattern factor values.
1301
1390
  * @param len the number of factor values supplied.
1302
1391
  * @returns an error code.
1303
- \b values is a zero-based array that contains \b len elements.
1392
+ `values` is a zero-based array that contains `len` elements.
1304
1393
  Use this function to redefine (and resize) a time pattern all at once;
1305
1394
  use @ref EN_setpatternvalue to revise pattern factors one at a time.
1306
1395
  */
1307
1396
  _EN_setpattern(ph: Pointer, index: number, values: Pointer, len: number): number;
1308
1397
 
1398
+ /**
1399
+ * Loads time patterns from a file into a project under a specific pattern ID.
1400
+ *
1401
+ * @param ph an EPANET project handle.
1402
+ * @param filename the name of the file containing pattern data.
1403
+ * @param id the ID name of the new pattern to load.
1404
+ * @returns an error code.
1405
+ */
1406
+ _EN_loadpatternfile(ph: Pointer, filename: Pointer, id: Pointer): number;
1407
+
1309
1408
  /**
1310
1409
  * Adds a new data curve to a project.
1311
1410
  *
@@ -1330,10 +1429,10 @@ The new curve contains a single data point (1.0, 1.0).
1330
1429
  *
1331
1430
  * @param ph an EPANET project handle.
1332
1431
  * @param id the ID name of a curve.
1333
- * @param index [out] The curve's index (starting from 1).
1432
+ * @param out_index [out] The curve's index (starting from 1).
1334
1433
  * @returns an error code.
1335
1434
  */
1336
- _EN_getcurveindex(ph: Pointer, id: Pointer, index: Pointer): number;
1435
+ _EN_getcurveindex(ph: Pointer, id: Pointer, out_index: Pointer): number;
1337
1436
 
1338
1437
  /**
1339
1438
  * Retrieves the ID name of a curve given its index.
@@ -1342,7 +1441,7 @@ The new curve contains a single data point (1.0, 1.0).
1342
1441
  * @param index a curve's index (starting from 1).
1343
1442
  * @param out_id [out] the curve's ID name.
1344
1443
  * @returns an error code.
1345
- The ID name must be sized to hold at least @ref EN_SizeLimits "EN_MAXID" characters.
1444
+ The ID name must be sized to hold at least @ref EN_SizeLimits "EN_MAXID+1" characters.
1346
1445
  */
1347
1446
  _EN_getcurveid(ph: Pointer, index: number, out_id: Pointer): number;
1348
1447
 
@@ -1362,20 +1461,30 @@ The new ID name must not exceed @ref EN_SizeLimits "EN_MAXID" characters.
1362
1461
  *
1363
1462
  * @param ph an EPANET project handle.
1364
1463
  * @param index a curve's index (starting from 1).
1365
- * @param len [out] The number of data points assigned to the curve.
1464
+ * @param out_len [out] The number of data points assigned to the curve.
1366
1465
  * @returns an error code.
1367
1466
  */
1368
- _EN_getcurvelen(ph: Pointer, index: number, len: Pointer): number;
1467
+ _EN_getcurvelen(ph: Pointer, index: number, out_len: Pointer): number;
1369
1468
 
1370
1469
  /**
1371
1470
  * Retrieves a curve's type.
1372
1471
  *
1373
1472
  * @param ph an EPANET project handle.
1374
1473
  * @param index a curve's index (starting from 1).
1375
- * @param type [out] the curve's type (see @ref EN_CurveType).
1474
+ * @param out_type [out] the curve's type (see @ref EN_CurveType).
1475
+ * @returns an error code.
1476
+ */
1477
+ _EN_getcurvetype(ph: Pointer, index: number, out_type: Pointer): number;
1478
+
1479
+ /**
1480
+ * Sets a curve's type.
1481
+ *
1482
+ * @param ph an EPANET project handle.
1483
+ * @param index a curve's index (starting from 1).
1484
+ * @param type the curve's type (see @ref EN_CurveType).
1376
1485
  * @returns an error code.
1377
1486
  */
1378
- _EN_getcurvetype(ph: Pointer, index: number, type: Pointer): number;
1487
+ _EN_setcurvetype(ph: Pointer, index: number, type: number): number;
1379
1488
 
1380
1489
  /**
1381
1490
  * Retrieves the value of a single data point for a curve.
@@ -1383,11 +1492,11 @@ The new ID name must not exceed @ref EN_SizeLimits "EN_MAXID" characters.
1383
1492
  * @param ph an EPANET project handle.
1384
1493
  * @param curveIndex a curve's index (starting from 1).
1385
1494
  * @param pointIndex the index of a point on the curve (starting from 1).
1386
- * @param x [out] the point's x-value.
1387
- * @param y [out] the point's y-value.
1495
+ * @param out_x [out] the point's x-value.
1496
+ * @param out_y [out] the point's y-value.
1388
1497
  * @returns an error code.
1389
1498
  */
1390
- _EN_getcurvevalue(ph: Pointer, curveIndex: number, pointIndex: number, x: Pointer, y: Pointer): number;
1499
+ _EN_getcurvevalue(ph: Pointer, curveIndex: number, pointIndex: number, out_x: Pointer, out_y: Pointer): number;
1391
1500
 
1392
1501
  /**
1393
1502
  * Sets the value of a single data point for a curve.
@@ -1407,15 +1516,15 @@ The new ID name must not exceed @ref EN_SizeLimits "EN_MAXID" characters.
1407
1516
  * @param ph an EPANET project handle.
1408
1517
  * @param index a curve's index (starting from 1).
1409
1518
  * @param out_id [out] the curve's ID name.
1410
- * @param nPoints [out] the number of data points on the curve.
1411
- * @param xValues [out] the curve's x-values.
1412
- * @param yValues [out] the curve's y-values.
1519
+ * @param out_nPoints [out] the number of data points on the curve.
1520
+ * @param out_xValues [out] the curve's x-values.
1521
+ * @param out_yValues [out] the curve's y-values.
1413
1522
  * @returns an error code.
1414
- The calling program is responsible for making `xValues` and `yValues` large enough
1415
- to hold `nPoints` number of data points and for sizing `id` to hold at least
1416
- @ref EN_SizeLimits "EN_MAXID" characters.
1523
+ The calling program is responsible for making `out_xValues` and `out_yValues` large enough
1524
+ to hold `out_nPoints` number of data points and for sizing `out_id` to hold at least
1525
+ @ref EN_SizeLimits "EN_MAXID+1" characters.
1417
1526
  */
1418
- _EN_getcurve(ph: Pointer, index: number, out_id: Pointer, nPoints: Pointer, xValues: Pointer, yValues: Pointer): number;
1527
+ _EN_getcurve(ph: Pointer, index: number, out_id: Pointer, out_nPoints: Pointer, out_xValues: Pointer, out_yValues: Pointer): number;
1419
1528
 
1420
1529
  /**
1421
1530
  * assigns a set of data points to a curve.
@@ -1426,7 +1535,7 @@ to hold `nPoints` number of data points and for sizing `id` to hold at least
1426
1535
  * @param yValues an array of new y-values for the curve.
1427
1536
  * @param nPoints the new number of data points for the curve.
1428
1537
  * @returns an error code.
1429
- \b xValues and \b yValues are zero-based arrays that contains \b nPoints elements.
1538
+ `xValues` and `yValues` are zero-based arrays that contains `nPoints` elements.
1430
1539
  Use this function to redefine (and resize) a curve all at once;
1431
1540
  use @ref EN_setcurvevalue to revise a curve's data points one at a time.
1432
1541
  */
@@ -1440,13 +1549,13 @@ use @ref EN_setcurvevalue to revise a curve's data points one at a time.
1440
1549
  * @param linkIndex the index of a link to control (starting from 1).
1441
1550
  * @param setting control setting applied to the link.
1442
1551
  * @param nodeIndex index of the node used to control the link
1443
- (0 for \b EN_TIMER and \b EN_TIMEOFDAY controls).
1552
+ (0 for `EN_TIMER` and `EN_TIMEOFDAY` controls).
1444
1553
  * @param level action level (tank level, junction pressure, or time in seconds)
1445
1554
  that triggers the control.
1446
- * @param index [out] index of the new control.
1555
+ * @param out_index [out] index of the new control.
1447
1556
  * @returns an error code.
1448
1557
  */
1449
- _EN_addcontrol(ph: Pointer, type: number, linkIndex: number, setting: number, nodeIndex: number, level: number, index: Pointer): number;
1558
+ _EN_addcontrol(ph: Pointer, type: number, linkIndex: number, setting: number, nodeIndex: number, level: number, out_index: Pointer): number;
1450
1559
 
1451
1560
  /**
1452
1561
  * Deletes an existing simple control.
@@ -1462,16 +1571,16 @@ that triggers the control.
1462
1571
  *
1463
1572
  * @param ph an EPANET project handle.
1464
1573
  * @param index the control's index (starting from 1).
1465
- * @param type [out] the type of control (see @ref EN_ControlType).
1466
- * @param linkIndex [out] the index of the link being controlled.
1467
- * @param setting [out] the control setting applied to the link.
1468
- * @param nodeIndex [out] the index of the node used to trigger the control
1469
- (0 for \b EN_TIMER and \b EN_TIMEOFDAY controls).
1470
- * @param level [out] the action level (tank level, junction pressure, or time in seconds)
1574
+ * @param out_type [out] the type of control (see @ref EN_ControlType).
1575
+ * @param out_linkIndex [out] the index of the link being controlled.
1576
+ * @param out_setting [out] the control setting applied to the link.
1577
+ * @param out_nodeIndex [out] the index of the node used to trigger the control
1578
+ (0 for `EN_TIMER` and `EN_TIMEOFDAY` controls).
1579
+ * @param out_level [out] the action level (tank level, junction pressure, or time in seconds)
1471
1580
  that triggers the control.
1472
1581
  * @returns an error code.
1473
1582
  */
1474
- _EN_getcontrol(ph: Pointer, index: number, type: Pointer, linkIndex: Pointer, setting: Pointer, nodeIndex: Pointer, level: Pointer): number;
1583
+ _EN_getcontrol(ph: Pointer, index: number, out_type: Pointer, out_linkIndex: Pointer, out_setting: Pointer, out_nodeIndex: Pointer, out_level: Pointer): number;
1475
1584
 
1476
1585
  /**
1477
1586
  * Sets the properties of an existing simple control.
@@ -1482,13 +1591,33 @@ that triggers the control.
1482
1591
  * @param linkIndex the index of the link being controlled.
1483
1592
  * @param setting the control setting applied to the link.
1484
1593
  * @param nodeIndex the index of the node used to trigger the control
1485
- (0 for \b EN_TIMER and \b EN_TIMEOFDAY controls).
1594
+ (0 for `EN_TIMER` and `EN_TIMEOFDAY` controls).
1486
1595
  * @param level the action level (tank level, junction pressure, or time in seconds)
1487
1596
  that triggers the control.
1488
1597
  * @returns an error code.
1489
1598
  */
1490
1599
  _EN_setcontrol(ph: Pointer, index: number, type: number, linkIndex: number, setting: number, nodeIndex: number, level: number): number;
1491
1600
 
1601
+ /**
1602
+ * Gets the enabled status of a simple control.
1603
+ *
1604
+ * @param ph an EPANET project handle.
1605
+ * @param index the control's index (starting from 1).
1606
+ * @param out_enabled `EN_TRUE` (= 1) if the control is enabled or `EN_FALSE` (= 0) if it is disabled.
1607
+ * @returns an error code.
1608
+ */
1609
+ _EN_getcontrolenabled(ph: Pointer, index: number, out_enabled: Pointer): number;
1610
+
1611
+ /**
1612
+ * Sets the enabled status of a simple control.
1613
+ *
1614
+ * @param ph an EPANET project handle.
1615
+ * @param index the control's index (starting from 1).
1616
+ * @param enabled `EN_TRUE` (= 1) sets the control to enabled, `EN_FALSE` (= 0) sets it to disabled.
1617
+ * @returns an error code.
1618
+ */
1619
+ _EN_setcontrolenabled(ph: Pointer, index: number, enabled: number): number;
1620
+
1492
1621
  /**
1493
1622
  * Adds a new rule-based control to a project.
1494
1623
  *
@@ -1514,13 +1643,13 @@ rule's format. Each clause of the rule must end with a newline character <b>`\n`
1514
1643
  *
1515
1644
  * @param ph an EPANET project handle.
1516
1645
  * @param index the rule's index (starting from 1).
1517
- * @param nPremises [out] number of premises in the rule's IF section.
1518
- * @param nThenActions [out] number of actions in the rule's THEN section.
1519
- * @param nElseActions [out] number of actions in the rule's ELSE section.
1520
- * @param priority [out] the rule's priority value.
1646
+ * @param out_nPremises [out] number of premises in the rule's IF section.
1647
+ * @param out_nThenActions [out] number of actions in the rule's THEN section.
1648
+ * @param out_nElseActions [out] number of actions in the rule's ELSE section.
1649
+ * @param out_priority [out] the rule's priority value.
1521
1650
  * @returns an error code.
1522
1651
  */
1523
- _EN_getrule(ph: Pointer, index: number, nPremises: Pointer, nThenActions: Pointer, nElseActions: Pointer, priority: Pointer): number;
1652
+ _EN_getrule(ph: Pointer, index: number, out_nPremises: Pointer, out_nThenActions: Pointer, out_nElseActions: Pointer, out_priority: Pointer): number;
1524
1653
 
1525
1654
  /**
1526
1655
  * Gets the ID name of a rule-based control given its index.
@@ -1528,8 +1657,8 @@ rule's format. Each clause of the rule must end with a newline character <b>`\n`
1528
1657
  * @param ph an EPANET project handle.
1529
1658
  * @param index the rule's index (starting from 1).
1530
1659
  * @param out_id [out] the rule's ID name.
1531
- * @returns Error code.
1532
- The ID name must be sized to hold at least @ref EN_SizeLimits "EN_MAXID" characters.
1660
+ * @returns an error code.
1661
+ The ID name must be sized to hold at least @ref EN_SizeLimits "EN_MAXID+1" characters.
1533
1662
  */
1534
1663
  _EN_getruleID(ph: Pointer, index: number, out_id: Pointer): number;
1535
1664
 
@@ -1540,17 +1669,17 @@ The ID name must be sized to hold at least @ref EN_SizeLimits "EN_MAXID" charact
1540
1669
  * @param ruleIndex the rule's index (starting from 1).
1541
1670
  * @param premiseIndex the position of the premise in the rule's list of premises
1542
1671
  (starting from 1).
1543
- * @param logop [out] the premise's logical operator ( \b IF = 1, \b AND = 2, \b OR = 3 ).
1544
- * @param object [out] the type of object the premise refers to (see @ref EN_RuleObject).
1545
- * @param objIndex [out] the index of the object (e.g. the index of a tank).
1546
- * @param variable [out] the object's variable being compared (see @ref EN_RuleVariable).
1547
- * @param relop [out] the premise's comparison operator (see @ref EN_RuleOperator).
1548
- * @param status [out] the status that the object's status is compared to
1672
+ * @param out_logop [out] the premise's logical operator (`IF` = 1, `AND` = 2, `OR` = 3` ).
1673
+ * @param out_object [out] the type of object the premise refers to (see @ref EN_RuleObject).
1674
+ * @param out_objIndex [out] the index of the object (e.g. the index of a tank).
1675
+ * @param out_variable [out] the object's variable being compared (see @ref EN_RuleVariable).
1676
+ * @param out_relop [out] the premise's comparison operator (see @ref EN_RuleOperator).
1677
+ * @param out_status [out] the status that the object's status is compared to
1549
1678
  (see @ref EN_RuleStatus).
1550
- * @param value [out] the value that the object's variable is compared to.
1679
+ * @param out_value [out] the value that the object's variable is compared to.
1551
1680
  * @returns an error code.
1552
1681
  */
1553
- _EN_getpremise(ph: Pointer, ruleIndex: number, premiseIndex: number, logop: Pointer, object: Pointer, objIndex: Pointer, variable: Pointer, relop: Pointer, status: Pointer, value: Pointer): number;
1682
+ _EN_getpremise(ph: Pointer, ruleIndex: number, premiseIndex: number, out_logop: Pointer, out_object: Pointer, out_objIndex: Pointer, out_variable: Pointer, out_relop: Pointer, out_status: Pointer, out_value: Pointer): number;
1554
1683
 
1555
1684
  /**
1556
1685
  * Sets the properties of a premise in a rule-based control.
@@ -1558,7 +1687,7 @@ The ID name must be sized to hold at least @ref EN_SizeLimits "EN_MAXID" charact
1558
1687
  * @param ph an EPANET project handle.
1559
1688
  * @param ruleIndex the rule's index (starting from 1).
1560
1689
  * @param premiseIndex the position of the premise in the rule's list of premises.
1561
- * @param logop the premise's logical operator ( \b IF = 1, \b AND = 2, \b OR = 3 ).
1690
+ * @param logop the premise's logical operator (`IF` = 1, `AND` = 2, `OR` = 3 ).
1562
1691
  * @param object the type of object the premise refers to (see @ref EN_RuleObject).
1563
1692
  * @param objIndex the index of the object (e.g. the index of a tank).
1564
1693
  * @param variable the object's variable being compared (see @ref EN_RuleVariable).
@@ -1610,12 +1739,12 @@ The ID name must be sized to hold at least @ref EN_SizeLimits "EN_MAXID" charact
1610
1739
  * @param ph an EPANET project handle.
1611
1740
  * @param ruleIndex the rule's index (starting from 1).
1612
1741
  * @param actionIndex the index of the THEN action to retrieve (starting from 1).
1613
- * @param linkIndex [out] the index of the link in the action (starting from 1).
1614
- * @param status [out] the status assigned to the link (see @ref EN_RuleStatus)
1615
- * @param setting [out] the value assigned to the link's setting.
1742
+ * @param out_linkIndex [out] the index of the link in the action (starting from 1).
1743
+ * @param out_status [out] the status assigned to the link (see @ref EN_RuleStatus)
1744
+ * @param out_setting [out] the value assigned to the link's setting.
1616
1745
  * @returns an error code.
1617
1746
  */
1618
- _EN_getthenaction(ph: Pointer, ruleIndex: number, actionIndex: number, linkIndex: Pointer, status: Pointer, setting: Pointer): number;
1747
+ _EN_getthenaction(ph: Pointer, ruleIndex: number, actionIndex: number, out_linkIndex: Pointer, out_status: Pointer, out_setting: Pointer): number;
1619
1748
 
1620
1749
  /**
1621
1750
  * Sets the properties of a THEN action in a rule-based control.
@@ -1636,12 +1765,12 @@ The ID name must be sized to hold at least @ref EN_SizeLimits "EN_MAXID" charact
1636
1765
  * @param ph an EPANET project handle.
1637
1766
  * @param ruleIndex the rule's index (starting from 1).
1638
1767
  * @param actionIndex the index of the ELSE action to retrieve (starting from 1).
1639
- * @param linkIndex [out] the index of the link in the action.
1640
- * @param status [out] the status assigned to the link (see @ref EN_RuleStatus).
1641
- * @param setting [out] the value assigned to the link's setting.
1768
+ * @param out_linkIndex [out] the index of the link in the action.
1769
+ * @param out_status [out] the status assigned to the link (see @ref EN_RuleStatus).
1770
+ * @param out_setting [out] the value assigned to the link's setting.
1642
1771
  * @returns an error code.
1643
1772
  */
1644
- _EN_getelseaction(ph: Pointer, ruleIndex: number, actionIndex: number, linkIndex: Pointer, status: Pointer, setting: Pointer): number;
1773
+ _EN_getelseaction(ph: Pointer, ruleIndex: number, actionIndex: number, out_linkIndex: Pointer, out_status: Pointer, out_setting: Pointer): number;
1645
1774
 
1646
1775
  /**
1647
1776
  * Sets the properties of an ELSE action in a rule-based control.
@@ -1665,6 +1794,26 @@ The ID name must be sized to hold at least @ref EN_SizeLimits "EN_MAXID" charact
1665
1794
  * @returns an error code.
1666
1795
  */
1667
1796
  _EN_setrulepriority(ph: Pointer, index: number, priority: number): number;
1797
+
1798
+ /**
1799
+ * Gets the enabled status of a rule-based control.
1800
+ *
1801
+ * @param ph an EPANET project handle.
1802
+ * @param index the rule's index (starting from 1).
1803
+ * @param out_enabled the rule will be either EN_TRUE=enabled or EN_FALSE=disabled.
1804
+ * @returns an error code.
1805
+ */
1806
+ _EN_getruleenabled(ph: Pointer, index: number, out_enabled: Pointer): number;
1807
+
1808
+ /**
1809
+ * Sets the enabled status of a rule-based control.
1810
+ *
1811
+ * @param ph an EPANET project handle.
1812
+ * @param index the rule's index (starting from 1).
1813
+ * @param enabled set the rule to either EN_TRUE=enabled or EN_FALSE=disabled.
1814
+ * @returns an error code.
1815
+ */
1816
+ _EN_setruleenabled(ph: Pointer, index: number, enabled: number): number;
1668
1817
  }
1669
1818
 
1670
1819
  // Default export factory function matching Emscripten MODULARIZE=1 and EXPORT_ES6=1