diff -N -r -u -X .ignore gnugo-copy/engine/board.c gnugo/engine/board.c
--- gnugo-copy/engine/board.c	2007-01-22 22:24:34.968750000 +0100
+++ gnugo/engine/board.c	2007-01-22 21:53:46.062500000 +0100
@@ -346,12 +346,12 @@
   Hash_data position_hash;
 };
 
-inline static int do_approxlib(int pos, int color, int maxlib, int *libs,
-							   struct board_cache_entry *entry);
-inline static int slow_approxlib(int pos, int color, int maxlib, int *libs,
-								 struct board_cache_entry *entry);
-inline static int do_accuratelib(int pos, int color, int maxlib, int *libs,
-								 struct board_cache_entry *entry);
+static int do_approxlib(int pos, int color, int maxlib, int *libs,
+			struct board_cache_entry *entry);
+static int slow_approxlib(int pos, int color, int maxlib, int *libs,
+			  struct board_cache_entry *entry);
+static int do_accuratelib(int pos, int color, int maxlib, int *libs,
+			  struct board_cache_entry *entry);
 
 static int is_superko_violation(int pos, int color, enum ko_rules type);
 
@@ -673,7 +673,7 @@
  * trykomaster_move does it for us.
  */
 
-inline static int
+static int
 check_komaster_move(int pos, int color, int *ko_move_allowed)
 {
   *ko_move_allowed = 0;
@@ -2102,7 +2102,7 @@
 
 
 /* Does the real work of approxlib(). */
-inline static int
+static int
 do_approxlib(int pos, int color, int maxlib, int *libs,
              struct board_cache_entry *entry)
 {
@@ -2255,7 +2255,7 @@
  * strings. This is a fallback used by approxlib() when a faster
  * algorithm can't be used.
  */
-inline static int
+static int
 slow_approxlib(int pos, int color, int maxlib, int *libs,
                struct board_cache_entry *entry)
 {
@@ -2410,7 +2410,7 @@
 
 
 /* Does the real work of accuratelib(). */
-inline static int
+static int
 do_accuratelib(int pos, int color, int maxlib, int *libs,
                struct board_cache_entry *entry)
 {
diff -N -r -u -X .ignore gnugo-copy/engine/board.vcproj gnugo/engine/board.vcproj
--- gnugo-copy/engine/board.vcproj	1970-01-01 01:00:00.000000000 +0100
+++ gnugo/engine/board.vcproj	2007-01-08 23:41:24.234375000 +0100
@@ -0,0 +1,347 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8,00"
+	Name="board"
+	ProjectGUID="{83657331-949C-4295-9D8F-D3C061F2A810}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="2"
+				InlineFunctionExpansion="0"
+				FavorSizeOrSpeed="1"
+				WholeProgramOptimization="true"
+				AdditionalIncludeDirectories=".,..,..\sgf,..\interface,..\patterns,..\utils"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;HAVE_CONFIG_H"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\Release/board.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName="Release/board"
+				BrowseInformation="0"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\Release\board.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Release/board.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="0"
+				AdditionalIncludeDirectories=".,..,..\sgf,..\interface,..\patterns,..\utils"
+				PreprocessorDefinitions="WIN32;_DEBUG;HAVE_CONFIG_H;_LIB"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/board.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName="Debug/board"
+				BrowseInformation="1"
+				WarningLevel="4"
+				DebugInformationFormat="4"
+				DisableSpecificWarnings="4127;4131;4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\Debug\board.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Debug/board.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="board.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="board.h"
+				>
+			</File>
+			<File
+				RelativePath="boardlib.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="cache.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="globals.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="hash.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						ObjectFile="Debug/"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="printutils.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="sgffile.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff -N -r -u -X .ignore gnugo-copy/engine/cache.c gnugo/engine/cache.c
--- gnugo-copy/engine/cache.c	2006-12-30 21:00:07.140625000 +0100
+++ gnugo/engine/cache.c	2007-01-22 21:55:51.375000000 +0100
@@ -2,7 +2,7 @@
  * This is GNU Go, a Go program. Contact gnugo@gnu.org, or see       *
  * http://www.gnu.org/software/gnugo/ for more information.          *
  *                                                                   *
- * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 and 2006       *
+ * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 and 2007 *
  * by the Free Software Foundation.                                  *
  *                                                                   *
  * This program is free software; you can redistribute it and/or     *
@@ -42,7 +42,7 @@
 static void tt_clear(Transposition_table *table);
 
 /* The transposition table itself. */
-Transposition_table ttable;
+Transposition_table ttable = {0, NULL};
 
 
 /* Arrays with random numbers for Zobrist hashing of input data (other
diff -N -r -u -X .ignore gnugo-copy/engine/engine.vcproj gnugo/engine/engine.vcproj
--- gnugo-copy/engine/engine.vcproj	1970-01-01 01:00:00.000000000 +0100
+++ gnugo/engine/engine.vcproj	2007-01-11 03:01:25.906250000 +0100
@@ -0,0 +1,1015 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8,00"
+	Name="engine"
+	ProjectGUID="{E9E39EA7-415A-42A2-BC62-4CF2478504FD}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="0"
+				AdditionalIncludeDirectories=".,..,..\sgf,..\interface,..\patterns,..\utils"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;HAVE_CONFIG_H"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/engine.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName="Debug/engine"
+				BrowseInformation="1"
+				WarningLevel="4"
+				DebugInformationFormat="4"
+				DisableSpecificWarnings="4127;4131;4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\Debug\engine.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Debug/engine.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="2"
+				InlineFunctionExpansion="0"
+				FavorSizeOrSpeed="1"
+				WholeProgramOptimization="true"
+				AdditionalIncludeDirectories=".,..,..\sgf,..\interface,..\patterns,..\utils"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;HAVE_CONFIG_H"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\Release/engine.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName="Release/engine"
+				BrowseInformation="0"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\Release\engine.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Release/engine.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="aftermath.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="board.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="boardlib.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="breakin.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="cache.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="clock.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="combination.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="dragon.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="endgame.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="filllib.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="fuseki.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="genmove.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="globals.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="handicap.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="hash.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="influence.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="interface.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="matchpat.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="move_reasons.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="movelist.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="optics.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="owl.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="persistent.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="printutils.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="readconnect.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="reading.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="semeai.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="sgfdecide.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="sgffile.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="shapes.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="showbord.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="surround.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="unconditional.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="utils.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="value_moves.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="worm.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			>
+			<File
+				RelativePath="board.h"
+				>
+			</File>
+			<File
+				RelativePath="cache.h"
+				>
+			</File>
+			<File
+				RelativePath="clock.h"
+				>
+			</File>
+			<File
+				RelativePath="gnugo.h"
+				>
+			</File>
+			<File
+				RelativePath="hash.h"
+				>
+			</File>
+			<File
+				RelativePath="influence.h"
+				>
+			</File>
+			<File
+				RelativePath="liberty.h"
+				>
+			</File>
+			<File
+				RelativePath="move_reasons.h"
+				>
+			</File>
+			<File
+				RelativePath=".\readconnect.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff -N -r -u -X .ignore gnugo-copy/engine/liberty.h gnugo/engine/liberty.h
--- gnugo-copy/engine/liberty.h	2007-01-22 22:28:26.625000000 +0100
+++ gnugo/engine/liberty.h	2007-01-22 21:58:43.859375000 +0100
@@ -222,6 +222,7 @@
 
 /* persistent.c */
 void persistent_cache_init(void);
+void persistent_cache_free(void);
 void purge_persistent_caches(void);
 void clear_persistent_caches(void);
 
@@ -436,6 +437,8 @@
 int owl_strong_dragon(int pos);
 void owl_reasons(int color);
 
+void free_owl_stack(void);
+
 void unconditional_life(int unconditional_territory[BOARDMAX], int color);
 void find_superstring(int str, int *num_stones, int *stones);
 void find_superstring_conservative(int str, int *num_stones, int *stones);
diff -N -r -u -X .ignore gnugo-copy/engine/owl.c gnugo/engine/owl.c
--- gnugo-copy/engine/owl.c	2007-01-09 16:46:48.281250000 +0100
+++ gnugo/engine/owl.c	2007-01-22 22:01:07.640625000 +0100
@@ -2,7 +2,7 @@
  * This is GNU Go, a Go program. Contact gnugo@gnu.org, or see       *
  * http://www.gnu.org/software/gnugo/ for more information.          *
  *                                                                   *
- * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 and 2006       *
+ * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 and 2007 *
  * by the Free Software Foundation.                                  *
  *                                                                   *
  * This program is free software; you can redistribute it and/or     *
@@ -6810,6 +6810,17 @@
   }
 }
 
+/* Frees owl stack memory. */
+void
+free_owl_stack(void)
+{
+  int i;
+  for (i = 0; i < owl_stack_size; i++)
+    free(owl_stack[i]);
+
+  owl_stack_size = 0;
+}
+
 /* Push owl data one step upwards in the stack. Gets called from
  * push_owl.
  */
diff -N -r -u -X .ignore gnugo-copy/engine/persistent.c gnugo/engine/persistent.c
--- gnugo-copy/engine/persistent.c	2007-01-22 22:30:00.796875000 +0100
+++ gnugo/engine/persistent.c	2007-01-22 22:03:49.671875000 +0100
@@ -560,6 +560,13 @@
   gg_assert(cache->table);
 }
 
+/* Frees the actual cache table. */
+static void
+free_cache(struct persistent_cache *cache)
+{
+  free(cache->table);
+}
+
 /* Initializes all persistent caches.
  * Needs to be called only once at startup.
  */
@@ -574,6 +581,18 @@
 }
 
 
