[Box Backup-commit] COMMIT r2801 - in box/invisnet/vs2010/0.11/lib: backupclient common server

subversion at boxbackup.org subversion at boxbackup.org
Tue Oct 26 21:08:48 BST 2010


Author: invisnet
Date: 2010-10-26 21:08:47 +0100 (Tue, 26 Oct 2010)
New Revision: 2801

Modified:
   box/invisnet/vs2010/0.11/lib/backupclient/BackupClientCryptoKeys.h
   box/invisnet/vs2010/0.11/lib/backupclient/BackupClientFileAttributes.h
   box/invisnet/vs2010/0.11/lib/backupclient/BackupClientMakeExcludeList.h
   box/invisnet/vs2010/0.11/lib/backupclient/BackupClientRestore.h
   box/invisnet/vs2010/0.11/lib/backupclient/BackupDaemonConfigVerify.h
   box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreDirectory.h
   box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreFile.h
   box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreFileEncodeStream.h
   box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreFilename.h
   box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreFilenameClear.h
   box/invisnet/vs2010/0.11/lib/backupclient/RunStatusProvider.h
   box/invisnet/vs2010/0.11/lib/common/BoxPlatform.h
   box/invisnet/vs2010/0.11/lib/common/makeexception.pl.in
   box/invisnet/vs2010/0.11/lib/server/makeprotocol.pl.in
Log:
Allow lib/backupclient to be compiled into a DLL.

Modified: box/invisnet/vs2010/0.11/lib/backupclient/BackupClientCryptoKeys.h
===================================================================
--- box/invisnet/vs2010/0.11/lib/backupclient/BackupClientCryptoKeys.h	2010-10-23 18:18:15 UTC (rev 2800)
+++ box/invisnet/vs2010/0.11/lib/backupclient/BackupClientCryptoKeys.h	2010-10-26 20:08:47 UTC (rev 2801)
@@ -49,7 +49,7 @@
 #define BACKUPCRYPTOKEYS_FILE_AES_KEY_LENGTH			32
 
 
-void BackupClientCryptoKeys_Setup(const std::string& rKeyMaterialFilename);
+BOX_FUNC(void) BackupClientCryptoKeys_Setup(const std::string& rKeyMaterialFilename);
 
 #endif // BACKUPCLIENTCRYTOKEYS__H
 

Modified: box/invisnet/vs2010/0.11/lib/backupclient/BackupClientFileAttributes.h
===================================================================
--- box/invisnet/vs2010/0.11/lib/backupclient/BackupClientFileAttributes.h	2010-10-23 18:18:15 UTC (rev 2800)
+++ box/invisnet/vs2010/0.11/lib/backupclient/BackupClientFileAttributes.h	2010-10-26 20:08:47 UTC (rev 2801)
@@ -25,7 +25,7 @@
 //		Created: 2003/10/07
 //
 // --------------------------------------------------------------------------
