Merge pull request #57 from johnweldon/master

Better MSVC 2010 fix for CleanGoogleDocument unresolved externals.
This commit is contained in:
Michael[tm] Smith 2012-07-20 21:33:19 -07:00
commit 08c12634e9
3 changed files with 37 additions and 23 deletions

View file

@ -273,6 +273,12 @@
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\gdoc.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="tidy.def" /> <None Include="tidy.def" />
@ -302,8 +308,9 @@
<ClInclude Include="..\..\src\utf8.h" /> <ClInclude Include="..\..\src\utf8.h" />
<ClInclude Include="..\..\src\version.h" /> <ClInclude Include="..\..\src\version.h" />
<ClInclude Include="..\..\src\win32tc.h" /> <ClInclude Include="..\..\src\win32tc.h" />
<ClInclude Include="..\..\src\gdoc.h" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>

View file

@ -270,6 +270,13 @@
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\gdoc.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<UndefinePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\src\access.h" /> <ClInclude Include="..\..\src\access.h" />
@ -296,8 +303,9 @@
<ClInclude Include="..\..\src\utf8.h" /> <ClInclude Include="..\..\src\utf8.h" />
<ClInclude Include="..\..\src\version.h" /> <ClInclude Include="..\..\src\version.h" />
<ClInclude Include="..\..\src\win32tc.h" /> <ClInclude Include="..\..\src\win32tc.h" />
<ClInclude Include="..\..\src\gdoc.h" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>

View file

