As ZMap uses GTK and GLib and runs the GTK main loop it is implemented as a series of callbacks each given relevant data structures as arguments. These callbacks are set up when various windows are created and some of them assign other callbacks to respond to external events.
The hierarchy is summarised in the following table: