webApiGen generates a cgiMain function to be called by the cgic library. The idea is to provide a collection of functions for an AJAX (or AJA JSON) environment, although it can be used to emit straight html. The program takes a specification of an api and generates cgiMain() along with some helper functions.
Manual at http://www.njames.co.uk/reference/webApiGen.html
Great software, thank you.