]> xenbits.xensource.com Git - xenclient/toolstack.git/commitdiff
slightly prettify codegen
authorPrashanth Mundkur <prashanth.mundkur@citrix.com>
Fri, 15 May 2009 19:25:23 +0000 (12:25 -0700)
committerPrashanth Mundkur <prashanth.mundkur@citrix.com>
Fri, 15 May 2009 19:25:23 +0000 (12:25 -0700)
gen/rpc/codegen.ml

index 07f0d79b61b2e992f6e42ba451f88a36a2747bea..e8de181927c7eee63e448fc57955e3bf01b5f95a 100644 (file)
@@ -73,13 +73,17 @@ module Server = struct
                let sig_name = (String.lowercase server.server_name) ^ "_impl" in
                fprintf ff "type %s =@\n" sig_name;
                fprintf ff "@[<v 8>{@,";
-               fprintf ff "(* RPCs *)";
+               if List.length rpc_list > 0 then
+                       fprintf ff "(* RPCs *)";
                List.iter (fun (rpc, resp) ->
                                let sg = get_arg_types rpc.rpc_request.request_params in
                                let sg = sg @ [ resp.response_value.param_type ] in
                                fprintf ff "@,%s: %s;" rpc.rpc_request.request_handler (String.concat " -> " sg)
                          ) rpc_list;
-               fprintf ff "@,@,(* Notifications *)";
+               if List.length notif_list > 0 then
+                       (if List.length rpc_list > 0
+                        then fprintf ff "@,@,(* Notifications *)"
+                        else fprintf ff "(* Notifications *)");
                List.iter (fun n ->
                                let sg = get_arg_types n.rpc_request.request_params in
                                let sg = sg @ [ "unit" ] in