How cloakersan69-sys/engg1410_mp2_partsinventory works
This is a command-line parts inventory tool. A user supplies an inventory file and a command; main.c validates arguments, loads the inventory, dispatches listing, searching, low-stock, value, or restock work, and frees the in-memory data. Restocking updates the matched part and saves the inventory file. The implementation is small: inventory.c provides both file persistence and inventory operations, with inventory.h defining their shared data structures and interface. The README gives no further capability details; the graph follows the sampled source.
Main entry points: main.c Command Dispatcher · inventory.h Inventory Data Model · inventory.c Inventory Listing
Components 11
Command Line
- Command Dispatcher
main.c
Inventory Operations
- Inventory Data Model
inventory.h - Inventory Listing
inventory.c - Part Search
inventory.c - Low-Stock Report
inventory.c - Inventory Valuation
inventory.c - Quantity Restock
inventory.c
File Persistence
- Inventory Loader
inventory.c - Inventory Saver
inventory.c - Inventory File
Other components
- CLI User
Connections 19
- CLI User → Command Dispatcher: runs command
main.c - Command Dispatcher → Inventory Loader: loads file
main.c - Inventory Loader → Inventory File: reads records
inventory.c - Command Dispatcher → Inventory Listing: lists parts
main.c - Command Dispatcher → Part Search: finds part
main.c - Command Dispatcher → Low-Stock Report: reports low stock
main.c - Command Dispatcher → Inventory Valuation: calculates value
main.c - Command Dispatcher → Quantity Restock: updates quantity
main.c - Command Dispatcher → Inventory Saver: saves inventory
main.c - Inventory Saver → Inventory File: writes records
inventory.c - Inventory Listing → Inventory Data Model: reads inventory
inventory.c - Part Search → Inventory Data Model: searches parts
inventory.c - Low-Stock Report → Inventory Data Model: checks quantities
inventory.c - Inventory Valuation → Inventory Data Model: sums part values
inventory.c - Quantity Restock → Inventory Data Model: updates part
inventory.c - Inventory Loader → Inventory Data Model: populates inventory
inventory.c - Inventory Saver → Inventory Data Model: reads inventory
inventory.c - Inventory Listing → Inventory Listing: prints each part
inventory.c - Low-Stock Report → Inventory Listing: prints matching parts
inventory.c