Split out marshall code into a new file
[invirt/third/libt4.git] / rsm_client.h
index 814616f..4a80f60 100644 (file)
@@ -1,11 +1,8 @@
 #ifndef rsm_client_h
 #define rsm_client_h
 
 #ifndef rsm_client_h
 #define rsm_client_h
 
-#include "rpc/rpc.h"
+#include "types.h"
 #include "rsm_protocol.h"
 #include "rsm_protocol.h"
-#include <string>
-#include <vector>
-
 
 //
 // rsm client interface.
 
 //
 // rsm client interface.
@@ -43,19 +40,19 @@ int rsm_client::call_m(unsigned int proc, R & r, const marshall & req) {
     if (intret < 0) return intret;
     u >> res;
     if (!u.okdone()) {
     if (intret < 0) return intret;
     u >> res;
     if (!u.okdone()) {
-        fprintf(stderr, "rsm_client::call_m: failed to unmarshall the reply.\n"
-                "You probably forgot to set the reply string in "
-                "rsm::client_invoke, or you may call RPC 0x%x with wrong return "
-                "type\n", proc);
+        cerr << "rsm_client::call_m: failed to unmarshall the reply." << endl;
+        cerr << "You probably forgot to set the reply string in "
+                "rsm::client_invoke, or you may have called RPC 0x" << hex <<
+                proc << " with the wrong return type" << endl;
         VERIFY(0);
         return rpc_const::unmarshal_reply_failure;
     }
     unmarshall u1(res);
     u1 >> r;
     if(!u1.okdone()) {
         VERIFY(0);
         return rpc_const::unmarshal_reply_failure;
     }
     unmarshall u1(res);
     u1 >> r;
     if(!u1.okdone()) {
-        fprintf(stderr, "rsm_client::call_m: failed to unmarshall the reply.\n"
-                "You are probably calling RPC 0x%x with wrong return "
-                "type.\n", proc);
+        cerr << "rsm_client::call_m: failed to unmarshall the reply." << endl;
+        cerr << "You are probably calling RPC 0x" << hex << proc <<
+                " with the wrong return type." << endl;
         VERIFY(0);
         return rpc_const::unmarshal_reply_failure;
     }
         VERIFY(0);
         return rpc_const::unmarshal_reply_failure;
     }