+/* Clears memory of persistent caches. */
+void
+persistent_cache_free()
+{
+  free_cache(&reading_cache);
+  free_cache(&breakin_cache);
+  free_cache(&connection_cache);
+  free_cache(&owl_cache);
+  free_cache(&semeai_cache);
+}
+
+
 /* Discards all persistent cache entries. */
 void
 clear_persistent_caches()
diff -N -r -u -X .ignore gnugo-copy/gnugo.dsw gnugo/gnugo.dsw
--- gnugo-copy/gnugo.dsw	2006-05-18 23:19:21.000000000 +0200
+++ gnugo/gnugo.dsw	1970-01-01 01:00:00.000000000 +0100
@@ -1,275 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "board"=.\engine\board.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name utils
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "dfa"=.\patterns\dfa.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "engine"=.\engine\engine.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name sgf
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "fuseki"=.\patterns\fuseki.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name sgf
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name sgfgen
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name engine
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name patterns
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name dfa
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "gnugo"=.\interface\gnugo.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name board
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name engine
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name joseki
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name mkeyes
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name mkpat
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name sgf
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name sgfgen
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name utils
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name fuseki
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name patterns
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name dfa
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "joseki"=.\patterns\joseki.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name sgf
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name board
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name utils
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "mkeyes"=.\patterns\mkeyes.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name utils
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "mkpat"=.\patterns\mkpat.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name utils
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name dfa
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "patterns"=.\patterns\patterns.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name joseki
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name mkeyes
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name mkpat
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name uncompress_fuseki
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "sgf"=.\sgf\sgf.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name sgfgen
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name utils
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "sgfgen"=.\sgf\sgfgen.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name utils
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "uncompress_fuseki"=.\patterns\uncompress_fuseki.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-    Begin Project Dependency
-    Project_Dep_Name utils
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name board
-    End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name sgf
-    End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "utils"=.\utils\utils.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff -N -r -u -X .ignore gnugo-copy/gnugo.sln gnugo/gnugo.sln
--- gnugo-copy/gnugo.sln	1970-01-01 01:00:00.000000000 +0100
+++ gnugo/gnugo.sln	2007-01-08 23:16:26.218750000 +0100
@@ -0,0 +1,149 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "board", "engine\board.vcproj", "{83657331-949C-4295-9D8F-D3C061F2A810}"
+	ProjectSection(ProjectDependencies) = postProject
+		{BA3CFE17-E7E9-4379-8F9F-F31C23819954} = {BA3CFE17-E7E9-4379-8F9F-F31C23819954}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dfa", "patterns\dfa.vcproj", "{D0EB45DD-512C-4D2E-A695-6E4BFBD68266}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "engine", "engine\engine.vcproj", "{E9E39EA7-415A-42A2-BC62-4CF2478504FD}"
+	ProjectSection(ProjectDependencies) = postProject
+		{8AE7A4D8-56C9-4E28-AFDF-29D202A7E61A} = {8AE7A4D8-56C9-4E28-AFDF-29D202A7E61A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fuseki", "patterns\fuseki.vcproj", "{BCCACB0E-1F1F-43D0-95A2-4BF407E6E0BC}"
+	ProjectSection(ProjectDependencies) = postProject
+		{8AE7A4D8-56C9-4E28-AFDF-29D202A7E61A} = {8AE7A4D8-56C9-4E28-AFDF-29D202A7E61A}
+		{851E4267-D513-4A9B-A6BE-42C93798D442} = {851E4267-D513-4A9B-A6BE-42C93798D442}
+		{E9E39EA7-415A-42A2-BC62-4CF2478504FD} = {E9E39EA7-415A-42A2-BC62-4CF2478504FD}
+		{E080B13B-3A8B-42AF-9137-DFABD6F28EA9} = {E080B13B-3A8B-42AF-9137-DFABD6F28EA9}
+		{D0EB45DD-512C-4D2E-A695-6E4BFBD68266} = {D0EB45DD-512C-4D2E-A695-6E4BFBD68266}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gnugo", "interface\gnugo.vcproj", "{CF8993F3-DA2F-4333-A18C-20F0C8CD5458}"
+	ProjectSection(ProjectDependencies) = postProject
+		{83657331-949C-4295-9D8F-D3C061F2A810} = {83657331-949C-4295-9D8F-D3C061F2A810}
+		{E9E39EA7-415A-42A2-BC62-4CF2478504FD} = {E9E39EA7-415A-42A2-BC62-4CF2478504FD}
+		{F99BF078-88AE-46CD-BE62-D632D7F7945B} = {F99BF078-88AE-46CD-BE62-D632D7F7945B}
+		{C49A0E28-3304-4E6D-A730-97968706D939} = {C49A0E28-3304-4E6D-A730-97968706D939}
+		{0CF62660-27DE-472F-82AC-6870F06860F2} = {0CF62660-27DE-472F-82AC-6870F06860F2}
+		{8AE7A4D8-56C9-4E28-AFDF-29D202A7E61A} = {8AE7A4D8-56C9-4E28-AFDF-29D202A7E61A}
+		{851E4267-D513-4A9B-A6BE-42C93798D442} = {851E4267-D513-4A9B-A6BE-42C93798D442}
+		{BA3CFE17-E7E9-4379-8F9F-F31C23819954} = {BA3CFE17-E7E9-4379-8F9F-F31C23819954}
+		{BCCACB0E-1F1F-43D0-95A2-4BF407E6E0BC} = {BCCACB0E-1F1F-43D0-95A2-4BF407E6E0BC}
+		{E080B13B-3A8B-42AF-9137-DFABD6F28EA9} = {E080B13B-3A8B-42AF-9137-DFABD6F28EA9}
+		{D0EB45DD-512C-4D2E-A695-6E4BFBD68266} = {D0EB45DD-512C-4D2E-A695-6E4BFBD68266}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "joseki", "patterns\joseki.vcproj", "{F99BF078-88AE-46CD-BE62-D632D7F7945B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{8AE7A4D8-56C9-4E28-AFDF-29D202A7E61A} = {8AE7A4D8-56C9-4E28-AFDF-29D202A7E61A}
+		{83657331-949C-4295-9D8F-D3C061F2A810} = {83657331-949C-4295-9D8F-D3C061F2A810}
+		{BA3CFE17-E7E9-4379-8F9F-F31C23819954} = {BA3CFE17-E7E9-4379-8F9F-F31C23819954}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mkeyes", "patterns\mkeyes.vcproj", "{C49A0E28-3304-4E6D-A730-97968706D939}"
+	ProjectSection(ProjectDependencies) = postProject
+		{BA3CFE17-E7E9-4379-8F9F-F31C23819954} = {BA3CFE17-E7E9-4379-8F9F-F31C23819954}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mkpat", "patterns\mkpat.vcproj", "{0CF62660-27DE-472F-82AC-6870F06860F2}"
+	ProjectSection(ProjectDependencies) = postProject
+		{BA3CFE17-E7E9-4379-8F9F-F31C23819954} = {BA3CFE17-E7E9-4379-8F9F-F31C23819954}
+		{D0EB45DD-512C-4D2E-A695-6E4BFBD68266} = {D0EB45DD-512C-4D2E-A695-6E4BFBD68266}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "patterns", "patterns\patterns.vcproj", "{E080B13B-3A8B-42AF-9137-DFABD6F28EA9}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F99BF078-88AE-46CD-BE62-D632D7F7945B} = {F99BF078-88AE-46CD-BE62-D632D7F7945B}
+		{C49A0E28-3304-4E6D-A730-97968706D939} = {C49A0E28-3304-4E6D-A730-97968706D939}
+		{0CF62660-27DE-472F-82AC-6870F06860F2} = {0CF62660-27DE-472F-82AC-6870F06860F2}
+		{FBC89A7B-86A0-49BE-B44B-23D9FAA46CB0} = {FBC89A7B-86A0-49BE-B44B-23D9FAA46CB0}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sgf", "sgf\sgf.vcproj", "{8AE7A4D8-56C9-4E28-AFDF-29D202A7E61A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{851E4267-D513-4A9B-A6BE-42C93798D442} = {851E4267-D513-4A9B-A6BE-42C93798D442}
+		{BA3CFE17-E7E9-4379-8F9F-F31C23819954} = {BA3CFE17-E7E9-4379-8F9F-F31C23819954}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sgfgen", "sgf\sgfgen.vcproj", "{851E4267-D513-4A9B-A6BE-42C93798D442}"
+	ProjectSection(ProjectDependencies) = postProject
+		{BA3CFE17-E7E9-4379-8F9F-F31C23819954} = {BA3CFE17-E7E9-4379-8F9F-F31C23819954}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uncompress_fuseki", "patterns\uncompress_fuseki.vcproj", "{FBC89A7B-86A0-49BE-B44B-23D9FAA46CB0}"
+	ProjectSection(ProjectDependencies) = postProject
+		{E9E39EA7-415A-42A2-BC62-4CF2478504FD} = {E9E39EA7-415A-42A2-BC62-4CF2478504FD}
+		{BA3CFE17-E7E9-4379-8F9F-F31C23819954} = {BA3CFE17-E7E9-4379-8F9F-F31C23819954}
+		{83657331-949C-4295-9D8F-D3C061F2A810} = {83657331-949C-4295-9D8F-D3C061F2A810}
+		{8AE7A4D8-56C9-4E28-AFDF-29D202A7E61A} = {8AE7A4D8-56C9-4E28-AFDF-29D202A7E61A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "utils", "utils\utils.vcproj", "{BA3CFE17-E7E9-4379-8F9F-F31C23819954}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{83657331-949C-4295-9D8F-D3C061F2A810}.Debug|Win32.ActiveCfg = Debug|Win32
+		{83657331-949C-4295-9D8F-D3C061F2A810}.Debug|Win32.Build.0 = Debug|Win32
+		{83657331-949C-4295-9D8F-D3C061F2A810}.Release|Win32.ActiveCfg = Release|Win32
+		{83657331-949C-4295-9D8F-D3C061F2A810}.Release|Win32.Build.0 = Release|Win32
+		{D0EB45DD-512C-4D2E-A695-6E4BFBD68266}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D0EB45DD-512C-4D2E-A695-6E4BFBD68266}.Debug|Win32.Build.0 = Debug|Win32
+		{D0EB45DD-512C-4D2E-A695-6E4BFBD68266}.Release|Win32.ActiveCfg = Release|Win32
+		{D0EB45DD-512C-4D2E-A695-6E4BFBD68266}.Release|Win32.Build.0 = Release|Win32
+		{E9E39EA7-415A-42A2-BC62-4CF2478504FD}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E9E39EA7-415A-42A2-BC62-4CF2478504FD}.Debug|Win32.Build.0 = Debug|Win32
+		{E9E39EA7-415A-42A2-BC62-4CF2478504FD}.Release|Win32.ActiveCfg = Release|Win32
+		{E9E39EA7-415A-42A2-BC62-4CF2478504FD}.Release|Win32.Build.0 = Release|Win32
+		{BCCACB0E-1F1F-43D0-95A2-4BF407E6E0BC}.Debug|Win32.ActiveCfg = Debug|Win32
+		{BCCACB0E-1F1F-43D0-95A2-4BF407E6E0BC}.Debug|Win32.Build.0 = Debug|Win32
+		{BCCACB0E-1F1F-43D0-95A2-4BF407E6E0BC}.Release|Win32.ActiveCfg = Release|Win32
+		{BCCACB0E-1F1F-43D0-95A2-4BF407E6E0BC}.Release|Win32.Build.0 = Release|Win32
+		{CF8993F3-DA2F-4333-A18C-20F0C8CD5458}.Debug|Win32.ActiveCfg = Debug|Win32
+		{CF8993F3-DA2F-4333-A18C-20F0C8CD5458}.Debug|Win32.Build.0 = Debug|Win32
+		{CF8993F3-DA2F-4333-A18C-20F0C8CD5458}.Release|Win32.ActiveCfg = Release|Win32
+		{CF8993F3-DA2F-4333-A18C-20F0C8CD5458}.Release|Win32.Build.0 = Release|Win32
+		{F99BF078-88AE-46CD-BE62-D632D7F7945B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F99BF078-88AE-46CD-BE62-D632D7F7945B}.Debug|Win32.Build.0 = Debug|Win32
+		{F99BF078-88AE-46CD-BE62-D632D7F7945B}.Release|Win32.ActiveCfg = Release|Win32
+		{F99BF078-88AE-46CD-BE62-D632D7F7945B}.Release|Win32.Build.0 = Release|Win32
+		{C49A0E28-3304-4E6D-A730-97968706D939}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C49A0E28-3304-4E6D-A730-97968706D939}.Debug|Win32.Build.0 = Debug|Win32
+		{C49A0E28-3304-4E6D-A730-97968706D939}.Release|Win32.ActiveCfg = Release|Win32
+		{C49A0E28-3304-4E6D-A730-97968706D939}.Release|Win32.Build.0 = Release|Win32
+		{0CF62660-27DE-472F-82AC-6870F06860F2}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0CF62660-27DE-472F-82AC-6870F06860F2}.Debug|Win32.Build.0 = Debug|Win32
+		{0CF62660-27DE-472F-82AC-6870F06860F2}.Release|Win32.ActiveCfg = Release|Win32
+		{0CF62660-27DE-472F-82AC-6870F06860F2}.Release|Win32.Build.0 = Release|Win32
+		{E080B13B-3A8B-42AF-9137-DFABD6F28EA9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E080B13B-3A8B-42AF-9137-DFABD6F28EA9}.Debug|Win32.Build.0 = Debug|Win32
+		{E080B13B-3A8B-42AF-9137-DFABD6F28EA9}.Release|Win32.ActiveCfg = Release|Win32
+		{E080B13B-3A8B-42AF-9137-DFABD6F28EA9}.Release|Win32.Build.0 = Release|Win32
+		{8AE7A4D8-56C9-4E28-AFDF-29D202A7E61A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8AE7A4D8-56C9-4E28-AFDF-29D202A7E61A}.Debug|Win32.Build.0 = Debug|Win32
+		{8AE7A4D8-56C9-4E28-AFDF-29D202A7E61A}.Release|Win32.ActiveCfg = Release|Win32
+		{8AE7A4D8-56C9-4E28-AFDF-29D202A7E61A}.Release|Win32.Build.0 = Release|Win32
+		{851E4267-D513-4A9B-A6BE-42C93798D442}.Debug|Win32.ActiveCfg = Debug|Win32
+		{851E4267-D513-4A9B-A6BE-42C93798D442}.Debug|Win32.Build.0 = Debug|Win32
+		{851E4267-D513-4A9B-A6BE-42C93798D442}.Release|Win32.ActiveCfg = Release|Win32
+		{851E4267-D513-4A9B-A6BE-42C93798D442}.Release|Win32.Build.0 = Release|Win32
+		{FBC89A7B-86A0-49BE-B44B-23D9FAA46CB0}.Debug|Win32.ActiveCfg = Debug|Win32
+		{FBC89A7B-86A0-49BE-B44B-23D9FAA46CB0}.Debug|Win32.Build.0 = Debug|Win32
+		{FBC89A7B-86A0-49BE-B44B-23D9FAA46CB0}.Release|Win32.ActiveCfg = Release|Win32
+		{FBC89A7B-86A0-49BE-B44B-23D9FAA46CB0}.Release|Win32.Build.0 = Release|Win32
+		{BA3CFE17-E7E9-4379-8F9F-F31C23819954}.Debug|Win32.ActiveCfg = Debug|Win32
+		{BA3CFE17-E7E9-4379-8F9F-F31C23819954}.Debug|Win32.Build.0 = Debug|Win32
+		{BA3CFE17-E7E9-4379-8F9F-F31C23819954}.Release|Win32.ActiveCfg = Release|Win32
+		{BA3CFE17-E7E9-4379-8F9F-F31C23819954}.Release|Win32.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff -N -r -u -X .ignore gnugo-copy/interface/gnugo.vcproj gnugo/interface/gnugo.vcproj
--- gnugo-copy/interface/gnugo.vcproj	1970-01-01 01:00:00.000000000 +0100
+++ gnugo/interface/gnugo.vcproj	2007-01-18 19:29:17.593750000 +0100
@@ -0,0 +1,412 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8,00"
+	Name="gnugo"
+	ProjectGUID="{CF8993F3-DA2F-4333-A18C-20F0C8CD5458}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/gnugo.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="0"
+				AdditionalIncludeDirectories=".,..,..\sgf,..\patterns,..\utils,../engine"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/gnugo.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName="Debug/gnugo"
+				BrowseInformation="1"
+				WarningLevel="4"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4127;4131;4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\patterns\Debug\patterns.lib ..\utils\Debug\utils.lib ..\sgf\Debug\sgf.lib ..\engine\Debug\engine.lib wsock32.lib ..\patterns\Debug\dfa.lib"
+				OutputFile="gnugo.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/gnugo.pdb"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Debug/gnugo.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/gnugo.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="2"
+				InlineFunctionExpansion="0"
+				FavorSizeOrSpeed="1"
+				WholeProgramOptimization="true"
+				AdditionalIncludeDirectories=".,..,..\sgf,..\patterns,..\utils,../engine"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\Release/gnugo.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName="Release/gnugo"
+				BrowseInformation="0"
+				BrowseInformationFile="Release/gnugo/"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\sgf\Release\sgf.lib ..\engine\Release\engine.lib ..\patterns\Release\patterns.lib ..\utils\Release\utils.lib wsock32.lib ..\patterns\Release\dfa.lib"
+				OutputFile="gnugo.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Release/gnugo.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="gmp.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						DisableSpecificWarnings="4996"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						DisableSpecificWarnings="4996"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="gtp.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						BrowseInformation="1"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="main.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						DisableSpecificWarnings="4996"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						DisableSpecificWarnings="4996"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="play_ascii.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="play_gmp.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="play_gtp.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="play_solo.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="play_test.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath=".\interface.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff -N -r -u -X .ignore gnugo-copy/interface/interface.h gnugo/interface/interface.h
--- gnugo-copy/interface/interface.h	2006-01-23 19:15:50.000000000 +0100
+++ gnugo/interface/interface.h	2007-01-22 22:07:43.203125000 +0100
@@ -2,7 +2,7 @@
  * This is GNU Go, a Go program. Contact gnugo@gnu.org, or see       *
  * http://www.gnu.org/software/gnugo/ for more information.          *
  *                                                                   *
- * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 and 2006       *
+ * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 and 2007 *
  * by the Free Software Foundation.                                  *
  *                                                                   *
  * This program is free software; you can redistribute it and/or     *
@@ -35,7 +35,7 @@
 		char *filename, char *until);
 void play_gtp(FILE *gtp_input, FILE *gtp_output, FILE *gtp_dump_commands,
 	      int gtp_initial_orientation);
-void play_gmp(Gameinfo *gameinfo, int simplified);
+int play_gmp(Gameinfo *gameinfo, int simplified);
 void play_solo(Gameinfo *gameinfo, int benchmark);
 void play_replay(SGFTree *tree, int color_to_test);
 
diff -N -r -u -X .ignore gnugo-copy/interface/main.c gnugo/interface/main.c
--- gnugo-copy/interface/main.c	2006-11-12 17:27:40.000000000 +0100
+++ gnugo/interface/main.c	2007-01-09 18:40:40.203125000 +0100
@@ -2,7 +2,7 @@
  * This is GNU Go, a Go program. Contact gnugo@gnu.org, or see       *
  * http://www.gnu.org/software/gnugo/ for more information.          *
  *                                                                   *
- * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 and 2006       *
+ * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 and 2007 *
  * by the Free Software Foundation.                                  *
  *                                                                   *
  * This program is free software; you can redistribute it and/or     *
