[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b

aCaB acab at clamav.net
Sun Apr 4 01:07:42 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit b3722aeb52a8d998712ceaccc49a6063486a996e
Author: aCaB <acab at clamav.net>
Date:   Mon Oct 12 23:36:13 2009 +0200

    win32 ltdl interface

diff --git a/libclamav/jsparse/js-norm.c b/libclamav/jsparse/js-norm.c
index 15b3f80..159648d 100644
--- a/libclamav/jsparse/js-norm.c
+++ b/libclamav/jsparse/js-norm.c
@@ -35,7 +35,7 @@
 #include <assert.h>
 
 #include "cltypes.h"
-#include "lexglobal.h"
+#include "jsparse/lexglobal.h"
 #include "hashtab.h"
 #include "others.h"
 #include "str.h"
diff --git a/win32/.gitignore b/win32/.gitignore
index 0678867..bb09bba 100644
--- a/win32/.gitignore
+++ b/win32/.gitignore
@@ -4,3 +4,5 @@ build
 *.ncb
 *.suo
 *.user
+Debug/*
+Release/*
diff --git a/win32/clamav-config.h b/win32/clamav-config.h
index e6ffc00..70862cd 100644
--- a/win32/clamav-config.h
+++ b/win32/clamav-config.h
@@ -424,10 +424,10 @@
 #define LT_DLSEARCH_PATH "/lib:/usr/lib:/usr/local/lib:/usr/lib/atlas:/usr/local/lib:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu"
 
 /* The archive extension */
-#define LT_LIBEXT "a"
+#define LT_LIBEXT "dll"
 
 /* Define to the extension used for runtime loadable modules, say, ".so". */
-#define LT_MODULE_EXT ".so"
+#define LT_MODULE_EXT ".dll"
 
 /* Define to the name of the environment variable that determines the run-time
    module search path. */
diff --git a/win32/compat/dirent.h b/win32/compat/dirent.h
index 5fb4fcc..b7ed1bf 100644
--- a/win32/compat/dirent.h
+++ b/win32/compat/dirent.h
@@ -25,9 +25,8 @@
 #include "clamav-config.h"
 #endif
 
-//#define _DIRENT_HAVE_D_TYPE
-
-typedef unsigned long ino_t;
+#define _DIRENT_HAVE_D_TYPE
+typedef unsigned short ino_t; /* WTF?!? */
 
 typedef struct {
 	HANDLE dh;
diff --git a/win32/compat/ltdl.c b/win32/compat/ltdl.c
new file mode 100644
index 0000000..f5a642e
--- /dev/null
+++ b/win32/compat/ltdl.c
@@ -0,0 +1,59 @@
+/*
+ *  Copyright (C) 2009 Sourcefire, Inc.
+ *
+ *  Authors: aCaB <acab at clamav.net>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *  MA 02110-1301, USA.
+ */
+
+#include "ltdl.h"
+
+static DWORD lasterr = 0;
+const lt_dlinfo dlinfo = {"libclamunrar_iface", "unrar", 1, 0, 0, 0 };
+
+int lt_dlinit(void) {
+	return 0;
+}
+
+lt_dlhandle lt_dlopen(const char *filename) {
+	lt_dlhandle h = LoadLibrary(filename);
+	if(!h) lasterr = GetLastError();
+	return h;
+}
+
+void *lt_dlsym(lt_dlhandle handle, const char *name) {
+	void *f = GetProcAddress(handle, name);
+	if(!f) lasterr = GetLastError();
+	return f;
+}
+
+const char *lt_dlerror(void) {
+	char *err = "NO ERROR";
+	if(lasterr)
+		FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, lasterr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&err, 0, NULL);
+	return err;
+}
+
+int lt_dladdsearchdir(const char *search_dir) {
+	return 0;
+}
+
+const char *lt_dlgetsearchpath(void) {
+	return NULL;
+}
+
+const lt_dlinfo *lt_dlgetinfo(lt_dlhandle handle) {
+	return &dlinfo;
+}
\ No newline at end of file
diff --git a/win32/compat/ltdl.h b/win32/compat/ltdl.h
new file mode 100644
index 0000000..9024422
--- /dev/null
+++ b/win32/compat/ltdl.h
@@ -0,0 +1,51 @@
+/*
+ *  Copyright (C) 2009 Sourcefire, Inc.
+ *
+ *  Authors: aCaB <acab at clamav.net>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *  MA 02110-1301, USA.
+ */
+
+#ifndef __LTDL_H
+#define __LTDL_H
+
+#if HAVE_CONFIG_H
+#include "clamav-config.h"
+#endif
+
+typedef HANDLE lt_dlhandle;
+
+int lt_dlinit(void);
+lt_dlhandle lt_dlopen(const char *filename);
+void *lt_dlsym(lt_dlhandle handle, const char *name);
+const char *lt_dlerror(void);
+int lt_dlclose (lt_dlhandle handle);
+int lt_dladdsearchdir(const char *search_dir);
+const char *lt_dlgetsearchpath(void);
+
+typedef	struct {
+  char *	filename;	/* file name */
+  char *	name;		/* module name */
+  int		ref_count;	/* number of times lt_dlopened minus
+				   number of times lt_dlclosed. */
+  unsigned int	is_resident:1;	/* module can't be unloaded. */
+  unsigned int	is_symglobal:1;	/* module symbols can satisfy
+				   subsequently loaded modules.  */
+  unsigned int	is_symlocal:1;	/* module symbols are only available
+				   locally. */
+} lt_dlinfo;
+const lt_dlinfo *lt_dlgetinfo(lt_dlhandle handle);
+
+#endif /* __LTDL_H */
\ No newline at end of file
diff --git a/win32/libclamav.vcproj b/win32/libclamav.vcproj
index d254013..f87afd1 100644
--- a/win32/libclamav.vcproj
+++ b/win32/libclamav.vcproj
@@ -41,7 +41,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)..\libclamav&quot;;&quot;$(SolutionDir)\compat&quot;;&quot;$(SolutionDir)\3rdparty\zlib&quot;;&quot;$(SolutionDir)\3rdparty\pthreads&quot;;&quot;$(SolutionDir)\3rdparty\bzip2&quot;;&quot;$(SolutionDir)..\libltdl&quot;;&quot;$(SolutionDir)..&quot;"
+				AdditionalIncludeDirectories="&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)..\libclamav&quot;;&quot;$(SolutionDir)\compat&quot;;&quot;$(SolutionDir)\3rdparty\zlib&quot;;&quot;$(SolutionDir)\3rdparty\pthreads&quot;;&quot;$(SolutionDir)\3rdparty\bzip2&quot;;&quot;$(SolutionDir)..&quot;"
 				PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
