]> xenbits.xensource.com Git - xenclient/toolstack.git/commitdiff
Added a is_jsonrpc_value utility.
authorPrashanth Mundkur <prashanth.mundkur@citrix.com>
Thu, 4 Jun 2009 18:43:52 +0000 (11:43 -0700)
committerPrashanth Mundkur <prashanth.mundkur@citrix.com>
Tue, 23 Jun 2009 16:25:24 +0000 (09:25 -0700)
libs/jsonrpc/jsonrpc.ml
libs/jsonrpc/jsonrpc.mli

index ca6ca11ff2b91046c54ef9763ceac41f921c82f7..405bd9ce3353aa0f80001bfe08bff6abfc996d18 100644 (file)
@@ -168,3 +168,6 @@ let rpc_type_of_json j =
                Response (response_of_json j)
        with _ ->
                Non_JSONRPC
+
+let is_jsonrpc_value j =
+       rpc_type_of_json j <> Non_JSONRPC
index 46ef33279d332f2b9ef2d2f43bef313112b98d54..e60337b7ebcc7a8e443e381c082c9a001503c294 100644 (file)
@@ -77,3 +77,4 @@ type rpc_type =
        | Response of rpc_response
 
 val rpc_type_of_json: Json.t -> rpc_type
+val is_jsonrpc_value: Json.t -> bool