From: VMware, Inc <> Date: Mon, 21 May 2012 22:20:37 +0000 (-0700) Subject: Internal branch sync. Included in this change: X-Git-Tag: 2012.05.21-724730~49 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=445ffc4e65d3fb2179ac2f0077d314f6687b138f;p=thirdparty%2Fopen-vm-tools.git Internal branch sync. Included in this change: . remove VMCF transport from DnD . changes in shared code that don't affect open-vm-tools functionality. Signed-off-by: Dmitry Torokhov --- diff --git a/open-vm-tools/lib/include/strutil.h b/open-vm-tools/lib/include/strutil.h index dd41e396e..5003f4596 100644 --- a/open-vm-tools/lib/include/strutil.h +++ b/open-vm-tools/lib/include/strutil.h @@ -27,12 +27,12 @@ #define STRUTIL_H #include +#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 */ diff --git a/open-vm-tools/lib/misc/strutil.c b/open-vm-tools/lib/misc/strutil.c index d71ecfb07..6a46969e7 100644 --- a/open-vm-tools/lib/misc/strutil.c +++ b/open-vm-tools/lib/misc/strutil.c @@ -32,7 +32,7 @@ #include "vmware.h" #include "strutil.h" #include "str.h" - +#include "dynbuf.h" /* diff --git a/open-vm-tools/services/plugins/dndcp/dndGuest/guestDnDCPMgr.cc b/open-vm-tools/services/plugins/dndcp/dndGuest/guestDnDCPMgr.cc index 2172b136b..137682493 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuest/guestDnDCPMgr.cc +++ b/open-vm-tools/services/plugins/dndcp/dndGuest/guestDnDCPMgr.cc @@ -23,11 +23,7 @@ */ #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; } diff --git a/open-vm-tools/services/plugins/dndcp/stringxx/string.hh b/open-vm-tools/services/plugins/dndcp/stringxx/string.hh index 5e036df4e..81d799150 100644 --- a/open-vm-tools/services/plugins/dndcp/stringxx/string.hh +++ b/open-vm-tools/services/plugins/dndcp/stringxx/string.hh @@ -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 {};