@@ -63,7 +63,9 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
+				AdditionalDependencies="ws2_32.lib"
 				LinkIncremental="2"
+				IgnoreAllDefaultLibraries="false"
 				GenerateDebugInformation="true"
 				SubSystem="2"
 				TargetMachine="1"
@@ -117,7 +119,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
-				AdditionalIncludeDirectories="&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)..\libclamav&quot;;&quot;$(SolutionDir)\compat&quot;;&quot;$(SolutionDir)\3rdparty\zlib&quot;;&quot;$(SolutionDir)\3rdparty\pthreads&quot;;&quot;$(SolutionDir)\3rdparty\bzip2&quot;;&quot;$(SolutionDir)..\libltdl&quot;;&quot;$(SolutionDir)..&quot;"
+				AdditionalIncludeDirectories="&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)..\libclamav&quot;;&quot;$(SolutionDir)\compat&quot;;&quot;$(SolutionDir)\3rdparty\zlib&quot;;&quot;$(SolutionDir)\3rdparty\pthreads&quot;;&quot;$(SolutionDir)\3rdparty\bzip2&quot;;&quot;$(SolutionDir)..&quot;"
 				PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H"
 				RuntimeLibrary="2"
 				EnableFunctionLevelLinking="true"
@@ -138,7 +140,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
+				UseLibraryDependencyInputs="true"
+				AdditionalDependencies="ws2_32.lib"
 				LinkIncremental="1"
+				IgnoreAllDefaultLibraries="false"
 				GenerateDebugInformation="true"
 				SubSystem="2"
 				OptimizeReferences="2"
@@ -269,6 +274,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\libclamav\nsis\bzlib.c"
+				>
+			</File>
+			<File
 				RelativePath="..\libclamav\cab.c"
 				>
 			</File>
@@ -337,6 +346,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\libclamav\nsis\infblock.c"
+				>
+			</File>
+			<File
 				RelativePath="..\libclamav\inflate64.c"
 				>
 			</File>
@@ -349,10 +362,18 @@
 				>
 			</File>
 			<File
+				RelativePath="..\libclamav\jsparse\js-norm.c"
+				>
+			</File>
+			<File
 				RelativePath="..\libclamav\line.c"
 				>
 			</File>
 			<File
+				RelativePath=".\compat\ltdl.c"
+				>
+			</File>
+			<File
 				RelativePath="..\libclamav\lzma_iface.c"
 				>
 			</File>
@@ -409,6 +430,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\libclamav\nsis\nulsft.c"
+				>
+			</File>
+			<File
 				RelativePath="..\libclamav\ole2_extract.c"
 				>
 			</File>