@@ -27,6 +27,10 @@
 #include <string.h>
 #include <ctype.h>
 
+#ifdef HAVE_VISUAL_C
+#include <crtdbg.h>
+#endif
+
 #ifdef HAVE_UNISTD_H
 /* For isatty(). */
 #include <unistd.h>
@@ -46,6 +50,7 @@
 #endif
 
 #include "liberty.h"
+#include "cache.h"
 
 #include "gg-getopt.h"
 #include "gg_utils.h"
@@ -61,9 +66,9 @@
 static void show_debug_help(void);
 static void show_debug_flags(void);
 
-static void socket_connect_to(const char *host_name, unsigned int port,
+static int socket_connect_to(const char *host_name, unsigned int port,
 			      FILE **input_file, FILE **output_file);
-static void socket_listen_at(const char *host_name, unsigned int port,
+static int socket_listen_at(const char *host_name, unsigned int port,
 			     FILE **input_file, FILE **output_file);
 static void socket_close_connection(FILE *input_file, FILE *output_file);
 static void socket_stop_listening(FILE *input_file, FILE *output_file);
@@ -304,11 +309,10 @@
 };
 
 
-int
-main(int argc, char *argv[])
+static int
+do_main(int argc, char *argv[], SGFTree *sgftree)
 {
   Gameinfo gameinfo;
-  SGFTree sgftree;
 
   int i;
   int mandated_color = EMPTY;
@@ -344,7 +348,7 @@
   int seed = 0;
   int seed_specified = 0;
 
-  sgftree_clear(&sgftree);
+  sgftree_clear(sgftree);
   gameinfo_clear(&gameinfo);
   
   /* Weed through all of the command line options. */
@@ -451,7 +455,7 @@
 	if (gtp_tcp_ip_mode != 0 || gtpfile != NULL) {
 	  fprintf(stderr, ("Options `--gtp-input', `--gtp-connect' and `--gtp-listen' "
 			   "are mutually-exclusive\n"));
-	  exit(EXIT_FAILURE);
+	  return EXIT_FAILURE;
 	}
 
 	if (i == OPT_GTP_INPUT)
@@ -472,7 +476,7 @@
 	if (orientation < 0 || orientation > 7) {
 	  fprintf(stderr, "Invalid orientation: %d.\n", orientation);
 	  fprintf(stderr, "Try `gnugo --help' for more information.\n");
-	  exit(EXIT_FAILURE);
+	  return EXIT_FAILURE;
 	}
 	break;
 	
@@ -545,7 +549,7 @@
 	  if (requested_handicap < 0 || requested_handicap > MAX_HANDICAP) {
 	    fprintf(stderr, "Unsupported handicap: %d.\n", requested_handicap);
 	    fprintf(stderr, "Try `gnugo --help' for more information.\n");
-	    exit(EXIT_FAILURE);
+	    return EXIT_FAILURE;
 	  }
 	  gameinfo.handicap = requested_handicap;
 	}
@@ -562,7 +566,7 @@
 	    else
 	      fprintf(stderr, "Max size is %d.\n", MAX_BOARD);
 	    fprintf(stderr, "Try `gnugo --help' for more information.\n");
-	    exit(EXIT_FAILURE);
+	    return EXIT_FAILURE;
 	  }
 	  gnugo_clear_board(boardsize);
 	  break;