-class BackupClientFileAttributes : public StreamableMemBlock
+BOX_CLASS BackupClientFileAttributes : public StreamableMemBlock
 {
 public:
 	BackupClientFileAttributes();

Modified: box/invisnet/vs2010/0.11/lib/backupclient/BackupClientMakeExcludeList.h
===================================================================
--- box/invisnet/vs2010/0.11/lib/backupclient/BackupClientMakeExcludeList.h	2010-10-23 18:18:15 UTC (rev 2800)
+++ box/invisnet/vs2010/0.11/lib/backupclient/BackupClientMakeExcludeList.h	2010-10-26 20:08:47 UTC (rev 2801)
@@ -13,7 +13,7 @@
 class ExcludeList;
 class Configuration;
 
-ExcludeList *BackupClientMakeExcludeList(const Configuration &rConfig, const char *DefiniteName, const char *RegexName,
+extern BOX_FUNC(ExcludeList *) BackupClientMakeExcludeList(const Configuration &rConfig, const char *DefiniteName, const char *RegexName,
 	const char *AlwaysIncludeDefiniteName = 0, const char *AlwaysIncludeRegexName = 0);
 
 // --------------------------------------------------------------------------

Modified: box/invisnet/vs2010/0.11/lib/backupclient/BackupClientRestore.h
===================================================================
--- box/invisnet/vs2010/0.11/lib/backupclient/BackupClientRestore.h	2010-10-23 18:18:15 UTC (rev 2800)
+++ box/invisnet/vs2010/0.11/lib/backupclient/BackupClientRestore.h	2010-10-26 20:08:47 UTC (rev 2801)
@@ -22,7 +22,7 @@
 	Restore_CompleteWithErrors,
 };
 
-int BackupClientRestore(BackupProtocolClient &rConnection,
+extern BOX_FUNC(int) BackupClientRestore(BackupProtocolClient &rConnection,
 	int64_t DirectoryID,
 	const char *LocalDirectoryName,
 	bool PrintDots = false,

Modified: box/invisnet/vs2010/0.11/lib/backupclient/BackupDaemonConfigVerify.h
===================================================================
--- box/invisnet/vs2010/0.11/lib/backupclient/BackupDaemonConfigVerify.h	2010-10-23 18:18:15 UTC (rev 2800)
+++ box/invisnet/vs2010/0.11/lib/backupclient/BackupDaemonConfigVerify.h	2010-10-26 20:08:47 UTC (rev 2801)
@@ -12,7 +12,7 @@
 
 #include "Configuration.h"
 
-extern const ConfigurationVerify BackupDaemonConfigVerify;
+extern BOX_EXPORT const ConfigurationVerify BackupDaemonConfigVerify;
 
 #endif // BACKUPDAEMONCONFIGVERIFY__H
 

Modified: box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreDirectory.h
===================================================================
--- box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreDirectory.h	2010-10-23 18:18:15 UTC (rev 2800)
+++ box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreDirectory.h	2010-10-26 20:08:47 UTC (rev 2801)
@@ -27,7 +27,7 @@
 //		Created: 2003/08/26
 //
 // --------------------------------------------------------------------------
-class BackupStoreDirectory
+BOX_CLASS BackupStoreDirectory
 {
 public:
 	BackupStoreDirectory();
@@ -38,7 +38,7 @@
 public:
 	~BackupStoreDirectory();
 
-	class Entry
+	BOX_CLASS Entry
 	{
 	public:
 		friend class BackupStoreDirectory;
@@ -158,7 +158,7 @@
 	const StreamableMemBlock &GetAttributes() const {return mAttributes;}
 	box_time_t GetAttributesModTime() const {return mAttributesModTime;}
 
-	class Iterator
+	BOX_CLASS Iterator
 	{
 	public:
 		Iterator(const BackupStoreDirectory &rDir)

Modified: box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreFile.h
===================================================================
--- box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreFile.h	2010-10-23 18:18:15 UTC (rev 2800)
+++ box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreFile.h	2010-10-26 20:08:47 UTC (rev 2801)
@@ -48,7 +48,7 @@
 //		Created: 2006/01/19
 //
 // --------------------------------------------------------------------------
-class DiffTimer
+BOX_CLASS DiffTimer
 {
 public:
 	DiffTimer();
@@ -67,10 +67,10 @@
 //		Created: 2003/08/28
 //
 // --------------------------------------------------------------------------
-class BackupStoreFile
+BOX_CLASS BackupStoreFile
 {
 public:
-	class DecodedStream : public IOStream
+	BOX_CLASS DecodedStream : public IOStream
 	{
 		friend class BackupStoreFile;
 	private:
@@ -182,7 +182,7 @@
 	static void DiffTimerExpired();
 
 	// Building blocks
-	class EncodingBuffer
+	BOX_CLASS EncodingBuffer
 	{
 	public:
 		EncodingBuffer();

Modified: box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreFileEncodeStream.h
===================================================================
--- box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreFileEncodeStream.h	2010-10-23 18:18:15 UTC (rev 2800)
+++ box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreFileEncodeStream.h	2010-10-26 20:08:47 UTC (rev 2801)
@@ -42,7 +42,7 @@
 //		Created: 8/12/03
 //
 // --------------------------------------------------------------------------
-class BackupStoreFileEncodeStream : public IOStream
+BOX_CLASS BackupStoreFileEncodeStream : public IOStream
 {
 public:
 	BackupStoreFileEncodeStream();
@@ -55,7 +55,7 @@
 		BackupStoreFileCreation::BlocksAvailableEntry *mpStartBlock;	// may be null
 	} RecipeInstruction;
 	
-	class Recipe : public std::vector<RecipeInstruction>
+	BOX_CLASS Recipe : public std::vector<RecipeInstruction>
 	{
 		// NOTE: This class is rather tied in with the implementation of diffing.
 	public:

Modified: box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreFilename.h
===================================================================
--- box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreFilename.h	2010-10-23 18:18:15 UTC (rev 2800)
+++ box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreFilename.h	2010-10-26 20:08:47 UTC (rev 2801)
@@ -40,7 +40,7 @@
 //		Created: 2003/08/26
 //
 // --------------------------------------------------------------------------
-class BackupStoreFilename /* : public BackupStoreFilename_base */
+BOX_CLASS BackupStoreFilename /* : public BackupStoreFilename_base */
 {
 private:
 	std::string mEncryptedName;

Modified: box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreFilenameClear.h
===================================================================
--- box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreFilenameClear.h	2010-10-23 18:18:15 UTC (rev 2800)
+++ box/invisnet/vs2010/0.11/lib/backupclient/BackupStoreFilenameClear.h	2010-10-26 20:08:47 UTC (rev 2801)
@@ -22,7 +22,7 @@
 //		Created: 2003/08/26
 //
 // --------------------------------------------------------------------------
-class BackupStoreFilenameClear : public BackupStoreFilename
+BOX_CLASS BackupStoreFilenameClear : public BackupStoreFilename
 {
 public:
 	BackupStoreFilenameClear();

Modified: box/invisnet/vs2010/0.11/lib/backupclient/RunStatusProvider.h
===================================================================
--- box/invisnet/vs2010/0.11/lib/backupclient/RunStatusProvider.h	2010-10-23 18:18:15 UTC (rev 2800)
+++ box/invisnet/vs2010/0.11/lib/backupclient/RunStatusProvider.h	2010-10-26 20:08:47 UTC (rev 2801)
@@ -19,7 +19,7 @@
 //		Created: 2005/11/15
 //
 // --------------------------------------------------------------------------
-class RunStatusProvider
+BOX_CLASS RunStatusProvider
 {
 	public:
 	virtual ~RunStatusProvider() { }

Modified: box/invisnet/vs2010/0.11/lib/common/BoxPlatform.h
===================================================================
--- box/invisnet/vs2010/0.11/lib/common/BoxPlatform.h	2010-10-23 18:18:15 UTC (rev 2800)
+++ box/invisnet/vs2010/0.11/lib/common/BoxPlatform.h	2010-10-26 20:08:47 UTC (rev 2801)
@@ -40,6 +40,21 @@
 	#endif
 #endif
 
+#ifdef BOXBACKUP_EXPORTS
+	#define BOX_CLASS class __declspec(dllexport)
+	#define BOX_EXPORT __declspec(dllexport)
+	#define BOX_FUNC(ret) __declspec(dllexport) ret
+#elif defined BOXBACKUP_IMPORTS
+	#define BOX_CLASS class __declspec(dllimport)
+	#define BOX_EXPORT __declspec(dllimport)
+	#define BOX_FUNC(ret) __declspec(dllexport) ret
+#else
+	#define BOX_CLASS class
+	#define BOX_EXPORT
+	#define BOX_FUNC(ret) ret
+#endif
+
+
 #ifdef HAVE_SYS_TYPES_H
 	#include <sys/types.h>
 #endif
@@ -180,7 +195,7 @@
 #endif
 
 // Solaris has no dirfd(x) macro or function, and we need one for
-// intercept tests. We cannot define macros with arguments directly 
+// intercept tests. We cannot define macros with arguments directly
 // using AC_DEFINE, so do it here instead of in configure.ac.
 
 #if ! defined PLATFORM_CLIB_FNS_INTERCEPTION_IMPOSSIBLE && ! HAVE_DECL_DIRFD

Modified: box/invisnet/vs2010/0.11/lib/common/makeexception.pl.in
===================================================================
--- box/invisnet/vs2010/0.11/lib/common/makeexception.pl.in	2010-10-23 18:18:15 UTC (rev 2800)
+++ box/invisnet/vs2010/0.11/lib/common/makeexception.pl.in	2010-10-26 20:08:47 UTC (rev 2801)
@@ -43,6 +43,8 @@
 
 close EXCEPTION_DESC;
 
+$class_decl = ("DLL" eq $ARGV[1]) ? "BOX_CLASS" : "class";
+
 # write the code
 print "Generating $class exception...\n";
 
@@ -68,7 +70,7 @@
 //		Created: autogen
 //
 // --------------------------------------------------------------------------
-class ${class}Exception : public BoxException
+$class_decl ${class}Exception : public BoxException
 {
 public:
 	${class}Exception(unsigned int SubType,

Modified: box/invisnet/vs2010/0.11/lib/server/makeprotocol.pl.in
===================================================================
--- box/invisnet/vs2010/0.11/lib/server/makeprotocol.pl.in	2010-10-23 18:18:15 UTC (rev 2800)
+++ box/invisnet/vs2010/0.11/lib/server/makeprotocol.pl.in	2010-10-26 20:08:47 UTC (rev 2801)
@@ -32,13 +32,15 @@
 
 
 
-my ($type, $file) = @ARGV;
+my ($type, $file, $decl) = @ARGV;
 
 if($type ne 'Server' && $type ne 'Client')
 {
 	die "Neither Server or Client is specified on command line\n";
 }
 
+my $class_decl = ("DLL" eq $decl) ? "BOX_CLASS" : "class";
+
 open IN, $file or die "Can't open input file $file\n";
 
 print "Making $type protocol classes from $file...\n";
@@ -314,7 +316,7 @@
 for my $cmd (@cmd_list)
 {
 	print H <<__E;
-class $classname_base$cmd : public $derive_objects_from
+$class_decl $classname_base$cmd : public $derive_objects_from
 {
 public:
 	$classname_base$cmd();
@@ -553,7 +555,7 @@
 
 # finally, the protocol object itself
 print H <<__E;
-class $classname_base : public Protocol
+$class_decl $classname_base : public Protocol
 {
 public:
 	$classname_base(IOStream &rStream);




More information about the Boxbackup-commit mailing list