@@ -449,6 +474,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\3rdparty\pthreads\pthread.c"
+				>
+			</File>
+			<File
 				RelativePath="..\libclamav\readdb.c"
 				>
 			</File>
@@ -457,6 +486,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\libclamav\regex\regcomp.c"
+				>
+			</File>
+			<File
+				RelativePath="..\libclamav\regex\regerror.c"
+				>
+			</File>
+			<File
 				RelativePath="..\libclamav\regex_list.c"
 				>
 			</File>
@@ -465,6 +502,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\libclamav\regex\regexec.c"
+				>
+			</File>
+			<File
+				RelativePath="..\libclamav\regex\regfree.c"
+				>
+			</File>
+			<File
 				RelativePath="..\libclamav\rtf.c"
 				>
 			</File>
@@ -493,6 +538,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\libclamav\regex\strlcpy.c"
+				>
+			</File>
+			<File
 				RelativePath="..\libclamav\table.c"
 				>
 			</File>
@@ -566,434 +615,6 @@
 			Filter="h;hpp;hxx;hm;inl;inc;xsd"
 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
 			>
-			<File
-				RelativePath="..\libclamav\7z.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\7z\7zBuf.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\7z\7zCrc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\7z\Archive\7z\7zDecode.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\7z\Archive\7z\7zExtract.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\7z\7zFile.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\7z\Archive\7z\7zHeader.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\7z\Archive\7z\7zIn.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\7z\Archive\7z\7zItem.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\aspack.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\autoit.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\7z\Bcj2.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\bignum.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\bignum_class.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\binhex.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\blob.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\7z\Bra.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\bytecode.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\bytecode_api.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\bytecode_priv.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\cab.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\chmunpack.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\clamav.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\clambc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\cltypes.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\cpio.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\7z\CpuArch.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\cvd.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\dconf.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\default.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\disasm.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\disasmpriv.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\dlp.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\dsig.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\elf.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\encoding_aliases.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\entconv.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\entitylist.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\execs.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\explode.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\filetypes.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\filetypes_int.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\fmap.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\fsg.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\hashtab.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\htmlnorm.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\iana_cctld.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\iana_tld.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\inffixed64.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\inflate64.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\inflate64_priv.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\is_tar.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\ishield.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\line.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\lzma_iface.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\7z\LzmaDec.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\macho.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\matcher-ac.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\matcher-bm.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\matcher.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\mbox.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\md5.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\message.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\mew.h"
-				>
-			</File>
-			<File
-				RelativePath="..\shared\misc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\mpool.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\msexpand.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\mspack.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\ole2_extract.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\others.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\packlibs.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\pdf.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\pe.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\petite.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\phish_domaincheck_db.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\phish_whitelist.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\phishcheck.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\readdb.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\rebuildpe.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\regex_list.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\regex_suffix.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\rtf.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\scanners.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\sha256.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\sis.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\special.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\spin.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\str.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\table.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\text.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\textdet.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\textnorm.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\tnef.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\type_desc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\7z\Types.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\unarj.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\uniq.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\unsp.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\untar.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\unzip.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\upack.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\upx.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\uuencode.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\vba_extract.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\version.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\wwunpack.h"
-				>
-			</File>
-			<File
-				RelativePath="..\libclamav\yc.h"
-				>
-			</File>
 		</Filter>
 		<Filter
 			Name="Resource Files"
diff --git a/win32/platform.h b/win32/platform.h
index 5cd1326..9628d13 100644
--- a/win32/platform.h
+++ b/win32/platform.h
@@ -11,6 +11,8 @@
 typedef int ssize_t;
 #define strcasecmp lstrcmpi
 #define strncasecmp strnicmp
+#define mkdir(path, mode) mkdir(path)
+#define lstat stat
 
 /* FIXME: this one is b0rked */
 #define snprintf _snprintf
@@ -20,14 +22,15 @@ typedef int ssize_t;
 #define S_IRUSR S_IREAD
 #define S_IWUSR S_IWRITE
 #define S_IRWXU (S_IRUSR|S_IWUSR)
-#define mkdir(path, mode) mkdir(path)
-#define lstat stat
+#define S_ISDIR(mode) ((_S_IFDIR & mode)!=0)
+#define S_ISREG(mode) ((_S_IFREG & mode)!=0)
+#define S_ISLNK(mode) (0)
 #define F_OK 0
 #define W_OK 2
 #define R_OK 4
 #define X_OK R_OK
 
-#define SEARCH_LIBDIR "."
+#define SEARCH_LIBDIR ""
 
 #ifndef MIN
 #define MIN(a, b)	(((a) < (b)) ? (a) : (b))

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list