@@ -572,7 +576,7 @@
 	if (sscanf(gg_optarg, "%f", &komi) != 1) {
 	  fprintf(stderr, "Invalid komi selection: %s\n", gg_optarg);
 	  fprintf(stderr, "Try `gnugo --help' for more information.\n");
-	  exit(EXIT_FAILURE);
+	  return EXIT_FAILURE;
 	}
 	break;
 	
@@ -689,14 +693,14 @@
 	  fprintf(stderr, "Invalid mode selection: %s\n", gg_optarg);
 	  fprintf(stderr, "Try `gnugo --help' for more information.\n");
 	  
-	  exit(EXIT_FAILURE);
+	  return EXIT_FAILURE;
 	}
 	break;
 	
       case OPT_DECIDE_STRING:
 	if (strlen(gg_optarg) > 3) {
 	  fprintf(stderr, "Invalid board coordinate: %s\n", gg_optarg);
-	  exit(EXIT_FAILURE);
+	  return EXIT_FAILURE;
 	}
 	strcpy(decide_this, gg_optarg);
 	playmode = MODE_DECIDE_STRING;
@@ -723,7 +727,7 @@
       case OPT_DECIDE_OWL:
 	if (strlen(gg_optarg) > 3) {
 	  fprintf(stderr, "Invalid board coordinate: %s\n", gg_optarg);
-	  exit(EXIT_FAILURE);
+	  return EXIT_FAILURE;
 	}
 	strcpy(decide_this, gg_optarg);
 	playmode = MODE_DECIDE_OWL;
@@ -732,7 +736,7 @@
       case OPT_DECIDE_DRAGON_DATA:
 	if (strlen(gg_optarg) > 3) {
 	  fprintf(stderr, "Invalid board coordinate: %s\n", gg_optarg);
-	  exit(EXIT_FAILURE);
+	  return EXIT_FAILURE;
 	}
 	strcpy(decide_this, gg_optarg);
 	playmode = MODE_DECIDE_DRAGON_DATA;
@@ -780,7 +784,7 @@
       case OPT_DECIDE_EYE:
 	if (strlen(gg_optarg) > 3) {
 	  fprintf(stderr, "Invalid board coordinate: %s\n", gg_optarg);
-	  exit(EXIT_FAILURE);
+	  return EXIT_FAILURE;
 	}
 	strcpy(decide_this, gg_optarg);
 	playmode = MODE_DECIDE_EYE;
@@ -793,7 +797,7 @@
       case OPT_DECIDE_SURROUNDED:
 	if (strlen(gg_optarg) > 3) {
 	  fprintf(stderr, "Invalid board coordinate: %s\n", gg_optarg);
-	  exit(EXIT_FAILURE);
+	  return EXIT_FAILURE;
 	}
 	strcpy(decide_this, gg_optarg);
 	playmode = MODE_DECIDE_SURROUNDED;
@@ -889,7 +893,7 @@
       case OPT_DEBUG_INFLUENCE:
 	if (strlen(gg_optarg) > 3) {
 	  fprintf(stderr, "Invalid board coordinate: %s\n", gg_optarg);
-	  exit(EXIT_FAILURE);
+	  return EXIT_FAILURE;
 	}
 	strcpy(debuginfluence_move, gg_optarg);
         break;
@@ -905,7 +909,7 @@
 	else {
 	  fprintf(stderr, "Invalid replay color: %s\n", gg_optarg);
 	  fprintf(stderr, "Try `gnugo --help' for more information.\n");
-	  exit(EXIT_FAILURE);
+	  return EXIT_FAILURE;
 	}
 	break;
 	
@@ -933,7 +937,7 @@
 	else {
 	  fprintf(stderr, "Invalid color selection: %s\n", gg_optarg);
 	  fprintf(stderr, "Try `gnugo --help' for more information.\n");
-	  exit(EXIT_FAILURE);
+	  return EXIT_FAILURE;
 	}
 	break;
 	
@@ -1001,7 +1005,7 @@
       case '?':
       default:
 	fprintf(stderr, "Try `gnugo --help' for more information.\n");
-	exit(EXIT_FAILURE);
+	return EXIT_FAILURE;
       }
     }
 
@@ -1014,25 +1018,25 @@
 
   /* Read the infile if there is one. Also play up the position. */
   if (infilename) {
-    if (!sgftree_readfile(&sgftree, infilename)) {
+    if (!sgftree_readfile(sgftree, infilename)) {
       fprintf(stderr, "Cannot open or parse '%s'\n", infilename);
-      exit(EXIT_FAILURE);
+      return EXIT_FAILURE;
     }
     
-    if (gameinfo_play_sgftree_rot(&gameinfo, &sgftree, untilstring,
+    if (gameinfo_play_sgftree_rot(&gameinfo, sgftree, untilstring,
 				  orientation) == EMPTY) {
       fprintf(stderr, "Cannot load '%s'\n", infilename);
-      exit(EXIT_FAILURE);
+      return EXIT_FAILURE;
     }
   }
   else
   /* Initialize and empty sgf tree if there was no infile. */
-    sgftreeCreateHeaderNode(&sgftree, board_size, komi, handicap);
+    sgftreeCreateHeaderNode(sgftree, board_size, komi, handicap);
 
   /* Set the game_record to be identical to the loaded one or the
    * newly created empty sgf tree.
    */
-  gameinfo.game_record = sgftree;
+  gameinfo.game_record = *sgftree;
   
   /* Notice that we need to know the board size before we can do this.
    */
@@ -1053,7 +1057,7 @@
     output_check = fopen(outfile, "w");
     if (!output_check) {
       fprintf(stderr, "Error: could not open '%s' for writing\n", outfile);
-      exit(EXIT_FAILURE);
+      return EXIT_FAILURE;
     }
     fclose(output_check);
   }
@@ -1072,7 +1076,8 @@
 
     /* EMPTY is valid for play_gmp.c. */
     gameinfo.computer_player = mandated_color;
-    play_gmp(&gameinfo, playmode == MODE_SGMP);
+    if (play_gmp(&gameinfo, playmode == MODE_SGMP) != 0)
+      return EXIT_FAILURE;
 
 #if ORACLE
     if (metamachine)
@@ -1088,9 +1093,9 @@
   case MODE_REPLAY:    
     if (!infilename) {
       fprintf(stderr, "You must use -l infile with replay mode.\n");
-      exit(EXIT_FAILURE);
+      return EXIT_FAILURE;
     }
-    play_replay(&sgftree, replay_color);
+    play_replay(sgftree, replay_color);
     break;
     
   case MODE_LOAD_AND_ANALYZE:
@@ -1099,7 +1104,7 @@
     
     if (!infilename) {
       fprintf(stderr, "You must use -l infile with load and analyze mode.\n");
-      exit(EXIT_FAILURE);
+      return EXIT_FAILURE;
     }
 
 #if ORACLE
@@ -1123,15 +1128,15 @@
 
     if (!infilename) {
       fprintf(stderr, "gnugo: --score must be used with -l\n");
-      exit(EXIT_FAILURE);
+      return EXIT_FAILURE;
     }
-    load_and_score_sgf_file(&sgftree, &gameinfo, scoringmode);
+    load_and_score_sgf_file(sgftree, &gameinfo, scoringmode);
     break;
     
   case MODE_LOAD_AND_PRINT:
     if (!infilename) {
       fprintf(stderr, "gnugo: --printsgf must be used with -l\n");
-      exit(EXIT_FAILURE);
+      return EXIT_FAILURE;
     }
 
     else {
@@ -1347,7 +1352,7 @@
       
       if (!infilename) {
 	fprintf(stderr, "You must use -l infile with load and analyze mode.\n");
-	exit(EXIT_FAILURE);
+	return EXIT_FAILURE;
       }
 
       decide_oracle(&gameinfo, infilename, untilstring);
@@ -1384,16 +1389,18 @@
 
 	if (port > 65535) {
 	  fprintf(stderr, "A valid TCP/IP port number expected\n");
-	  exit(EXIT_FAILURE);
+	  return EXIT_FAILURE;
 	}
 
 	if (gtp_tcp_ip_mode == OPT_GTP_CONNECT) {
-	  socket_connect_to(host_name, port,
-			    &gtp_input_FILE, &gtp_output_FILE);
+	  if (socket_connect_to(host_name, port,
+				&gtp_input_FILE, &gtp_output_FILE) != 0)
+	    return EXIT_FAILURE;
 	}
 	else {
-	  socket_listen_at(host_name, port,
-			   &gtp_input_FILE, &gtp_output_FILE);
+	  if (socket_listen_at(host_name, port,
+			       &gtp_input_FILE, &gtp_output_FILE) != 0)
+            return EXIT_FAILURE;
 	}
       }
 
@@ -1438,17 +1445,38 @@
     }
 #endif
 
-    play_ascii(&sgftree, &gameinfo, infilename, untilstring);
+    play_ascii(sgftree, &gameinfo, infilename, untilstring);
     break;
   }
   
   if (profile_patterns)
     report_pattern_profiling();
 
