(bind-func fleet_print_units
(lambda (host:i8* port:i32)
(let ((units (fleet_get_units host port)))
(if (not (null? units))
(begin
(println "Fleet units:\n")
(doloop (i (json_array_size units))
(let ((unit (json_array_get units i)))
(printf "[%lld]\n" i)
(fleet_print_unit unit)))
(json_decref units))
(println "Fleet: no units found.")))))