]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Internal branch sync. Included in this change:
authorVMware, Inc <>
Mon, 21 May 2012 22:20:37 +0000 (15:20 -0700)
committerDmitry Torokhov <dtor@vmware.com>
Tue, 22 May 2012 18:00:47 +0000 (11:00 -0700)
. remove VMCF transport from DnD

. changes in shared code that don't affect open-vm-tools
functionality.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
open-vm-tools/lib/include/strutil.h
open-vm-tools/lib/misc/strutil.c
open-vm-tools/services/plugins/dndcp/dndGuest/guestDnDCPMgr.cc
open-vm-tools/services/plugins/dndcp/stringxx/string.hh

index dd41e396ebe80f6941468f5f293e47779a2bff41..5003f45961996f1575a13ec151e71b44c6dbb262 100644 (file)
 #define STRUTIL_H
 
 #include <stdarg.h>
+#include "vm_basic_types.h"
 
-#include "fileIO.h"
-#include "dynbuf.h"
+struct DynBuf;
 
-char * StrUtil_GetNextToken(unsigned int *index, const char *str,
-                            const char *delimiters);
+char *StrUtil_GetNextToken(unsigned int *index, const char *str,
+                           const char *delimiters);
 Bool StrUtil_GetNextIntToken(int32 *out, unsigned int *index, const char *str,
                              const char *delimiters);
 Bool StrUtil_GetNextUintToken(uint32 *out, unsigned int *index, const char *str,
@@ -48,7 +48,7 @@ Bool StrUtil_StrToSizet(size_t *out, const char *str);
 Bool StrUtil_StrToDouble(double *out, const char *str);
 Bool StrUtil_CapacityToSectorType(SectorType *out, const char *str,
                                   unsigned int bytes);
-char * StrUtil_FormatSizeInBytesUnlocalized(uint64 size);
+char *StrUtil_FormatSizeInBytesUnlocalized(uint64 size);
 
 size_t StrUtil_GetLongestLineLength(const char *buf, size_t bufLength);
 
@@ -56,8 +56,8 @@ Bool StrUtil_StartsWith(const char *s, const char *prefix);
 Bool StrUtil_CaselessStartsWith(const char *s, const char *prefix);
 Bool StrUtil_EndsWith(const char *s, const char *suffix);
 
-Bool StrUtil_VDynBufPrintf(DynBuf *b, const char *fmt, va_list args);
-Bool StrUtil_DynBufPrintf(DynBuf *b, const char *fmt, ...);
-void StrUtil_SafeDynBufPrintf(DynBuf *b, const char *fmt, ...);
+Bool StrUtil_VDynBufPrintf(struct DynBuf *b, const char *fmt, va_list args);
+Bool StrUtil_DynBufPrintf(struct DynBuf *b, const char *fmt, ...);
+void StrUtil_SafeDynBufPrintf(struct DynBuf *b, const char *fmt, ...);
 
 #endif /* STRUTIL_H */
index d71ecfb0729626675e608b9d4a955f0bb74d3bf2..6a46969e75d43c5c2cbdae4dce05235ca007436a 100644 (file)
@@ -32,7 +32,7 @@
 #include "vmware.h"
 #include "strutil.h"
 #include "str.h"
-
+#include "dynbuf.h"
 
 
 /*
index 2172b136bbf66426c2e6cf39e5a9fbce4408ef52..137682493b1cbb11cc7dd405cdb25ba57a9d1c98 100644 (file)
  */
 
 #include "guestDnDCPMgr.hh"
-#ifdef DND_USING_VMCF
-#   include "dndCPTransportVMCF.hh"
-#else
-#   include "dndCPTransportGuestRpc.hpp"
-#endif
+#include "dndCPTransportGuestRpc.hpp"
 
 extern "C" {
    #include "debug.h"
@@ -112,9 +108,7 @@ GuestDnDCPMgr::Init(ToolsAppCtx *ctx)
 {
    mToolsAppCtx = ctx;
 
-#if !defined(DND_USING_VMCF)
    ASSERT(mToolsAppCtx);
-#endif
 
    if (mFileTransfer) {
       delete mFileTransfer;
@@ -169,26 +163,7 @@ GuestDnDCPMgr::GetTransport(void)
 {
    if (!mTransport) {
       ASSERT(mToolsAppCtx);
-#ifdef DND_USING_VMCF
-      GKeyFile *confDictRef = NULL;
-      const char *brokerAddr = NULL;
-
-      confDictRef = mToolsAppCtx->config;
-      if (confDictRef) {
-         brokerAddr = g_key_file_get_string(confDictRef,
-                                            "vmcf.broker",
-                                            "addr",
-                                            NULL);
-      }
-      if (!brokerAddr) {
-
-         /* We are executing in the simulator, so hardcode the brokerAddr. */
-         brokerAddr = "tcp:host=127.0.0.1,port=8672,family=ipv4";
-      }
-      mTransport = new DnDCPTransportVMCF(brokerAddr, NULL, false);
-#else
       mTransport = new DnDCPTransportGuestRpc(mToolsAppCtx->rpc);
-#endif
    }
    return mTransport;
 }
index 5e036df4ee72cc5e5a86df34d95337189f117098..81d79915089caca06c437ca84d72564ba63b87bc 100644 (file)
@@ -288,6 +288,13 @@ operator<<(std::ostream& strm, const string& s)
    return strm;
 }
 
+inline std::wostream&
+operator<<(std::wostream& strm, const string& s)
+{
+   strm << s.w_str();
+   return strm;
+}
+
 // ConversionError class for exception
 
 class ConversionError {};