+  return 0;
+}  /* end do_main */
+
+int
+main(int argc, char *argv[])
+{
+  int ret;
+  SGFTree sgftree;
+
+#ifdef HAVE_VISUAL_C
+  /* Checks for memory leaks. */
+  _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
+#endif
+  
+  ret = do_main(argc, argv, &sgftree);
+
   sgfFreeNode(sgftree.root); 
+  free_owl_stack();
+  persistent_cache_free();
+  tt_free(&ttable);
+  if (dragon2 != NULL)
+    free(dragon2);
 
-  return 0;
-}  /* end main */
+  return ret;
+}
 
 
 
@@ -1719,7 +1747,7 @@
 #include <winsocket.h>
 
 
-static void
+static int
 init_sockets(void)
 {
   WSADATA data;
@@ -1727,15 +1755,16 @@
 
   if (WSAStartup(version, &data) != NO_ERROR) {
     fprintf(stderr, "WSAStartup() failed with error %d\n", WSAGetLastError());
-    exit(EXIT_FAILURE);
+    return EXIT_FAILURE;
   }
+  return 0;
 }
 
 
 #endif	/* on Windows */
 
 
-static void
+static int
 socket_connect_to(const char *host_name, unsigned int port,
 		  FILE **input_file, FILE **output_file)
 {
@@ -1744,7 +1773,8 @@
   struct hostent *host_data;
   char **address_pointer;
 
-  init_sockets();
+  if (init_sockets() != 0)
+    return EXIT_FAILURE;
 
   if (!host_name)
     host_name = "127.0.0.1";
@@ -1754,13 +1784,13 @@
       || host_data->h_addrtype != AF_INET
       || host_data->h_length != sizeof address.sin_addr) {
     fprintf(stderr, "Failed to resolve host name `%s'\n", host_name);
-    exit(EXIT_FAILURE);
+    return EXIT_FAILURE;
   }
 
   connection_socket = socket(PF_INET, SOCK_STREAM, 0);
   if (connection_socket == -1) {
     fprintf(stderr, "Unexpected error: failed to create a socket\n");
-    exit(EXIT_FAILURE);
+    return EXIT_FAILURE;
   }
 
   address.sin_family = AF_INET;
@@ -1777,7 +1807,7 @@
   if (! *address_pointer) {
     fprintf(stderr, "Failed to connect to %s:%d\n", host_data->h_name, port);
     closesocket(connection_socket);
-    exit(EXIT_FAILURE);
+    return EXIT_FAILURE;
   }
 
 #if !USE_WINDOWS_SOCKET_CLUDGE
@@ -1793,10 +1823,11 @@
   *output_file = NULL;
 
 #endif	/* USE_WINDOWS_SOCKET_CLUDGE */
+  return 0;
 }
 
 
-static void
+static int
 socket_listen_at(const char *host_name, unsigned int port,
 		 FILE **input_file, FILE **output_file)
 {
@@ -1804,7 +1835,8 @@
   int listening_socket;
   int connection_socket;
 
-  init_sockets();
+  if (init_sockets() != 0)
+    return EXIT_FAILURE;
 
   if (host_name) {
     struct hostent *host_data;
@@ -1814,7 +1846,7 @@
 	|| host_data->h_addrtype != AF_INET
 	|| host_data->h_length != sizeof address.sin_addr) {
       fprintf(stderr, "Failed to resolve host name `%s'\n", host_name);
-      exit(EXIT_FAILURE);
+      return EXIT_FAILURE;
     }
 
     host_name = host_data->h_name;
@@ -1827,7 +1859,7 @@
   listening_socket = socket(PF_INET, SOCK_STREAM, 0);
   if (listening_socket == -1) {
     fprintf(stderr, "Unexpected error: failed to create a socket\n");
-    exit(EXIT_FAILURE);
+    return EXIT_FAILURE;
   }
 
   address.sin_family = AF_INET;
@@ -1852,7 +1884,7 @@
       fprintf(stderr, "Failed to listen on port %d\n", port);
 
     closesocket(listening_socket);
-    exit(EXIT_FAILURE);
+    return EXIT_FAILURE;
   }
 
   closesocket(listening_socket);
@@ -1870,6 +1902,7 @@
   *output_file = NULL;
 
 #endif	/* USE_WINDOWS_SOCKET_CLUDGE */
+  return 0;
 }
 
 
@@ -1905,7 +1938,7 @@
 #else  /* not ENABLE_SOCKET_SUPPORT */
 
 
-static void
+static int
 socket_connect_to(const char *host_name, unsigned int port,
 		  FILE **input_file, FILE **output_file)
 {
@@ -1915,11 +1948,11 @@
   UNUSED(output_file);
 
   fprintf(stderr, "GNU Go was compiled without socket support, unable to connect\n");
-  exit(EXIT_FAILURE);
+  return EXIT_FAILURE;
 }
 
 
-static void
+static int
 socket_listen_at(const char *host_name, unsigned int port,
 		 FILE **input_file, FILE **output_file)
 {
@@ -1929,7 +1962,7 @@
   UNUSED(output_file);
 
   fprintf(stderr, "GNU Go was compiled without socket support, unable to listen\n");
-  exit(EXIT_FAILURE);
+  return EXIT_FAILURE;
 }
 
 
diff -N -r -u -X .ignore gnugo-copy/interface/play_gmp.c gnugo/interface/play_gmp.c
--- gnugo-copy/interface/play_gmp.c	2006-01-29 19:36:58.000000000 +0100
+++ gnugo/interface/play_gmp.c	2007-01-09 17:55:57.343750000 +0100
@@ -2,7 +2,7 @@
  * This is GNU Go, a Go program. Contact gnugo@gnu.org, or see       *
  * http://www.gnu.org/software/gnugo/ for more information.          *
  *                                                                   *
- * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 and 2006       *
+ * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 and 2007 *
  * by the Free Software Foundation.                                  *
  *                                                                   *
  * This program is free software; you can redistribute it and/or     *
@@ -35,7 +35,7 @@
 /* --------------------------------------------------------------*/
 /* Play a game against a go-modem-protocol (GMP) client.         */
 /* --------------------------------------------------------------*/