@ -5,19 +5,19 @@
CVS Info : CVS Info :
$Author: arnaud02 $ $Author: arnaud02 $
$Date: 2008/06/18 20:18:54 $ $Date: 2008/06/18 20:18:54 $
$Revision: 1.75 $ $Revision: 1.75 $
Defines HTML Tidy API implemented by tidy library. Defines HTML Tidy API implemented by tidy library.
Very rough initial cut for discussion purposes. Very rough initial cut for discussion purposes.
Public interface is const-correct and doesn't explicitly depend Public interface is const-correct and doesn't explicitly depend
on any globals. Thus, thread-safety may be introduced w/out on any globals. Thus, thread-safety may be introduced w/out
changing the interface. changing the interface.
Looking ahead to a C++ wrapper, C functions always pass Looking ahead to a C++ wrapper, C functions always pass
this-equivalent as 1st arg. this-equivalent as 1st arg.
Created 2001-05-20 by Charles Reitzel Created 2001-05-20 by Charles Reitzel
@ -118,7 +118,7 @@ TidyOption tidyImplToOption( const TidyOptionImpl* option )
** 0 -> SUCCESS ** 0 -> SUCCESS
** >0 -> WARNING ** >0 -> WARNING
** <0 -> ERROR ** <0 -> ERROR
** **
*/ */
TidyDoc TIDY_CALL tidyCreate(void) TidyDoc TIDY_CALL tidyCreate(void)
@ -629,8 +629,8 @@ Bool TIDY_CALL tidyOptCopyConfig( TidyDoc to, TidyDoc from )
/* I/O and Message handling interface /* I/O and Message handling interface
** **
** By default, Tidy will define, create and use ** By default, Tidy will define, create and use
** tdocances of input and output handlers for ** tdocances of input and output handlers for
** standard C buffered I/O (i.e. FILE* stdin, ** standard C buffered I/O (i.e. FILE* stdin,
** FILE* stdout and FILE* stderr for content ** FILE* stdout and FILE* stderr for content
** input, content output and diagnostic output, ** input, content output and diagnostic output,
@ -640,7 +640,7 @@ Bool TIDY_CALL tidyOptCopyConfig( TidyDoc to, TidyDoc from )
*/ */
/* Use TidyReportFilter to filter messages by diagnostic level: /* Use TidyReportFilter to filter messages by diagnostic level:
** info, warning, etc. Just set diagnostic output ** info, warning, etc. Just set diagnostic output
** handler to redirect all diagnostics output. Return true ** handler to redirect all diagnostics output. Return true
** to proceed with output, false to cancel. ** to proceed with output, false to cancel.
*/ */
@ -799,7 +799,7 @@ uint TIDY_CALL tidyConfigErrorCount( TidyDoc tdoc )
} }
/* Error reporting functions /* Error reporting functions
*/ */
void TIDY_CALL tidyErrorSummary( TidyDoc tdoc ) void TIDY_CALL tidyErrorSummary( TidyDoc tdoc )
{ {
@ -975,7 +975,7 @@ int tidyDocSaveFile( TidyDocImpl* doc, ctmbstr filnam )
if ( doc->errors > 0 && if ( doc->errors > 0 &&
cfgBool(doc, TidyWriteBack) && !cfgBool(doc, TidyForceOutput) ) cfgBool(doc, TidyWriteBack) && !cfgBool(doc, TidyForceOutput) )
status = tidyDocStatus( doc ); status = tidyDocStatus( doc );
else else
fout = fopen( filnam, "wb" ); fout = fopen( filnam, "wb" );
if ( fout ) if ( fout )
@ -1009,7 +1009,7 @@ int tidyDocSaveFile( TidyDocImpl* doc, ctmbstr filnam )
** The code has been left in in case it works w/ other compilers ** The code has been left in in case it works w/ other compilers
** or operating systems. If stdout is in Text mode, be aware that ** or operating systems. If stdout is in Text mode, be aware that
** it will garble UTF16 documents. In text mode, when it encounters ** it will garble UTF16 documents. In text mode, when it encounters
** a single byte of value 10 (0xA), it will insert a single byte ** a single byte of value 10 (0xA), it will insert a single byte
** value 13 (0xD) just before it. This has the effect of garbling ** value 13 (0xD) just before it. This has the effect of garbling
** the entire document. ** the entire document.
*/ */
@ -1074,7 +1074,7 @@ int tidyDocSaveString( TidyDocImpl* doc, tmbstr buffer, uint* buflen )
TidyBuffer outbuf; TidyBuffer outbuf;
StreamOut* out; StreamOut* out;
int status; int status;
tidyBufInitWithAllocator( &outbuf, doc->allocator ); tidyBufInitWithAllocator( &outbuf, doc->allocator );
out = TY_(BufferOutput)( doc, &outbuf, outenc, nl ); out = TY_(BufferOutput)( doc, &outbuf, outenc, nl );
status = tidyDocSaveStream( doc, out ); status = tidyDocSaveStream( doc, out );
@ -1098,7 +1098,7 @@ int tidyDocSaveBuffer( TidyDocImpl* doc, TidyBuffer* outbuf )
uint outenc = cfg( doc, TidyOutCharEncoding ); uint outenc = cfg( doc, TidyOutCharEncoding );
uint nl = cfg( doc, TidyNewline ); uint nl = cfg( doc, TidyNewline );
StreamOut* out = TY_(BufferOutput)( doc, outbuf, outenc, nl ); StreamOut* out = TY_(BufferOutput)( doc, outbuf, outenc, nl );
status = tidyDocSaveStream( doc, out ); status = tidyDocSaveStream( doc, out );
TidyDocFree( doc, out ); TidyDocFree( doc, out );
} }
@ -1145,7 +1145,7 @@ int TIDY_CALL tidyRunDiagnostics( TidyDoc tdoc )
/* Workhorse functions. /* Workhorse functions.
** **
** Parse requires input source, all input config items ** Parse requires input source, all input config items
** and diagnostic sink to have all been set before calling. ** and diagnostic sink to have all been set before calling.
** **
** Emit likewise requires that document sink and all ** Emit likewise requires that document sink and all
@ -1227,7 +1227,7 @@ int tidyDocRunDiagnostics( TidyDocImpl* doc )
TY_(ReportMarkupVersion)( doc ); TY_(ReportMarkupVersion)( doc );
TY_(ReportNumWarnings)( doc ); TY_(ReportNumWarnings)( doc );
} }
if ( doc->errors > 0 && !force ) if ( doc->errors > 0 && !force )
TY_(NeedsAuthorIntervention)( doc ); TY_(NeedsAuthorIntervention)( doc );
@ -1281,7 +1281,7 @@ int tidyDocCleanAndRepair( TidyDocImpl* doc )
TY_(CleanDocument)( doc ); TY_(CleanDocument)( doc );
/* clean up html exported by Google Focs */ /* clean up html exported by Google Focs */
#if 0 #if 1
if ( gdoc ) if ( gdoc )
TY_(CleanGoogleDocument)( doc ); TY_(CleanGoogleDocument)( doc );
#endif #endif
@ -1404,7 +1404,6 @@ int tidyDocSaveStream( TidyDocImpl* doc, StreamOut* out )
{ {
/* noop */ /* noop */
TY_(DropFontElements)(doc, &doc->root, NULL); TY_(DropFontElements)(doc, &doc->root, NULL);
TY_(WbrToSpace)(doc, &doc->root);
} }
if ((makeClean && asciiChars) || makeBare) if ((makeClean && asciiChars) || makeBare)
@ -1455,8 +1454,8 @@ int tidyDocSaveStream( TidyDocImpl* doc, StreamOut* out )
** **
** The big issue here is the degree to which we should mimic ** The big issue here is the degree to which we should mimic
** a DOM and/or SAX nodes. ** a DOM and/or SAX nodes.
** **
** Is it 100% possible (and, if so, how difficult is it) to ** Is it 100% possible (and, if so, how difficult is it) to
** emit SAX events from this API? If SAX events are possible, ** emit SAX events from this API? If SAX events are possible,
** is that 100% of data needed to build a DOM? ** is that 100% of data needed to build a DOM?
*/ */
@ -1587,7 +1586,7 @@ Bool TIDY_CALL tidyNodeGetText( TidyDoc tdoc, TidyNode tnod, TidyBuffer* outbuf
TY_(PFlushLine)( doc, 0 ); TY_(PFlushLine)( doc, 0 );
doc->docOut = NULL; doc->docOut = NULL;
TidyDocFree( doc, out ); TidyDocFree( doc, out );
return yes; return yes;
} }