Use protected names in prototypes in header files
Do not explicitely free ressources on failure

...let the OS do the housekeeping instead. This is the first part of the "one
step forward, to steps backward" campaign.
Let the tool_* functions fail on their own

This is the second and final part of the "one step forward, two steps back"
campaign.
Get rid of an unnecessary carriage return
Use regular expression to validate requests
Use correct output streams instead of stdout
Add some asserts
Rename a parameter
Implement TextFile Transactions for Type 1 items