-void
+int
 play_gmp(Gameinfo *gameinfo, int simplified)
 {
   SGFTree sgftree;
@@ -93,12 +93,14 @@
   
   if (message == gmp_err) {
     fprintf(stderr, "gnugo-gmp: Error \"%s\" occurred.\n", error);
-    exit(EXIT_FAILURE);
+    gmp_destroy(ge);
+    return EXIT_FAILURE;
   }
   else if (message != gmp_newGame) {
     fprintf(stderr, "gnugo-gmp: Expecting a newGame, got %s\n",
 	    gmp_resultString(message));
-    exit(EXIT_FAILURE);
+    gmp_destroy(ge);
+    return EXIT_FAILURE;
   }
 
   gameinfo->handicap = gmp_handicap(ge);
@@ -149,7 +151,8 @@
 	fprintf(stderr, "GNU Go: Sorry, error from gmp client\n");
         sgftreeAddComment(&sgftree, "got error from gmp client");
         sgffile_output(&sgftree);
-	return;
+	gmp_destroy(ge);
+	return EXIT_FAILURE;
       }
 
       if (message == gmp_undo) {
@@ -263,6 +266,8 @@
 
   if (!quiet)
     fprintf(stderr, "gnugo going down\n");
+  gmp_destroy(ge);
+  return 0;
 }
 
 /*
diff -N -r -u -X .ignore gnugo-copy/patterns/dfa.c gnugo/patterns/dfa.c
--- gnugo-copy/patterns/dfa.c	2006-01-23 19:15:50.000000000 +0100
+++ gnugo/patterns/dfa.c	2007-01-09 17:57:16.343750000 +0100
@@ -2,7 +2,7 @@
  * This is GNU Go, a Go program. Contact gnugo@gnu.org, or see       *
  * http://www.gnu.org/software/gnugo/ for more information.          *
  *                                                                   *
- * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 and 2006       *
+ * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 and 2007 *
  * by the Free Software Foundation.                                  *
  *                                                                   *
  * This program is free software; you can redistribute it and/or     *
@@ -21,7 +21,7 @@
 \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * * * * * * * * fast pattern matching with DFA  version 2.9 * * *
+ * * * * * * * * fast pattern matching with DFA version 2.91 * * *
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 #include "liberty.h"
@@ -82,6 +82,8 @@
 
 static void dfa_prepare_rotation_data(void);
 
+static void dfa_hash_clear(void);
+
 
 /********************************
  * manipulating attributes list *
@@ -774,6 +776,7 @@
   for (j = 0; j < DFA_BINS; j++)
     kill_dfa(&(aux_dfa[j]));
   kill_dfa(&aux_temp);
+  dfa_hash_clear();
   dfa_was_initialized--;
 }
 
@@ -882,7 +885,12 @@
       pdfa->states[i].next[j] = state_to[old_states[state_from[i]].next[j]];
     } 
     pdfa->states[i].att = old_states[state_from[i]].att;
-  } 
+  }
+  free(old_states);
+  free(queue1);
+  free(queue2);
+  free(state_to);
+  free(state_from);
 }
 
 
@@ -1916,7 +1924,6 @@
   fprintf(stderr, "\nTotal optimization result: %d => %d states\n",
 	  num_nodes_original - 1, min_nodes_so_far - 1);
 
-  dfa_graph_clear(&(patterns->graph));
   return best_variations;
 }
 
diff -N -r -u -X .ignore gnugo-copy/patterns/dfa.vcproj gnugo/patterns/dfa.vcproj
--- gnugo-copy/patterns/dfa.vcproj	1970-01-01 01:00:00.000000000 +0100
+++ gnugo/patterns/dfa.vcproj	2007-01-08 23:41:24.234375000 +0100
@@ -0,0 +1,236 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8,00"
+	Name="dfa"
+	ProjectGUID="{D0EB45DD-512C-4D2E-A695-6E4BFBD68266}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="0"
+				AdditionalIncludeDirectories="..,../sgf,../engine,../utils"
+				PreprocessorDefinitions="_DEBUG;WIN32;_LIB;HAVE_CONFIG_H"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/dfa.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName="Debug/dfa"
+				BrowseInformation="1"
+				WarningLevel="4"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4127;4131;4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\Debug\dfa.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Debug/dfa.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="2"
+				InlineFunctionExpansion="0"
+				FavorSizeOrSpeed="1"
+				WholeProgramOptimization="true"
+				AdditionalIncludeDirectories="..,../sgf,../engine,../utils"
+				PreprocessorDefinitions="NDEBUG;WIN32;_LIB;HAVE_CONFIG_H"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\Release/dfa.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName="Release/dfa"
+				BrowseInformation="0"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\Release\dfa.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Release/dfa.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="dfa.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="transform.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="dfa.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff -N -r -u -X .ignore gnugo-copy/patterns/extract_fuseki.c gnugo/patterns/extract_fuseki.c
--- gnugo-copy/patterns/extract_fuseki.c	2006-01-23 19:15:50.000000000 +0100
+++ gnugo/patterns/extract_fuseki.c	2007-01-09 18:00:47.718750000 +0100
@@ -2,7 +2,7 @@
  * This is GNU Go, a Go program. Contact gnugo@gnu.org, or see       *
  * http://www.gnu.org/software/gnugo/ for more information.          *
  *                                                                   *
- * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 and 2006       *
+ * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 and 2007 *
  * by the Free Software Foundation.                                  *
  *                                                                   *
  * This program is free software; you can redistribute it and/or     *
@@ -436,6 +436,13 @@
   number_of_situations = 0;
 }
 
+/* Frees situation_table memory. */
+static void
+free_situations(void)
+{
+  free(situation_table);
+}
+
 /* Compare two hash values. Used for sorting the hash values in the
  * invariant hash.
  */
@@ -1310,6 +1317,8 @@
     if (number_of_winning_moves == MAX_PATTERNS_TO_EXTRACT)
       break;
   }
+
+  free(frequency_table);
   
   /* Debug output. */
   if (0) {
@@ -1697,7 +1706,13 @@
 
     fprintf(stderr, "Out of %d games, %d were not used.\n", 
 	    number_of_games, number_of_unused_games);
+
+    free_situations();
+    free(winning_moves);
   }
+
+  free(unused_games);
+  free(sgf_names);
   
   return 0;
 }
