How tnerson/c-wildwater works
C-Wildwater summarizes water-distribution data through two user-facing modes: histogram reports for plant volumes and leak analysis for a selected plant. The documented shell script provides the command interface and launches the C program. In histogram mode, the program reads data into a plant index and generates ranked reports; in leak mode, it parses records, builds a distribution tree and computes losses. Source excerpts support these runtime relationships; the shell-to-program handoff and command capabilities are documented in the README.
Main entry points: main.c C entry point · c-wildwater.sh Shell launcher · usine_arbre.c Leak AVL index · histo.c Read histogram data
Components 13
Command interface
- Shell launcher
c-wildwater.sh - C entry point
codeC/src/main.c
Volume reports
- Read histogram data
codeC/src/histo.c - Rank volume values
codeC/src/histo.c - Histogram reports
codeC/src/histo.c
Leak analysis
- Parse leak records
codeC/src/usine_arbre.c - Distribution tree
codeC/src/usine_arbre.c - Calculate losses
codeC/src/usine_arbre.c - Leak result
codeC/src/usine_arbre.c
In-memory indexes
- Plant AVL index
codeC/src/avl.c - Leak AVL index
codeC/src/usine_arbre.c
Other components
- User
- Input data
Connections 14
- User → Shell launcher: runs command
README.md - Input data → Shell launcher: provides input
README.md - Shell launcher → C entry point: launches
README.md - C entry point → Read histogram data: calls
codeC/src/main.c - Read histogram data → Plant AVL index: inserts and searches
codeC/src/histo.c - C entry point → Rank volume values: calls report mode
codeC/src/main.c - Rank volume values → Histogram reports: writes ranked reports
codeC/src/histo.c - C entry point → Parse leak records: parses input lines
codeC/src/main.c - C entry point → Leak AVL index: adds parsed records
codeC/src/main.c - Parse leak records → Distribution tree: constructs nodes
codeC/src/usine_arbre.c - Distribution tree → Leak AVL index: indexes nodes
codeC/src/usine_arbre.c - C entry point → Calculate losses: requests loss total
codeC/src/main.c - Calculate losses → Leak AVL index: searches plant tree
codeC/src/usine_arbre.c - C entry point → Leak result: prints and saves result
codeC/src/main.c