diff -N -r -u -X .ignore gnugo-copy/patterns/fuseki.vcproj gnugo/patterns/fuseki.vcproj
--- gnugo-copy/patterns/fuseki.vcproj	1970-01-01 01:00:00.000000000 +0100
+++ gnugo/patterns/fuseki.vcproj	2007-01-08 23:41:24.250000000 +0100
@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8,00"
+	Name="fuseki"
+	ProjectGUID="{BCCACB0E-1F1F-43D0-95A2-4BF407E6E0BC}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/fuseki.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="2"
+				InlineFunctionExpansion="0"
+				FavorSizeOrSpeed="1"
+				WholeProgramOptimization="true"
+				AdditionalIncludeDirectories=".,..,../sgf,../engine,../utils"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\Release/fuseki.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				BrowseInformation="0"
+				WarningLevel="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="sgf.lib engine.lib utils.lib"
+				OutputFile="Release/extract_fuseki.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="../sgf/Release/,../engine/Release/,../utils/Release/,./Release/"
+				ProgramDatabaseFile=".\Release/extract_fuseki.pdb"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Release/fuseki.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/fuseki.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="0"
+				AdditionalIncludeDirectories=".,..,../sgf,../engine,../utils"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/fuseki.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				BrowseInformation="1"
+				WarningLevel="4"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4127;4131;4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib"
+				OutputFile="Debug/extract_fuseki.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/extract_fuseki.pdb"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Debug/fuseki.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="extract_fuseki.c"
+				>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						DisableSpecificWarnings="4996"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						DisableSpecificWarnings="4996"
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff -N -r -u -X .ignore gnugo-copy/patterns/joseki.vcproj gnugo/patterns/joseki.vcproj
--- gnugo-copy/patterns/joseki.vcproj	1970-01-01 01:00:00.000000000 +0100
+++ gnugo/patterns/joseki.vcproj	2007-01-08 23:41:24.265625000 +0100
@@ -0,0 +1,258 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8,00"
+	Name="joseki"
+	ProjectGUID="{F99BF078-88AE-46CD-BE62-D632D7F7945B}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/joseki.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="0"
+				AdditionalIncludeDirectories=".,..,../sgf,../engine,../utils"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/joseki.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName="Debug/joseki"
+				BrowseInformation="1"
+				WarningLevel="4"
+				DebugInformationFormat="4"
+				DisableSpecificWarnings="4127;4131;4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="sgf.lib utils.lib board.lib"
+				OutputFile=".\Debug/joseki.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="../sgf/$(IntDir)/,../utils/$(IntDir)/,../engine/$(IntDir)/"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/joseki.pdb"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Debug/joseki.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/joseki.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="2"
+				InlineFunctionExpansion="0"
+				FavorSizeOrSpeed="1"
+				WholeProgramOptimization="true"
+				AdditionalIncludeDirectories=".,..,../sgf,../engine,../utils"
+				PreprocessorDefinitions="WIN32;NDEBUG;HAVE_CONFIG_H;_CONSOLE"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\Release/joseki.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName="Release/joseki"
+				BrowseInformation="0"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="sgf.lib utils.lib board.obj"
+				OutputFile=".\Release/joseki.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="../sgf/$(IntDir)/,../utils/$(IntDir)/,../engine/$(IntDir)/"
+				ProgramDatabaseFile=".\Release/joseki.pdb"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Release/joseki.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="joseki.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff -N -r -u -X .ignore gnugo-copy/patterns/mkeyes.vcproj gnugo/patterns/mkeyes.vcproj
--- gnugo-copy/patterns/mkeyes.vcproj	1970-01-01 01:00:00.000000000 +0100
+++ gnugo/patterns/mkeyes.vcproj	2007-01-08 23:41:24.281250000 +0100
@@ -0,0 +1,243 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8,00"
+	Name="mkeyes"
+	ProjectGUID="{C49A0E28-3304-4E6D-A730-97968706D939}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/mkeyes.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="0"
+				AdditionalIncludeDirectories="..,../engine,../sgf,../utils"
+				PreprocessorDefinitions="_DEBUG;HAVE_CONFIG_H;WIN32;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/mkeyes.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName="Debug/mkeyes"
+				BrowseInformation="1"
+				WarningLevel="4"
+				DebugInformationFormat="4"
+				DisableSpecificWarnings="4127;4131;4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib"
+				OutputFile=".\Debug/mkeyes.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/mkeyes.pdb"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Debug/mkeyes.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/mkeyes.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="2"
+				InlineFunctionExpansion="0"
+				FavorSizeOrSpeed="1"
+				WholeProgramOptimization="true"
+				AdditionalIncludeDirectories="..,../engine,../sgf,../utils"
+				PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;HAVE_CONFIG_H"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\Release/mkeyes.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName="Release/mkeyes"
+				BrowseInformation="0"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib"
+				OutputFile=".\Release/mkeyes.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\Release/mkeyes.pdb"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Release/mkeyes.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="mkeyes.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff -N -r -u -X .ignore gnugo-copy/patterns/mkpat.c gnugo/patterns/mkpat.c
--- gnugo-copy/patterns/mkpat.c	2006-11-12 17:35:12.000000000 +0100
+++ gnugo/patterns/mkpat.c	2007-01-09 18:41:30.125000000 +0100
@@ -2,7 +2,7 @@
  * This is GNU Go, a Go program. Contact gnugo@gnu.org, or see       *
  * http://www.gnu.org/software/gnugo/ for more information.          *
  *                                                                   *
- * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 and 2006       *
+ * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 and 2007 *
  * by the Free Software Foundation.                                  *
  *                                                                   *
  * This program is free software; you can redistribute it and/or     *
@@ -508,6 +508,17 @@
 
 static struct hint_data *first_hint = NULL;
 
+static void
+free_hint_data(void)
+{
+  struct hint_data *next = first_hint;
+  while (next != NULL) {
+    next = next->next;
+    free(first_hint);
+    first_hint = next;
+  }
+}
+
 
 static void
 parse_transformations_file(FILE *file)
@@ -1991,6 +2002,21 @@
 }
 
 
+/* Frees memory allocated for corner variations. */
+static void
+free_corner_variations(void)
+{
+  struct corner_variation_b *node = corner_root.child;
+  struct corner_variation_b *child;
+
+  while (node != NULL) {
+    child = node->child;
+    free(node);
+    node = child;
+  }
+}
+
+
 /* Follow a variation. If such a variation already exists, returns
  * a pointer to it. Otherwise, creates and initializes a new one.
  */
@@ -2872,6 +2898,8 @@
     } /* while not EOF */
   } /* for each file */
 
+  free_hint_data();
+
   convert_attribute_labels_to_offsets();
   
   if (patno >= 0) {
@@ -2950,6 +2978,7 @@
         fprintf(stderr, "Warning: Increase DFA_MAX_MATCHED in 'dfa.h'.\n");
 
       kill_dfa(&dfa);
+      dfa_patterns_clear(&dfa_pats);
       dfa_end();
     }
 
@@ -2991,10 +3020,14 @@
 	      optimized_variations[k]);
     }
 
+    dfa_patterns_clear(&dfa_pats);
     free(optimized_variations);
     dfa_end();
   }
 
+  if (database_type == DB_CORNER)
+    free_corner_variations();
+
   return fatal_errors ? 1 : 0;
 }
 
diff -N -r -u -X .ignore gnugo-copy/patterns/mkpat.vcproj gnugo/patterns/mkpat.vcproj
--- gnugo-copy/patterns/mkpat.vcproj	1970-01-01 01:00:00.000000000 +0100
+++ gnugo/patterns/mkpat.vcproj	2007-01-08 23:41:24.281250000 +0100
@@ -0,0 +1,266 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8,00"
+	Name="mkpat"
+	ProjectGUID="{0CF62660-27DE-472F-82AC-6870F06860F2}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Debug/mkpat.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="0"
+				AdditionalIncludeDirectories="..,..\utils,..\engine,..\sgf"
+				PreprocessorDefinitions="_DEBUG;HAVE_CONFIG_H;WIN32;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/mkpat.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName="Debug/mkpat"
+				BrowseInformation="1"
+				WarningLevel="4"
+				DebugInformationFormat="4"
+				DisableSpecificWarnings="4127;4131;4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\utils\Debug\utils.lib .\Debug\dfa.lib"
+				OutputFile=".\Debug/mkpat.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/mkpat.pdb"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Debug/mkpat.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TypeLibraryName=".\Release/mkpat.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="2"
+				InlineFunctionExpansion="0"
+				FavorSizeOrSpeed="1"
+				WholeProgramOptimization="true"
+				AdditionalIncludeDirectories="..,..\utils,..\engine,..\sgf"
+				PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;HAVE_CONFIG_H"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\Release/mkpat.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName="Release/mkpat"
+				BrowseInformation="0"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="..\utils\Release\utils.lib .\Release\dfa.lib"
+				OutputFile=".\Release/mkpat.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Release/mkpat.pdb"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Release/mkpat.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="mkpat.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="transform.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff -N -r -u -X .ignore gnugo-copy/patterns/patterns.vcproj gnugo/patterns/patterns.vcproj
--- gnugo-copy/patterns/patterns.vcproj	1970-01-01 01:00:00.000000000 +0100
+++ gnugo/patterns/patterns.vcproj	2007-01-09 18:37:34.484375000 +0100
@@ -0,0 +1,1286 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8,00"
+	Name="patterns"
+	ProjectGUID="{E080B13B-3A8B-42AF-9137-DFABD6F28EA9}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="0"
+				AdditionalIncludeDirectories=".,..,..\engine,../sgf,../utils"
+				PreprocessorDefinitions="WIN32;_DEBUG;HAVE_CONFIG_H;_LIB"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\Debug/patterns.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName="Debug/patterns"
+				BrowseInformation="1"
+				WarningLevel="4"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4127;4131;4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\Debug\patterns.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Debug/patterns.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="4"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
+				Optimization="2"
+				InlineFunctionExpansion="0"
+				FavorSizeOrSpeed="1"
+				WholeProgramOptimization="true"
+				AdditionalIncludeDirectories=".,..,..\engine,../sgf,../utils"
+				PreprocessorDefinitions="WIN32;NDEBUG;HAVE_CONFIG_H;_LIB"
+				StringPooling="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\Release/patterns.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName="Release/patterns"
+				BrowseInformation="0"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+				OutputFile=".\Release\patterns.lib"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Release/patterns.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="aa_attackpat.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="apatterns.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="barriers.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="conn.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="connections.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="dpatterns.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="endgame.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="eyes.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="fuseki13.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="fuseki19.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="fuseki9.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="fusekipat.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="handipat.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="helpers.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="influence.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="josekid