From 7f9fb4c0ee99be34ed98a7ba7e32e24f579d850d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 12 Jul 2010 18:43:19 +0000 Subject: [PATCH] 2010-07-12 20:39 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg ! Fixed to honor -stop option in -hbimplib mode. ! Fixed --hbinfo when there is missing dependency. * contrib/hbmysql/hbmysql.hbi * contrib/gtalleg/gtalleg.hbi * contrib/sddmy/sddmy.hbi * contrib/sddfb/sddfb.hbi * contrib/hbblat/hbblat.hbi * contrib/hbfbird/hbfbird.hbi * contrib/sddpg/sddpg.hbi * contrib/hbcurl/hbcurl.hbi * contrib/hbhpdf/hbhpdf.hbi * contrib/hbpgsql/hbpgsql.hbi * contrib/rddads/rddads.hbi * contrib/hbfimage/hbfimage.hbi * contrib/hbgd/hbgd.hbi * contrib/sddoci/sddoci.hbi * contrib/hbcairo/hbcairo.hbi * contrib/hbssl/hbssl.hbi + Added -stop option in case HB_WITH_* var is empty. This helps reducing some clutter in build log output. * contrib/make.hbs ! Fixed to clear target type detection result from previous contrib (even though such case cannot happen if hbmk2 does it's job right) * contrib/hbdoc2/gentpl.prg * contrib/hbdoc2/gentxt.prg * contrib/hbdoc2/tmplates.prg * contrib/hbdoc2/genxml.prg * contrib/hbdoc2/genhtml.prg * contrib/hbdoc2/hbdoc2.prg * contrib/hbdoc2/hbdoc2.ch % Peeling off unused code and other cleanup work. (didn't retest) --- harbour/ChangeLog | 39 +++++ harbour/contrib/gtalleg/gtalleg.hbi | 2 + harbour/contrib/hbblat/hbblat.hbi | 2 + harbour/contrib/hbcairo/hbcairo.hbi | 2 + harbour/contrib/hbcurl/hbcurl.hbi | 2 + harbour/contrib/hbdoc2/genhtml.prg | 127 +++++----------- harbour/contrib/hbdoc2/gentpl.prg | 2 +- harbour/contrib/hbdoc2/gentxt.prg | 16 +- harbour/contrib/hbdoc2/genxml.prg | 32 ++-- harbour/contrib/hbdoc2/hbdoc2.ch | 5 - harbour/contrib/hbdoc2/hbdoc2.prg | 204 +++++++++----------------- harbour/contrib/hbdoc2/tmplates.prg | 22 +-- harbour/contrib/hbfbird/hbfbird.hbi | 2 + harbour/contrib/hbfimage/hbfimage.hbi | 2 + harbour/contrib/hbgd/hbgd.hbi | 2 + harbour/contrib/hbhpdf/hbhpdf.hbi | 2 + harbour/contrib/hbmysql/hbmysql.hbi | 2 + harbour/contrib/hbpgsql/hbpgsql.hbi | 2 + harbour/contrib/hbssl/hbssl.hbi | 2 + harbour/contrib/make.hbs | 2 + harbour/contrib/rddads/rddads.hbi | 2 + harbour/contrib/sddfb/sddfb.hbi | 2 + harbour/contrib/sddmy/sddmy.hbi | 2 + harbour/contrib/sddoci/sddoci.hbi | 2 + harbour/contrib/sddpg/sddpg.hbi | 2 + harbour/utils/hbmk2/hbmk2.prg | 37 ++--- 26 files changed, 226 insertions(+), 292 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3fca1e644b..6ec3ed3160 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,45 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-12 20:39 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbmk2/hbmk2.prg + ! Fixed to honor -stop option in -hbimplib mode. + ! Fixed --hbinfo when there is missing dependency. + + * contrib/hbmysql/hbmysql.hbi + * contrib/gtalleg/gtalleg.hbi + * contrib/sddmy/sddmy.hbi + * contrib/sddfb/sddfb.hbi + * contrib/hbblat/hbblat.hbi + * contrib/hbfbird/hbfbird.hbi + * contrib/sddpg/sddpg.hbi + * contrib/hbcurl/hbcurl.hbi + * contrib/hbhpdf/hbhpdf.hbi + * contrib/hbpgsql/hbpgsql.hbi + * contrib/rddads/rddads.hbi + * contrib/hbfimage/hbfimage.hbi + * contrib/hbgd/hbgd.hbi + * contrib/sddoci/sddoci.hbi + * contrib/hbcairo/hbcairo.hbi + * contrib/hbssl/hbssl.hbi + + Added -stop option in case HB_WITH_* var is empty. + This helps reducing some clutter in build log output. + + * contrib/make.hbs + ! Fixed to clear target type detection result from previous + contrib (even though such case cannot happen if hbmk2 + does it's job right) + + * contrib/hbdoc2/gentpl.prg + * contrib/hbdoc2/gentxt.prg + * contrib/hbdoc2/tmplates.prg + * contrib/hbdoc2/genxml.prg + * contrib/hbdoc2/genhtml.prg + * contrib/hbdoc2/hbdoc2.prg + * contrib/hbdoc2/hbdoc2.ch + % Peeling off unused code and other cleanup work. + (didn't retest) + 2010-07-12 18:44 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * include/hbextern.ch * src/rtl/Makefile diff --git a/harbour/contrib/gtalleg/gtalleg.hbi b/harbour/contrib/gtalleg/gtalleg.hbi index 1335f72a2d..6a320c5134 100644 --- a/harbour/contrib/gtalleg/gtalleg.hbi +++ b/harbour/contrib/gtalleg/gtalleg.hbi @@ -4,4 +4,6 @@ -hbimplib +-stop{!HB_WITH_ALLEGRO} + ${HB_WITH_ALLEGRO}/../bin/alleg42.dll diff --git a/harbour/contrib/hbblat/hbblat.hbi b/harbour/contrib/hbblat/hbblat.hbi index 88d1c941b4..a342e43139 100644 --- a/harbour/contrib/hbblat/hbblat.hbi +++ b/harbour/contrib/hbblat/hbblat.hbi @@ -4,6 +4,8 @@ -hbimplib +-stop{!HB_WITH_BLAT} + ${HB_WITH_BLAT}/../blat.dll -iflag={bcc}-a diff --git a/harbour/contrib/hbcairo/hbcairo.hbi b/harbour/contrib/hbcairo/hbcairo.hbi index 97d6a5def3..1a2b299943 100644 --- a/harbour/contrib/hbcairo/hbcairo.hbi +++ b/harbour/contrib/hbcairo/hbcairo.hbi @@ -4,6 +4,8 @@ -hbimplib +-stop{!HB_WITH_CAIRO} + ${HB_WITH_CAIRO}/../../bin/libcairo-2.dll -iflag={bcc}-a diff --git a/harbour/contrib/hbcurl/hbcurl.hbi b/harbour/contrib/hbcurl/hbcurl.hbi index c0e36f6dc6..7b9a3b13cd 100644 --- a/harbour/contrib/hbcurl/hbcurl.hbi +++ b/harbour/contrib/hbcurl/hbcurl.hbi @@ -4,6 +4,8 @@ -hbimplib +-stop{!HB_WITH_CURL} + ${HB_WITH_CURL}/../libcurl.dll ${HB_WITH_CURL}/../bin/libcurl.dll diff --git a/harbour/contrib/hbdoc2/genhtml.prg b/harbour/contrib/hbdoc2/genhtml.prg index 500b7b8ae6..48992b833e 100644 --- a/harbour/contrib/hbdoc2/genhtml.prg +++ b/harbour/contrib/hbdoc2/genhtml.prg @@ -55,14 +55,15 @@ */ #include "hbclass.ch" +#include "common.ch" #include "inkey.ch" #include "fileio.ch" #include "hbdoc2.ch" #ifdef __PLATFORM__DOS - #define EXTENSION "htm" + #define EXTENSION ".htm" #else - #define EXTENSION "html" + #define EXTENSION ".html" #endif CLASS GenerateHTML2 FROM GenerateHTML @@ -71,12 +72,10 @@ CLASS GenerateHTML2 FROM GenerateHTML ENDCLASS METHOD NewDocument( cFolder, cFilename, cTitle ) CLASS GenerateHTML2 - ::lNewDocumentModel := .T. super:NewDocument( cFolder, cFilename, cTitle, EXTENSION ) RETURN self METHOD NewIndex( cFolder, cFilename, cTitle ) CLASS GenerateHTML2 - ::lNewDocumentModel := .T. super:NewIndex( cFolder, cFilename, cTitle, EXTENSION ) RETURN self @@ -87,20 +86,16 @@ HIDDEN: METHOD Tagged( cText, cTag, ... ) METHOD CloseTag( cText ) METHOD Append( cText, cFormat ) - METHOD Newline() INLINE FWrite( ::nHandle, "
" + HB_OSNewLine() ), self + METHOD Newline() INLINE FWrite( ::nHandle, "
" + hb_eol() ), self CLASSDATA lCreateStyleDocument AS LOGICAL INIT .T. DATA TargetFilename AS STRING INIT "" -PROTECTED: - DATA lNewDocumentModel AS LOGICAL INIT .F. - EXPORTED: METHOD NewFile() HIDDEN METHOD NewIndex( cFolder, cFilename, cTitle ) METHOD NewDocument( cFolder, cFilename, cTitle ) METHOD AddEntry( oEntry ) - //~ METHOD AddIndex( oEntry ) HIDDEN METHOD AddReference( oEntry, cReference, cSubReference ) METHOD BeginSection( cSection, cFilename ) METHOD EndSection( cSection, cFilename ) @@ -110,11 +105,7 @@ EXPORTED: ENDCLASS METHOD NewFile() CLASS GenerateHTML - IF ::lNewDocumentModel - FWrite( ::nHandle, '' + HB_OSNewLine() ) - ELSE - FWrite( ::nHandle, '' + HB_OSNewLine() ) - ENDIF + FWrite( ::nHandle, '' + hb_eol() ) ::OpenTag( "html" ) ::OpenTag( "head" ) @@ -123,22 +114,17 @@ METHOD NewFile() CLASS GenerateHTML ::OpenTag( "meta", "name", "generator", "content", "Harbour examples/hbdoc2" ) ::OpenTag( "meta", "name", "keywords", "content", "Harbour project, Clipper, xBase, database, Free Software, GNU, compiler, cross platform, 32-bit, FiveWin" ) - IF ::lNewDocumentModel -#define STYLEFILE "hrb_doc.css" - IF ::lCreateStyleDocument - ::lCreateStyleDocument := .F. - ::RecreateStyleDocument( STYLEFILE ) - ENDIF - ::OpenTag( "link", "rel", "stylesheet", "type", "text/css", "href", STYLEFILE ) -#undef STYLEFILE + #define STYLEFILE "hrb_doc.css" + IF ::lCreateStyleDocument + ::lCreateStyleDocument := .F. + ::RecreateStyleDocument( STYLEFILE ) ENDIF + ::OpenTag( "link", "rel", "stylesheet", "type", "text/css", "href", STYLEFILE ) + #undef STYLEFILE ::CloseTag( "head" ) ::OpenTag( "body" ) ::Append( ::cTitle, "h1" ) - /* IF ! Empty( ::cDescription ) - ::Append( ::cDescription, "h2" ) - ENDIF */ RETURN self @@ -153,7 +139,6 @@ METHOD NewIndex( cFolder, cFilename, cTitle ) CLASS GenerateHTML RETURN self METHOD BeginSection( cSection, cFilename ) CLASS GenerateHTML -//~ HB_SYMBOL_UNUSED( cFilename ) IF ::IsIndex() If cFilename == ::cFilename ::OpenTag( "a", "name", cSection ):Append( cSection, "h" + HB_NTOS( ::Depth + 2 ) ):CloseTag( "a" )//:Newline() @@ -171,7 +156,6 @@ METHOD EndSection( cSection, cFilename ) CLASS GenerateHTML HB_SYMBOL_UNUSED( cSection ) HB_SYMBOL_UNUSED( cFilename ) ::Depth-- - //~ FWrite( ::nHandle, Replicate( Chr(9), ::Depth ) + [] + HB_OSNewLine() ) RETURN self METHOD AddReference( oEntry, cReference, cSubReference ) CLASS GenerateHTML @@ -186,10 +170,6 @@ METHOD AddReference( oEntry, cReference, cSubReference ) CLASS GenerateHTML ENDIF RETURN self -//~ METHOD AddIndex( oEntry ) CLASS GenerateHTML - //~ ::OpenTag( "a", "href", ::TargetFilename + "." + ::cExtension + "#" + oEntry:Filename ):Append( oEntry:Name ):CloseTag( "a" ):Append( oEntry:OneLiner ):Newline() - //~ RETURN self - METHOD AddEntry( oEntry ) CLASS GenerateHTML LOCAL idx @@ -225,54 +205,25 @@ METHOD PROCEDURE WriteEntry( cField, oEntry, lPreformatted, nIndent ) CLASS Gene //~ DEFAULT cTagClass TO "itemtext" IF Len( cCaption ) > 0 /* .AND. nIndent > 0 */ - IF ::lNewDocumentModel - ::Tagged( cCaption, "div", "class", "itemtitle" ) - ELSE - ::Append( cCaption, "h5" ) - ENDIF - ENDIF - - IF ::lNewDocumentModel - ELSE - ::OpenTag( "dl" ) + ::Tagged( cCaption, "div", "class", "itemtitle" ) ENDIF IF lPreformatted - IF ::lNewDocumentModel - ::OpenTag( "pre", IIf( cTagClass != NIL, "class", ), cTagClass ) - ELSE - ::OpenTag( "dd" ):OpenTag( "pre" ) - ENDIF + ::OpenTag( "pre", IIf( cTagClass != NIL, "class", ), cTagClass ) DO WHILE Len( cEntry ) > 0 - ::Append( Indent( Parse( @cEntry, HB_OSNewLine() ), 0, , .T. ), "" ) + ::Append( Indent( Parse( @cEntry, hb_eol() ), 0, , .T. ), "" ) //~ IF Len( cEntry ) > 0 .AND. ! lPreformatted - //~ FWrite( ::nHandle, HB_OSNewLine() ) + //~ FWrite( ::nHandle, hb_eol() ) //~ ENDIF ENDDO - IF ::lNewDocumentModel - ::CloseTag( "pre" ) - ELSE - ::CloseTag( "pre" ):CloseTag( "dd" ) - ENDIF + ::CloseTag( "pre" ) ELSE DO WHILE Len( cEntry ) > 0 - IF ::lNewDocumentModel - ::OpenTag( "div", "class", cTagClass ) - ELSE - ::OpenTag( "dd" ):OpenTag( "p" ) - ENDIF - ::Append( Indent( Parse( @cEntry, HB_OSNewLine() ), 0, 70 ), "" ):Newline() - IF ::lNewDocumentModel - ::CloseTag( "div" ) - ELSE - ::CloseTag( "dd" ) - ENDIF + ::OpenTag( "div", "class", cTagClass ) + ::Append( Indent( Parse( @cEntry, hb_eol() ), 0, 70 ), "" ):Newline() + ::CloseTag( "div" ) ENDDO ENDIF - IF ::lNewDocumentModel - ELSE - ::CloseTag( "dl" ) - ENDIF ENDIF METHOD OpenTag( cText, ... ) CLASS GenerateHTML @@ -284,7 +235,7 @@ METHOD OpenTag( cText, ... ) CLASS GenerateHTML cTag += " " + aArgs[ idx ] + "=" + Chr(34) + aArgs[ idx + 1 ] + Chr(34) NEXT - FWrite( ::nHandle, "<" + cTag + ">" + HB_OSNewLine() ) + FWrite( ::nHandle, "<" + cTag + ">" + hb_eol() ) RETURN self @@ -297,12 +248,12 @@ METHOD Tagged( cText, cTag, ... ) CLASS GenerateHTML cResult += " " + aArgs[ idx ] + "=" + Chr(34) + aArgs[ idx + 1 ] + Chr(34) NEXT - FWrite( ::nHandle, cResult + ">" + cText + "" + /* "4" + */ HB_OSNewLine() ) + FWrite( ::nHandle, cResult + ">" + cText + "" + /* "4" + */ hb_eol() ) RETURN self METHOD CloseTag( cText ) CLASS GenerateHTML - FWrite( ::nHandle, "" + HB_OSNewLine() ) + FWrite( ::nHandle, "" + hb_eol() ) IF cText == "html" FClose( ::nHandle ) @@ -330,35 +281,29 @@ METHOD Append( cText, cFormat ) CLASS GenerateHTML cResult := "<" + aFormat[ idx ] + ">" + cResult + "" NEXT - DO WHILE Right( cResult, Len( HB_OSNewLine() ) ) == HB_OSNewLine() - cResult := SubStr( cResult, 1, Len( cResult ) - Len( HB_OSNewLine() ) ) + DO WHILE Right( cResult, Len( hb_eol() ) ) == hb_eol() + cResult := SubStr( cResult, 1, Len( cResult ) - Len( hb_eol() ) ) ENDDO - FWrite( ::nHandle, cResult + HB_OSNewLine() ) + FWrite( ::nHandle, cResult + hb_eol() ) ENDIF RETURN self METHOD RecreateStyleDocument( cStyleFile ) CLASS GenerateHTML - LOCAL nHandle - IF ( nHandle := FCreate( ::cFolder + p_hsSwitches[ "PATH_SEPARATOR" ] + cStyleFile ) ) > 0 - FWrite( nHandle, ; - "/* Harbour Documents Stylesheet (" + cStyleFile + ") */" + HB_OSNewLine() + ; - "body {font-family:arial;font-size:14px;line-height:18px;}" + HB_OSNewLine() + ; - /* ".classtitle {font-weight:bold;font-size:22px;padding-bottom:4px;}" + HB_OSNewLine() + */ ; - ".name {font-weight:bold;font-size:18px;margin-left:0px;padding-top:0px;padding-bottom:4px;}" + HB_OSNewLine() + ; - ".oneliner {font-style:italic;margin-bottom:12px;}" + HB_OSNewLine() + ; - ".itemtitle {font-weight:bold;margin-left:0px;padding-top:0px;padding-bottom:4px;}" + HB_OSNewLine() + ; - ".itemtext {margin-left:10px;padding-bottom:4px;}" + HB_OSNewLine() + ; - ".examples {margin-left:10px;padding-bottom:4px;}" + HB_OSNewLine() + ; - ".tests {margin-left:10px;padding-bottom:4px;}" + HB_OSNewLine() + ; - "" ; - ) - - FClose( nHandle ) - ELSE + IF ! hb_MemoWrit( ::cFolder + p_hsSwitches[ "PATH_SEPARATOR" ] + cStyleFile,; + "/* Harbour Documents Stylesheet (" + cStyleFile + ") */" + hb_eol() + ; + "body {font-family:arial;font-size:14px;line-height:18px;}" + hb_eol() + ; + /* ".classtitle {font-weight:bold;font-size:22px;padding-bottom:4px;}" + hb_eol() + */ ; + ".name {font-weight:bold;font-size:18px;margin-left:0px;padding-top:0px;padding-bottom:4px;}" + hb_eol() + ; + ".oneliner {font-style:italic;margin-bottom:12px;}" + hb_eol() + ; + ".itemtitle {font-weight:bold;margin-left:0px;padding-top:0px;padding-bottom:4px;}" + hb_eol() + ; + ".itemtext {margin-left:10px;padding-bottom:4px;}" + hb_eol() + ; + ".examples {margin-left:10px;padding-bottom:4px;}" + hb_eol() + ; + ".tests {margin-left:10px;padding-bottom:4px;}" + hb_eol() + ; + "" ) // TODO: raise an error, could not create style file ENDIF diff --git a/harbour/contrib/hbdoc2/gentpl.prg b/harbour/contrib/hbdoc2/gentpl.prg index 63b43fd247..ccc5e4e6d9 100644 --- a/harbour/contrib/hbdoc2/gentpl.prg +++ b/harbour/contrib/hbdoc2/gentpl.prg @@ -110,6 +110,6 @@ METHOD New( cFolder, cFilename, cTitle, cExtension, nType ) CLASS TPLGenerate MAKEDIR( ::cFolder ) ENDIF - ::nHandle := FCreate( ::cFolder + p_hsSwitches[ "PATH_SEPARATOR" ] + ::cFilename + "." + ::cExtension ) + ::nHandle := FCreate( ::cFolder + p_hsSwitches[ "PATH_SEPARATOR" ] + ::cFilename + ::cExtension ) RETURN self diff --git a/harbour/contrib/hbdoc2/gentxt.prg b/harbour/contrib/hbdoc2/gentxt.prg index 456e1fc780..26df202e3c 100644 --- a/harbour/contrib/hbdoc2/gentxt.prg +++ b/harbour/contrib/hbdoc2/gentxt.prg @@ -93,13 +93,13 @@ EXPORTED: ENDCLASS METHOD NewDocument( cFolder, cFilename, cTitle ) CLASS GenerateText - super:NewDocument( cFolder, cFilename, cTitle, "txt" ) - ::WriteEntry( "", cTitle + HB_OSNewLine(), .F. ) + super:NewDocument( cFolder, cFilename, cTitle, ".txt" ) + ::WriteEntry( "", cTitle + hb_eol(), .F. ) RETURN self METHOD NewIndex( cFolder, cFilename, cTitle ) CLASS GenerateText - super:NewIndex( cFolder, cFilename, cTitle, "txt" ) - ::WriteEntry( "", cTitle + HB_OSNewLine(), .F. ) + super:NewIndex( cFolder, cFilename, cTitle, ".txt" ) + ::WriteEntry( "", cTitle + hb_eol(), .F. ) RETURN self METHOD BeginSection( cSection, cFilename ) CLASS GenerateText @@ -128,7 +128,7 @@ METHOD AddEntry( oEntry ) CLASS GenerateText NEXT IF ! ::lContinuous - FWrite( ::nHandle, Chr( K_CTRL_L ) + HB_OSNewLine() ) + FWrite( ::nHandle, Chr( K_CTRL_L ) + hb_eol() ) ENDIF ENDIF @@ -139,18 +139,18 @@ METHOD PROCEDURE WriteEntry( cCaption, cEntry, lPreformatted ) CLASS GenerateTex IF ! Empty( cEntry ) nIndent := IIf( Len( cCaption ) > 0, 6, 0 ) IF Len( cCaption ) > 0 .AND. nIndent > 0 - FWrite( ::nHandle, Space( ::Depth * 6 ) + cCaption + ": " + HB_OSNewLine() ) + FWrite( ::nHandle, Space( ::Depth * 6 ) + cCaption + ": " + hb_eol() ) ENDIF nIndent += ::Depth * 6 DO WHILE Len( cEntry ) > 0 - FWrite( ::nHandle, Indent( Parse( @cEntry, HB_OSNewLine() ), nIndent, 70, lPreformatted ) ) + FWrite( ::nHandle, Indent( Parse( @cEntry, hb_eol() ), nIndent, 70, lPreformatted ) ) ENDDO ENDIF METHOD Generate() CLASS GenerateText IF ::IsIndex() IF ! ::lContinuous - FWrite( ::nHandle, Chr( K_CTRL_L ) + HB_OSNewLine() ) + FWrite( ::nHandle, Chr( K_CTRL_L ) + hb_eol() ) ENDIF ENDIF diff --git a/harbour/contrib/hbdoc2/genxml.prg b/harbour/contrib/hbdoc2/genxml.prg index 3502528912..3233222dfa 100644 --- a/harbour/contrib/hbdoc2/genxml.prg +++ b/harbour/contrib/hbdoc2/genxml.prg @@ -77,22 +77,22 @@ EXPORTED: ENDCLASS METHOD NewDocument( cFolder, cFilename, cTitle ) CLASS GenerateXML - super:NewDocument( cFolder, cFilename, cTitle, "xml" ) - FWrite( ::nHandle, '' + HB_OSNewLine() ) - FWrite( ::nHandle, '' + HB_OSNewLine() ) + super:NewDocument( cFolder, cFilename, cTitle, ".xml" ) + FWrite( ::nHandle, '' + hb_eol() ) + FWrite( ::nHandle, '' + hb_eol() ) RETURN self METHOD NewIndex( cFolder, cFilename, cTitle ) CLASS GenerateXML - super:NewIndex( cFolder, cFilename, cTitle, "xml" ) - FWrite( ::nHandle, '' + HB_OSNewLine() ) - FWrite( ::nHandle, '' + HB_OSNewLine() ) + super:NewIndex( cFolder, cFilename, cTitle, ".xml" ) + FWrite( ::nHandle, '' + hb_eol() ) + FWrite( ::nHandle, '' + hb_eol() ) RETURN self METHOD BeginSection( cSection, cFilename ) CLASS GenerateXML IF ::Depth == 0 - FWrite( ::nHandle, Replicate( Chr(9), ::Depth ) + [
] + HB_OSNewLine() ) + FWrite( ::nHandle, Replicate( Chr(9), ::Depth ) + [
] + hb_eol() ) ELSE - FWrite( ::nHandle, Replicate( Chr(9), ::Depth ) + [
] + HB_OSNewLine() ) + FWrite( ::nHandle, Replicate( Chr(9), ::Depth ) + [
] + hb_eol() ) ENDIF ::Depth++ RETURN self @@ -101,7 +101,7 @@ METHOD EndSection( cSection, cFilename ) CLASS GenerateXML HB_SYMBOL_UNUSED( cSection ) HB_SYMBOL_UNUSED( cFilename ) ::Depth-- - FWrite( ::nHandle, Replicate( Chr(9), ::Depth ) + [
] + HB_OSNewLine() ) + FWrite( ::nHandle, Replicate( Chr(9), ::Depth ) + [
] + hb_eol() ) RETURN self METHOD AddIndex( oEntry ) CLASS GenerateXML @@ -114,19 +114,19 @@ METHOD AddEntry( oEntry ) CLASS GenerateXML IF self:IsIndex() self:AddIndex( oEntry ) ELSE - FWrite( ::nHandle, '' + HB_OSNewLine() ) + FWrite( ::nHandle, '' + hb_eol() ) ::Depth++ FOR idx := 1 TO Len( oEntry:Fields ) ::WriteEntry( oEntry:Fields[ idx ][ 1 ], oEntry:&( oEntry:Fields[ idx ][ 1 ] ), oEntry:IsPreformatted( oEntry:Fields[ idx ][ 1 ] ) ) NEXT ::Depth-- - FWrite( ::nHandle, '' + HB_OSNewLine() ) + FWrite( ::nHandle, '' + hb_eol() ) ENDIF RETURN self METHOD Generate() CLASS GenerateXML - FWrite( ::nHandle, '' + HB_OSNewLine() ) + FWrite( ::nHandle, '' + hb_eol() ) IF ::IsIndex() ENDIF @@ -143,13 +143,15 @@ METHOD PROCEDURE WriteEntry( cCaption, cEntry, lPreformatted ) CLASS GenerateXML LOCAL idx IF ! Empty( cEntry ) - cResult := IIf( HB_OSNewLine() $ cEntry, HB_OSNewLine() + cEntry, cEntry ) + cResult := iif( hb_eol() $ cEntry, hb_eol() + cEntry, cEntry ) FOR idx := 1 TO Len( p_aConversionList ) STEP 2 cResult := StrTran( cResult, Chr( p_aConversionList[ idx ] ), "&" + p_aConversionList[ idx + 1 ] + ";" ) NEXT cEntry := cResult - FWrite( ::nHandle, Replicate( Chr(9), ::Depth ) + "<" + cCaption + IIf( lPreformatted, ' preformatted="yes"', "") + ">" ) + FWrite( ::nHandle, Replicate( Chr(9), ::Depth ) + "<" + cCaption + iif( lPreformatted, ' preformatted="yes"', "") + ">" ) FWrite( ::nHandle, cEntry ) - FWrite( ::nHandle, /* Replicate( Chr(9), ::Depth ) + */ "" + HB_OSNewLine() ) + FWrite( ::nHandle, /* Replicate( Chr(9), ::Depth ) + */ "" + hb_eol() ) ENDIF + + RETURN diff --git a/harbour/contrib/hbdoc2/hbdoc2.ch b/harbour/contrib/hbdoc2/hbdoc2.ch index 230d529e8c..e3cea57c06 100644 --- a/harbour/contrib/hbdoc2/hbdoc2.ch +++ b/harbour/contrib/hbdoc2/hbdoc2.ch @@ -54,14 +54,9 @@ */ #ifndef HBDOC2_CH_ - #define HBDOC2_CH_ -#xcommand DEFAULT

TO => IF

== NIL ;

:= ; ENDIF -#xtranslate IfNIL( , ) => IIf( == NIL, , ) - MEMVAR p_aCategories -MEMVAR p_aNonConformingSources MEMVAR p_hsSwitches MEMVAR p_aCompliance MEMVAR p_aPlatforms diff --git a/harbour/contrib/hbdoc2/hbdoc2.prg b/harbour/contrib/hbdoc2/hbdoc2.prg index 9f19248ac2..78dca5bc61 100644 --- a/harbour/contrib/hbdoc2/hbdoc2.prg +++ b/harbour/contrib/hbdoc2/hbdoc2.prg @@ -55,12 +55,6 @@ * */ -/* note to self (from howtosvn.txt) -Run these commands and commit: -svn propset svn:keywords "Author Date Id Revision" "filename" -svn propset svn:eol-style native "filename" -*/ - /* todo @@ -102,6 +96,7 @@ done - build a list of 'categories' and validate against; see what 'classdoc' us done - validate sources against these templates */ +#include "common.ch" #include "directry.ch" #include "fileio.ch" #include "simpleio.ch" @@ -124,7 +119,7 @@ PROCEDURE Main( ... ) LOCAL oDocument, oIndex LOCAL aContent - PUBLIC p_aNonConformingSources := {} + init_Templates() PUBLIC p_hsSwitches := HB_Hash( ; /* configuration settings, values, etc */ ; @@ -173,7 +168,7 @@ PROCEDURE Main( ... ) ENDIF DO CASE - CASE cArgName == "-source" ; p_hsSwitches[ "basedir" ] := arg + IIf(SubStr(arg, -1, 1) == hb_ps(), "", hb_ps()) + CASE cArgName == "-source" ; p_hsSwitches[ "basedir" ] := arg + iif(SubStr(arg, -1, 1) == hb_ps(), "", hb_ps()) CASE cArgName == "-format" IF arg == "" .OR. HB_AScan( p_hsSwitches[ "format-list" ], arg, , , .T. ) == 0 ShowHelp( "Unknown format option '" + arg + "'" ) @@ -198,7 +193,7 @@ PROCEDURE Main( ... ) AAdd( p_hsSwitches[ "format" ], SubStr( cArgName, 2 ) ) ENDIF ELSE - ShowHelp( "Unknown option:" + cArgName + IIf( Len(arg) > 0, "=" + arg, "") ) + ShowHelp( "Unknown option:" + cArgName + iif( Len(arg) > 0, "=" + arg, "") ) RETURN ENDIF ENDCASE @@ -207,7 +202,7 @@ PROCEDURE Main( ... ) // load hbextern.ch FileEval( p_hsSwitches[ "basedir" ] + "include" + hb_ps() + "hbextern.ch", ; - {|c| IIf( SubStr( c, 1, Len( "EXTERNAL " ) ) == "EXTERNAL ", ; + {|c| iif( SubStr( c, 1, Len( "EXTERNAL " ) ) == "EXTERNAL ", ; AAdd( p_hsSwitches[ "hbextern.ch" ], SubStr( c, Len( "EXTERNAL " ) + 1 ) ), ; ) } ) ASort( p_hsSwitches[ "hbextern.ch" ] ) @@ -217,10 +212,10 @@ PROCEDURE Main( ... ) {; p_hsSwitches[ "basedir" ] + "doc", ; p_hsSwitches[ "basedir" ] + "doc" + hb_ps() + "en", ; - IIf( p_hsSwitches[ "source" ], p_hsSwitches[ "basedir" ] + "source", NIL ), ; - IIf( p_hsSwitches[ "contribs" ], p_hsSwitches[ "basedir" ] + "contrib", NIL ), ; + iif( p_hsSwitches[ "source" ], p_hsSwitches[ "basedir" ] + "source", NIL ), ; + iif( p_hsSwitches[ "contribs" ], p_hsSwitches[ "basedir" ] + "contrib", NIL ), ; }, ; - {|c| IIf( ! Empty( c ), ProcessFolder( c, @aContent ), ) } ) + {|c| iif( ! Empty( c ), ProcessFolder( c, @aContent ), ) } ) ? HB_NTOS( Len( aContent ) ) + " items found" ? @@ -379,11 +374,6 @@ PROCEDURE Main( ... ) ENDIF NEXT - IF Len( p_aNonConformingSources ) > 0 - ? "Non-conforming sources:" - AEval( p_aNonConformingSources, {|a| qout( a[ 1 ] + ":" + HB_NTOS( a[ 3 ] ) + ": " + a[ 2 ] ) } ) - ENDIF - ? RETURN @@ -430,14 +420,6 @@ STATIC FUNCTION ProcessFile( cFile, aContent ) LOCAL o LOCAL nOldContentLen := Len( aContent ) -// debug code to keep output small -//~ if ! "dir.txt" $ LOWER(cFile) -//~ if ! "subcodes.txt" $ LOWER(cFile) -//~ if ! "command.txt" $ LOWER(cFile) -//~ if ! "rddmisc.txt" $ LOWER(cFile) -//~ return .t. -//~ endif - IF ( aHandle[ 1 ] := FOpen( cFile ) ) < 0 ? "error: could not open " + cFile + ", " + HB_NTOS( Abs( aHandle[ 1 ] ) ) RETURN .F. @@ -492,7 +474,6 @@ STATIC PROCEDURE ProcessBlock( aHandle, aContent, cFile, cType, cVersion, o ) o:Name := "?NAME?" DO WHILE FReadSection( aHandle, @cSectionName, @cSection, @o ) - //~ idx := HB_HPos( hsTemplate, cSectionName ) DO CASE CASE cSectionName == "TEMPLATE" @@ -504,11 +485,6 @@ STATIC PROCEDURE ProcessBlock( aHandle, aContent, cFile, cType, cVersion, o ) EXIT ENDIF -/* CASE hsTemplate == NIL - -? "should not be here" - //? - */ OTHERWISE IF Len( cSectionName ) == 0 @@ -533,7 +509,7 @@ STATIC PROCEDURE ProcessBlock( aHandle, aContent, cFile, cType, cVersion, o ) CASE cSectionName == "CATEGORY" - IF ( idxCategory := HB_AScan( p_aCategories, {|c| ! Empty( c ) .AND. ( IIf( ValType( c ) == "C", LOWER( c ) == LOWER( cSection ), LOWER( c[ 1 ] ) == LOWER( cSection ) ) ) } ) ) == 0 + IF ( idxCategory := HB_AScan( p_aCategories, {|c| ! Empty( c ) .AND. ( iif( ValType( c ) == "C", LOWER( c ) == LOWER( cSection ), LOWER( c[ 1 ] ) == LOWER( cSection ) ) ) } ) ) == 0 AddErrorCondition( cFile, "Unknown CATEGORY '" + cSection + "' for template '" + o:Template, aHandle[ 2 ] ) lAccepted := .F. ENDIF @@ -545,18 +521,13 @@ STATIC PROCEDURE ProcessBlock( aHandle, aContent, cFile, cType, cVersion, o ) AddErrorCondition( cFile, "SUBCATEGORY '" + cSection + "' defined before CATEGORY", aHandle[ 2 ] ) lAccepted := .F. - ELSEIF ( idxSubCategory := HB_AScan( p_aCategories[ idxCategory ][ 2 ], {|c| ! ( c == NIL ) .AND. ( IIf( ValType( c ) == "C", LOWER( c ) == LOWER( cSection ), LOWER( c[ 1 ] ) == LOWER( cSection ) ) ) } ) ) == 0 + ELSEIF ( idxSubCategory := HB_AScan( p_aCategories[ idxCategory ][ 2 ], {|c| ! ( c == NIL ) .AND. ( iif( ValType( c ) == "C", LOWER( c ) == LOWER( cSection ), LOWER( c[ 1 ] ) == LOWER( cSection ) ) ) } ) ) == 0 AddErrorCondition( cFile, "Unknown SUBCATEGORY '" + p_aCategories[ idxCategory ][ 1 ] + "-" + cSection, aHandle[ 2 ] ) lAccepted := .F. ENDIF - //~ CASE cSectionName == "RETURNS" .AND. ! o:IsField( "RETURNS" ) - - //~ AddErrorCondition( cFile, "'" + o:Name + "' is identified as template " + o:Template + " but has no RETURNS field", aHandle[ 2 ] ) - //~ lAccepted := .F. - CASE o:IsField( "RETURNS" ) .AND. cSectionName == "RETURNS" .AND. ( ; Empty( cSection ) .OR. ; LOWER( cSection ) == "nil" .OR. ; @@ -568,9 +539,9 @@ STATIC PROCEDURE ProcessBlock( aHandle, aContent, cFile, cType, cVersion, o ) CASE ! o:IsConstraint( cSectionName, cSection ) - cSource := cSectionName + " is '" + IIf( Len( cSection ) <= 20, cSection, SubStr( StrTran( cSection, HB_OSNewLine() ), 1, 20 ) + "..." ) + "', should be one of: " + cSource := cSectionName + " is '" + iif( Len( cSection ) <= 20, cSection, SubStr( StrTran( cSection, hb_eol() ), 1, 20 ) + "..." ) + "', should be one of: " //~ cSource := HB_HKeyAt( hsTemplate, idx ) + " should be one of: " - AEval( &( "p_a" + cSectionName ), {|c,n| cSource += IIf( n == 1, "", "," ) + c } ) + AEval( &( "p_a" + cSectionName ), {|c,n| cSource += iif( n == 1, "", "," ) + c } ) AddErrorCondition( cFile, cSource, aHandle[ 2 ] - 1 ) OTHERWISE @@ -629,7 +600,7 @@ STATIC PROCEDURE ProcessBlock( aHandle, aContent, cFile, cType, cVersion, o ) ENDIF IF p_hsSwitches[ "include-doc-source" ] - o:Files += HB_OSNewLine() + o:sourcefile_ + IIf( p_hsSwitches[ "include-doc-version" ], " (" + o:sourcefileversion_ + ")", "" ) + o:Files += hb_eol() + o:sourcefile_ + iif( p_hsSwitches[ "include-doc-version" ], " (" + o:sourcefileversion_ + ")", "" ) ENDIF o:filename := Filename( o:Name ) @@ -643,34 +614,6 @@ STATIC PROCEDURE ProcessBlock( aHandle, aContent, cFile, cType, cVersion, o ) ENDIF ENDIF -//~ if 1 <= idxCategory .and. idxCategory < Len( p_aCategories ) - - //~ ? "matching category", idxCategory, Len( p_aCategories ), idxSubCategory - //~ if 1 <= idxSubCategory .and. idxSubCategory <= len( p_aCategories[ idxCategory ][ 3 ] ) - - //~ ? "matching category and subcategory", idxCategory, Len( p_aCategories ), idxSubCategory, len( p_aCategories[ idxCategory ][ 3 ] ) - //~ ? - - //~ else - - //~ ? "matching category, not matching subcategory", idxCategory, Len( p_aCategories ), idxSubCategory - //~ ? - - //~ endif - -//~ else - - //~ ? "not matching category", idxCategory - //~ ? - -//~ endif - -//~ if idxCategory < 1 .or. idxCategory > len( p_aCategories ) - //~ AddErrorCondition( cFile, "'" + o:Name + "' of " + o:Template + " has bad idxCategory " + HB_NTOS( idxCategory ), aHandle[ 2 ] ) -//~ elseif idxSubCategory < 1 .or. idxSubCategory > len( p_aCategories[ idxCategory ][ 3 ] ) -//~ ? idxCategory, idxSubCategory, len( p_aCategories[ idxCategory ][ 3 ] ) - //~ AddErrorCondition( cFile, "'" + o:Name + "' of " + o:Template + "." + o:Category + " has bad idxSubCategory " + HB_NTOS( idxSubCategory ), aHandle[ 2 ] ) -//~ endif IF ValType( p_aCategories[ idxCategory ][ 3 ][ idxSubCategory ] ) != "A" p_aCategories[ idxCategory ][ 3 ][ idxSubCategory ] := {} ENDIF @@ -707,32 +650,32 @@ STATIC FUNCTION FReadSection( aHandle, cSectionName, cSection, o ) aHandle[ 2 ]-- // decrement the line number when rewinding the file Exit ELSEIF Len( AllTrim( cBuffer ) ) == 0 - IF SubStr( cSection, -Len( HB_OSNewLine() ) ) != HB_OSNewLine() - cSection += HB_OSNewLine() + IF SubStr( cSection, -Len( hb_eol() ) ) != hb_eol() + cSection += hb_eol() ENDIF nLastIndent := -1 ELSEIF AllTrim( cBuffer ) == "" - IF SubStr( cSection, -Len( HB_OSNewLine() ) ) != HB_OSNewLine() .OR. lPreformatted - cSection += HB_OSNewLine() + IF SubStr( cSection, -Len( hb_eol() ) ) != hb_eol() .OR. lPreformatted + cSection += hb_eol() ENDIF - cSection += "
" //+ HB_OSNewLine() + cSection += "
" //+ hb_eol() lLastPreformatted := lPreformatted lPreformatted := .T. ELSEIF AllTrim( cBuffer ) == "
" - IF SubStr( cSection, -Len( HB_OSNewLine() ) ) != HB_OSNewLine() .OR. lPreformatted - cSection += HB_OSNewLine() + IF SubStr( cSection, -Len( hb_eol() ) ) != hb_eol() .OR. lPreformatted + cSection += hb_eol() ENDIF - cSection += "" + HB_OSNewLine() + cSection += "" + hb_eol() lPreformatted := lLastPreformatted ELSEIF nLastIndent != ( Len( cBuffer ) - Len( LTrim( cBuffer ) ) ) .OR. lPreformatted .OR. SubStr( cBuffer, -Len( "" ) ) == "" IF SubStr( cBuffer, -Len( "" ) ) == "" cBuffer := SubStr( cBuffer, 1, Len( cBuffer ) - Len( "" ) ) ENDIF nLastIndent := ( Len( cBuffer ) - Len( LTrim( cBuffer ) ) ) - IF SubStr( cSection, -Len( HB_OSNewLine() ) ) != HB_OSNewLine() - cSection += HB_OSNewLine() + IF SubStr( cSection, -Len( hb_eol() ) ) != hb_eol() + cSection += hb_eol() ENDIF - cSection += IIf( lPreformatted, cBuffer, AllTrim( cBuffer ) ) + cSection += iif( lPreformatted, cBuffer, AllTrim( cBuffer ) ) ELSE cSection += " " + AllTrim( cBuffer ) ENDIF @@ -744,18 +687,18 @@ STATIC FUNCTION FReadSection( aHandle, cSectionName, cSection, o ) RETURN .F. ENDIF - DO WHILE SubStr( cSection, 1, Len( HB_OSNewLine() ) ) == HB_OSNewLine() - cSection := SubStr( cSection, Len( HB_OSNewLine() ) + 1 ) + DO WHILE SubStr( cSection, 1, Len( hb_eol() ) ) == hb_eol() + cSection := SubStr( cSection, Len( hb_eol() ) + 1 ) ENDDO - DO WHILE SubStr( cSection, -Len( HB_OSNewLine() ) ) == HB_OSNewLine() - cSection := SubStr( cSection, 1, Len( cSection ) - Len( HB_OSNewLine() ) ) + DO WHILE SubStr( cSection, -Len( hb_eol() ) ) == hb_eol() + cSection := SubStr( cSection, 1, Len( cSection ) - Len( hb_eol() ) ) ENDDO IF lPreformatted .AND. LOWER( SubStr( cSection, -Len( "" ) ) ) == "" cSection := SubStr( cSection, 1, Len( cSection ) - Len( "" ) ) - DO WHILE SubStr( cSection, -Len( HB_OSNewLine() ) ) == HB_OSNewLine() - cSection := SubStr( cSection, 1, Len( cSection ) - Len( HB_OSNewLine() ) ) + DO WHILE SubStr( cSection, -Len( hb_eol() ) ) == hb_eol() + cSection := SubStr( cSection, 1, Len( cSection ) - Len( hb_eol() ) ) ENDDO ENDIF @@ -769,31 +712,22 @@ STATIC PROCEDURE FileEval( acFile, bBlock, nMaxLine ) DEFAULT nMaxLine TO 256 - IF ValType( acFile ) == "C" + IF ISCHARACTER( acFile ) lCloseFile := .T. IF ( aHandle[ 1 ] := FOpen( acFile ) ) < 0 RETURN ENDIF - ELSEIF ValType( acFile ) == "N" + ELSEIF ISNUMBER( acFile ) aHandle[ 1 ] := acFile ELSE aHandle := acFile ENDIF - //~ FSeek( nHandle, 0 ) - DO WHILE FReadLn( @aHandle, @cBuffer, nMaxLine ) - //~ IF SubStr( LTrim( cBuffer ), 1, 2 ) == "/*" - //~ FSeek( nHandle, -( Len( cBuffer ) - 2 ), FS_RELATIVE ) - //~ IF ! FReadUntil( nHandle, "*/" ) - //~ EXIT - //~ ENDIF - //~ ELSE - xResult := Eval( bBlock, cBuffer ) - IF xResult != NIL .AND. ValType( xResult ) == "L" .AND. ! xResult - EXIT - ENDIF - //~ ENDIF + xResult := Eval( bBlock, cBuffer ) + IF xResult != NIL .AND. ISLOGICAL( ValType( xResult ) ) .AND. ! xResult + EXIT + ENDIF ENDDO IF lCloseFile @@ -828,7 +762,7 @@ STATIC FUNCTION FReadUntil( aHandle, cMatch, cResult ) RETURN nNumRead != 0 STATIC FUNCTION FReadLn( aHandle, cBuffer, nMaxLine ) -STATIC s_aEOL := { chr(13) + chr(10), chr(10), chr(13) } + STATIC s_aEOL := { chr(13) + chr(10), chr(10), chr(13) } LOCAL cLine, nSavePos, nEol, nNumRead, nLenEol, idx DEFAULT nMaxLine TO 256 @@ -875,9 +809,9 @@ FUNCTION Decode( cType, hsBlock, cKey ) IF "," $ cCode .AND. HB_AScan( p_aStatus, Parse( ( cCode ), "," ) ) > 0 cResult := "" DO WHILE LEN( cCode ) > 0 - cResult += HB_OSNewLine() + Decode( cType, hsBlock, Parse( @cCode, "," ) ) + cResult += hb_eol() + Decode( cType, hsBlock, Parse( @cCode, "," ) ) ENDDO - RETURN SubStr( cResult, LEN( HB_OSNewLine() ) + 1 ) + RETURN SubStr( cResult, LEN( hb_eol() ) + 1 ) ENDIF IF ( idx := HB_AScan( p_aStatus, {|a| a[1] == cCode } ) ) > 0 @@ -894,9 +828,9 @@ FUNCTION Decode( cType, hsBlock, cKey ) IF "," $ cCode .AND. HB_AScan( p_aPlatforms, Parse( ( cCode ), "," ) ) > 0 cResult := "" DO WHILE LEN( cCode ) > 0 - cResult += HB_OSNewLine() + Decode( cType, hsBlock, Parse( @cCode, "," ) ) + cResult += hb_eol() + Decode( cType, hsBlock, Parse( @cCode, "," ) ) ENDDO - RETURN SubStr( cResult, LEN( HB_OSNewLine() ) + 1 ) + RETURN SubStr( cResult, LEN( hb_eol() ) + 1 ) ENDIF IF ( idx := HB_AScan( p_aPlatforms, {|a| a[1] == cCode } ) ) > 0 @@ -909,9 +843,9 @@ FUNCTION Decode( cType, hsBlock, cKey ) IF "," $ cCode .AND. HB_AScan( p_aCompliance, Parse( ( cCode ), "," ) ) > 0 cResult := "" DO WHILE LEN( cCode ) > 0 - cResult += HB_OSNewLine() + Decode( cType, hsBlock, Parse( @cCode, "," ) ) + cResult += hb_eol() + Decode( cType, hsBlock, Parse( @cCode, "," ) ) ENDDO - RETURN SubStr( cResult, LEN( HB_OSNewLine() ) + 1 ) + RETURN SubStr( cResult, LEN( hb_eol() ) + 1 ) ENDIF IF ( idx := HB_AScan( p_aCompliance, {|a| a[1] == cCode } ) ) > 0 @@ -972,23 +906,23 @@ PROCEDURE ShowSubHelp( xLine, nMode, nIndent, n ) IF xLine != NIL DO CASE - CASE ValType( xLine ) == "N" + CASE ISNUMBER( xLine ) nMode := xLine - CASE ValType( xLine ) == "B" + CASE ISBLOCK( xLine ) Eval( xLine ) - CASE ValType( xLine ) == "A" + CASE ISARRAY( xLine ) IF nMode == 2 OutStd( cIndent + Space( 2 ) ) ENDIF AEval( xLine, {|x,n| ShowSubHelp( x, @nMode, nIndent + 2, n ) } ) IF nMode == 2 - OutStd( HB_OSNewLine() ) + OutStd( hb_eol() ) ENDIF OTHERWISE DO CASE - CASE nMode == 1 ; OutStd( cIndent + xLine ) ; OutStd( HB_OSNewLine() ) - CASE nMode == 2 ; OutStd( IIf( n > 1, ", ", "") + xLine ) - OTHERWISE ; OutStd( "(" + HB_NTOS( nMode ) + ") " ) ; OutStd( xLine ) ; OutStd( HB_OSNewLine() ) + CASE nMode == 1 ; OutStd( cIndent + xLine ) ; OutStd( hb_eol() ) + CASE nMode == 2 ; OutStd( iif( n > 1, ", ", "") + xLine ) + OTHERWISE ; OutStd( "(" + HB_NTOS( nMode ) + ") " ) ; OutStd( xLine ) ; OutStd( hb_eol() ) ENDCASE ENDCASE ENDIF @@ -1001,9 +935,9 @@ STATIC FUNCTION HBRawVersion() PROCEDURE ShowHelp( cExtraMessage, aArgs ) LOCAL nMode := 1 -#define OnOrOff(b) IIf( b, "excluded", "included" ) -#define YesOrNo(b) IIf( b, "yes", "no" ) -#define IsDefault(b) IIf( b, "; default", "" ) +#define OnOrOff(b) iif( b, "excluded", "included" ) +#define YesOrNo(b) iif( b, "yes", "no" ) +#define IsDefault(b) iif( b, "; default", "" ) LOCAL aHelp @@ -1046,9 +980,9 @@ PROCEDURE ShowHelp( cExtraMessage, aArgs ) CASE aArgs[ 2 ] == "Templates" aHelp := { ; - IIf( Len( aArgs ) >= 3, aArgs[ 3 ] + " template is:", "Defined templates are:" ), ; + iif( Len( aArgs ) >= 3, aArgs[ 3 ] + " template is:", "Defined templates are:" ), ; "", ; - {|| ShowTemplatesHelp( IIf( Len( aArgs ) >= 3, aArgs[ 3 ], NIL ) ) } ; + {|| ShowTemplatesHelp( iif( Len( aArgs ) >= 3, aArgs[ 3 ], NIL ) ) } ; } CASE aArgs[ 2 ] == "Compliance" @@ -1112,17 +1046,13 @@ FUNCTION Split(cVar, xDelimiter) FUNCTION Join(aVar, cDelimiter) LOCAL cResult := "" - AEval( aVar, {|c,n| cResult += IIf( n > 1, cDelimiter, "" ) + c } ) + AEval( aVar, {|c,n| cResult += iif( n > 1, cDelimiter, "" ) + c } ) RETURN cResult STATIC PROCEDURE AddErrorCondition( cFile, cMessage, nLine ) - If HB_AScan( p_aNonConformingSources, {|a| a[ 1 ] == cFile .AND. a[ 2 ] == cMessage .AND. a[ 3 ] == nLine } ) == 0 - IF p_hsSwitches[ "immediate-errors" ] - qout( cFile + ":" + HB_NTOS( nLine ) + ": " + cMessage ) - ELSE - AAdd( p_aNonConformingSources, { cFile, cMessage, nLine } ) - ENDIF + IF p_hsSwitches[ "immediate-errors" ] + qout( cFile + ":" + HB_NTOS( nLine ) + ": " + cMessage ) ENDIF RETURN @@ -1135,22 +1065,22 @@ FUNCTION Indent( cText, nLeftMargin, nWidth, lRaw ) DEFAULT lRaw TO .F. IF nWidth == 0 .or. lRaw - aText := Split( cText, HB_OSNewLine() ) + aText := Split( cText, hb_eol() ) idx := 99999 - AEval( aText, {|c| IIf( Empty(c), , idx := Min( idx, Len( c ) - Len( LTrim( c ) ) ) ) } ) + AEval( aText, {|c| iif( Empty(c), , idx := Min( idx, Len( c ) - Len( LTrim( c ) ) ) ) } ) AEval( aText, {|c,n| aText[ n ] := Space( nLeftMargin ) + SubStr( c, idx + 1 ) } ) - cResult := Join( aText, HB_OSNewLine() ) + HB_OSNewLine() + HB_OSNewLine() + cResult := Join( aText, hb_eol() ) + hb_eol() + hb_eol() ELSE DO WHILE Len( cText ) > 0 - cLine := Parse( @cText, HB_OSNewLine() ) + cLine := Parse( @cText, hb_eol() ) IF cLine == "" lRaw := .T. ELSEIF cLine == "
" - cResult += HB_OSNewLine() + cResult += hb_eol() lRaw := .F. ELSEIF lRaw - cResult += Space( nLeftMargin ) + LTrim( cLine ) + HB_OSNewLine() + cResult += Space( nLeftMargin ) + LTrim( cLine ) + hb_eol() ELSE DO WHILE Len( cLine ) > nWidth idx := nWidth + 1 @@ -1189,15 +1119,15 @@ FUNCTION Indent( cText, nLeftMargin, nWidth, lRaw ) idx := nWidth ENDIF - cResult += Space( nLeftMargin ) + SubStr( cLine, 1, idx - IIf( SubStr( cLine, idx, 1 ) == " ", 1, 0 ) ) + HB_OSNewLine() + cResult += Space( nLeftMargin ) + SubStr( cLine, 1, idx - iif( SubStr( cLine, idx, 1 ) == " ", 1, 0 ) ) + hb_eol() cLine := LTrim( SubStr( cLine, idx + 1 ) ) ENDDO IF Len( cLine ) > 0 - cResult += Space( nLeftMargin ) + cLine + HB_OSNewLine() + cResult += Space( nLeftMargin ) + cLine + hb_eol() ENDIF - cResult += HB_OSNewLine() + cResult += hb_eol() ENDIF ENDDO ENDIF diff --git a/harbour/contrib/hbdoc2/tmplates.prg b/harbour/contrib/hbdoc2/tmplates.prg index 6d7bfc7836..042226380a 100644 --- a/harbour/contrib/hbdoc2/tmplates.prg +++ b/harbour/contrib/hbdoc2/tmplates.prg @@ -55,18 +55,6 @@ #include "hbdoc2.ch" -/* -#xcommand TEXT TO VAR => #pragma __stream|:=%s -#xcommand TEXT INTO => #pragma __text|+=%s+HB_OSNewLine();:="" - -text into p_hsTemplates -this is line 1 -this is line 2 -endtext -? asc(substr(p_hsTemplates, -2)) -? -*/ - #include "hbclass.ch" /* a class that will hold one entry */ @@ -190,7 +178,7 @@ METHOD SetTemplate( cTemplate ) CLASS Entry IF self:Fields[ idx ][ 1 ] == "TEMPLATE" aData[ idx ] := { self:Fields[ idx ][ 1 ], cTemplate } ELSE - aData[ idx ] := { self:Fields[ idx ][ 1 ], IIf( self:Group[ idx ] == TPL_REQUIRED, NIL, "" ) } + aData[ idx ] := { self:Fields[ idx ][ 1 ], iif( self:Group[ idx ] == TPL_REQUIRED, NIL, "" ) } ENDIF NEXT __ObjSetValueList( self, aData ) @@ -250,7 +238,7 @@ METHOD SubcategoryIndex( cCategory, cSubcategory ) CLASS Entry RETURN HB_AScan( p_aCategories[ ::CategoryIndex( cCategory ) ][ 2 ], cSubcategory, , , .T. ) //~ RETURN HB_AScan( p_aCategories[ ::CategoryIndex( cCategory ) ][ 2 ], {|c| c == cSubcategory } ) -INIT PROCEDURE Templates() +PROCEDURE init_Templates() LOCAL idx LOCAL aSubCategories := { ; "Application", ; @@ -333,7 +321,7 @@ INIT PROCEDURE Templates() { "All", "This is available on all platforms" }, ; { "All(64K)", "This is available on all platforms though some platforms have a string length limit of 64KB" }, ; { "All(GT)", "This part of the GT API and supported only by some platforms." }, ; - { "All(LFN)", "This is available on all platforms." + HB_OSNewLine() + ; + { "All(LFN)", "This is available on all platforms." + hb_eol() + ; "If long file names are available Harbour will use/display the first 15 characters " +; "else Harbour will use/display a 8.3 file name consistent with CA-Cl*pper" }, ; { "Linux(GT)", "Under Linux the number of columns avaliable depends of the current Terminal screen size." }, ; @@ -525,11 +513,11 @@ PROCEDURE ShowTemplatesHelp( cTemplate ) FOR idx := 1 TO Len( o:Fields ) IF o:Group[ idx ] != 0 - ShowSubHelp( IIf( idx == 1, "/", " " ) + "* " + cDelimiter + o:Fields[ idx ][ 1 ] + cDelimiter, 1, 0 ) + ShowSubHelp( iif( idx == 1, "/", " " ) + "* " + cDelimiter + o:Fields[ idx ][ 1 ] + cDelimiter, 1, 0 ) IF o:Fields[ idx ][ 1 ] == "TEMPLATE" ShowSubHelp( " * " + o:Template, 1, 0 ) ELSEIF o:Group[ idx ] != TPL_START .AND. o:Group[ idx ] != TPL_END .AND. .T. - ShowSubHelp( " * " + IIf( o:IsRequired( o:Fields[ idx ][ 1 ] ), "", "" ), 1, 0 ) + ShowSubHelp( " * " + iif( o:IsRequired( o:Fields[ idx ][ 1 ] ), "", "" ), 1, 0 ) ENDIF ENDIF NEXT diff --git a/harbour/contrib/hbfbird/hbfbird.hbi b/harbour/contrib/hbfbird/hbfbird.hbi index d8e02571b9..be5fd11292 100644 --- a/harbour/contrib/hbfbird/hbfbird.hbi +++ b/harbour/contrib/hbfbird/hbfbird.hbi @@ -4,6 +4,8 @@ -hbimplib +-stop{!HB_WITH_FIREBIRD} + -ofbclient {!(allgcc|allmsvc|allpocc)}${HB_WITH_FIREBIRD}/../bin/fbclient.dll diff --git a/harbour/contrib/hbfimage/hbfimage.hbi b/harbour/contrib/hbfimage/hbfimage.hbi index f76c254280..aeb4391bc6 100644 --- a/harbour/contrib/hbfimage/hbfimage.hbi +++ b/harbour/contrib/hbfimage/hbfimage.hbi @@ -4,4 +4,6 @@ -hbimplib +-stop{!HB_WITH_FREEIMAGE} + ${HB_WITH_FREEIMAGE}/../Dist/FreeImage.dll diff --git a/harbour/contrib/hbgd/hbgd.hbi b/harbour/contrib/hbgd/hbgd.hbi index e8568a7434..4ba680a4d6 100644 --- a/harbour/contrib/hbgd/hbgd.hbi +++ b/harbour/contrib/hbgd/hbgd.hbi @@ -4,4 +4,6 @@ -hbimplib +-stop{!HB_WITH_GD} + ${HB_WITH_GD}/../bin/bgd.dll diff --git a/harbour/contrib/hbhpdf/hbhpdf.hbi b/harbour/contrib/hbhpdf/hbhpdf.hbi index 9a3ac83ba3..41ebac5cb9 100644 --- a/harbour/contrib/hbhpdf/hbhpdf.hbi +++ b/harbour/contrib/hbhpdf/hbhpdf.hbi @@ -4,5 +4,7 @@ -hbimplib +-stop{!HB_WITH_LIBHARU} + ${HB_WITH_LIBHARU}/../libhpdf.dll ${HB_WITH_LIBHARU}/../lib_dll/libhpdf.dll diff --git a/harbour/contrib/hbmysql/hbmysql.hbi b/harbour/contrib/hbmysql/hbmysql.hbi index f2e6058ac3..0d420a6f8c 100644 --- a/harbour/contrib/hbmysql/hbmysql.hbi +++ b/harbour/contrib/hbmysql/hbmysql.hbi @@ -4,4 +4,6 @@ -hbimplib +-stop{!HB_WITH_MYSQL} + ${HB_WITH_MYSQL}/../lib/opt/libmySQL.dll diff --git a/harbour/contrib/hbpgsql/hbpgsql.hbi b/harbour/contrib/hbpgsql/hbpgsql.hbi index 8ad29e3062..8aebe04ef2 100644 --- a/harbour/contrib/hbpgsql/hbpgsql.hbi +++ b/harbour/contrib/hbpgsql/hbpgsql.hbi @@ -4,6 +4,8 @@ -hbimplib +-stop{!HB_WITH_PGSQL} + ${HB_WITH_PGSQL}/../lib/libpq.dll -iflag={bcc}-a diff --git a/harbour/contrib/hbssl/hbssl.hbi b/harbour/contrib/hbssl/hbssl.hbi index 1576d69997..fc0ec8bdbb 100644 --- a/harbour/contrib/hbssl/hbssl.hbi +++ b/harbour/contrib/hbssl/hbssl.hbi @@ -4,6 +4,8 @@ -hbimplib +-stop{!HB_WITH_OPENSSL} + ${HB_WITH_OPENSSL}/../out32dll/libeay32.dll ${HB_WITH_OPENSSL}/../out32dll/ssleay32.dll ${HB_WITH_OPENSSL}/../dll/libeay32.dll diff --git a/harbour/contrib/make.hbs b/harbour/contrib/make.hbs index 36460d2b8e..4df6a0c4d8 100755 --- a/harbour/contrib/make.hbs +++ b/harbour/contrib/make.hbs @@ -555,6 +555,8 @@ STATIC FUNCTION call_hbmk2_dept( cBinDir, cProject, /* @ */ cType ) LOCAL tmp, tmp1 LOCAL aList := {} + cType := "" + hb_processRun( PathSepToSelf( cBinDir ) + "hbmk2 --hbinfo " + cProject,, @tmp ) IF ( tmp1 := At( "targettype{{", tmp ) ) > 0 diff --git a/harbour/contrib/rddads/rddads.hbi b/harbour/contrib/rddads/rddads.hbi index 448c295b07..91e4b686cf 100644 --- a/harbour/contrib/rddads/rddads.hbi +++ b/harbour/contrib/rddads/rddads.hbi @@ -4,6 +4,8 @@ -hbimplib +-stop{!HB_WITH_ADS} + ${HB_WITH_ADS}/Redistribute/ace32.dll ${HB_WITH_ADS}/ace32.dll ${HB_WITH_ADS}/32bit/ace32.dll diff --git a/harbour/contrib/sddfb/sddfb.hbi b/harbour/contrib/sddfb/sddfb.hbi index d8e02571b9..be5fd11292 100644 --- a/harbour/contrib/sddfb/sddfb.hbi +++ b/harbour/contrib/sddfb/sddfb.hbi @@ -4,6 +4,8 @@ -hbimplib +-stop{!HB_WITH_FIREBIRD} + -ofbclient {!(allgcc|allmsvc|allpocc)}${HB_WITH_FIREBIRD}/../bin/fbclient.dll diff --git a/harbour/contrib/sddmy/sddmy.hbi b/harbour/contrib/sddmy/sddmy.hbi index f2e6058ac3..0d420a6f8c 100644 --- a/harbour/contrib/sddmy/sddmy.hbi +++ b/harbour/contrib/sddmy/sddmy.hbi @@ -4,4 +4,6 @@ -hbimplib +-stop{!HB_WITH_MYSQL} + ${HB_WITH_MYSQL}/../lib/opt/libmySQL.dll diff --git a/harbour/contrib/sddoci/sddoci.hbi b/harbour/contrib/sddoci/sddoci.hbi index 20589752e9..b8f97020fe 100644 --- a/harbour/contrib/sddoci/sddoci.hbi +++ b/harbour/contrib/sddoci/sddoci.hbi @@ -4,6 +4,8 @@ -hbimplib +-stop{!HB_WITH_OCILIB} + ${HB_WITH_OCILIB}/../lib32/ociliba.dll ${HB_WITH_OCILIB}/../lib32/ocilibm.dll ${HB_WITH_OCILIB}/../lib32/ocilibw.dll diff --git a/harbour/contrib/sddpg/sddpg.hbi b/harbour/contrib/sddpg/sddpg.hbi index 8ad29e3062..8aebe04ef2 100644 --- a/harbour/contrib/sddpg/sddpg.hbi +++ b/harbour/contrib/sddpg/sddpg.hbi @@ -4,6 +4,8 @@ -hbimplib +-stop{!HB_WITH_PGSQL} + ${HB_WITH_PGSQL}/../lib/libpq.dll -iflag={bcc}-a diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 346d12079f..8e1a7e1a89 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -1697,7 +1697,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) CASE cParamL == "-hblib" ; hbmk[ _HBMK_lStopAfterHarbour ] := .F. ; lStopAfterCComp := .T. ; hbmk[ _HBMK_lCreateLib ] := .T. ; hbmk[ _HBMK_lCreateDyn ] := .F. CASE cParamL == "-hbdyn" ; hbmk[ _HBMK_lStopAfterHarbour ] := .F. ; lStopAfterCComp := .T. ; hbmk[ _HBMK_lCreateLib ] := .F. ; hbmk[ _HBMK_lCreateDyn ] := .T. ; hbmk[ _HBMK_lDynVM ] := .F. ; l_lNOHBLIB := .T. CASE cParamL == "-hbdynvm" ; hbmk[ _HBMK_lStopAfterHarbour ] := .F. ; lStopAfterCComp := .T. ; hbmk[ _HBMK_lCreateLib ] := .F. ; hbmk[ _HBMK_lCreateDyn ] := .T. ; hbmk[ _HBMK_lDynVM ] := .T. ; l_lNOHBLIB := .F. - CASE cParamL == "-hbimplib" ; lStopAfterInit := .T. ; hbmk[ _HBMK_lCreateImpLib ] := .T. ; lAcceptIFlag := .T. + CASE cParamL == "-hbimplib" ; hbmk[ _HBMK_lCreateImpLib ] := .T. ; lAcceptIFlag := .T. CASE cParamL == "-gui" .OR. ; cParamL == "-mwindows" ; hbmk[ _HBMK_lGUI ] := .T. /* Compatibility */ CASE cParamL == "-std" .OR. ; @@ -2430,7 +2430,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) ENDIF /* Start doing the make process. */ - IF ! lStopAfterInit .AND. ( Len( hbmk[ _HBMK_aPRG ] ) + Len( hbmk[ _HBMK_aC ] ) + Len( hbmk[ _HBMK_aCPP ] ) + Len( hbmk[ _HBMK_aOBJUSER ] ) + Len( l_aOBJA ) ) == 0 + IF ! lStopAfterInit .AND. ! hbmk[ _HBMK_lCreateImpLib ] .AND. ( Len( hbmk[ _HBMK_aPRG ] ) + Len( hbmk[ _HBMK_aC ] ) + Len( hbmk[ _HBMK_aCPP ] ) + Len( hbmk[ _HBMK_aOBJUSER ] ) + Len( l_aOBJA ) ) == 0 hbmk_OutErr( hbmk, I_( "Error: No source files were specified." ) ) IF hbmk[ _HBMK_lBEEP ] DoBeep( .F. ) @@ -2439,7 +2439,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) ENDIF /* Decide about output name */ - IF ! lStopAfterInit + IF ! lStopAfterInit .AND. ! hbmk[ _HBMK_lCreateImpLib ] /* If -o with full name wasn't specified, let's make it the first source file specified. */ @@ -2453,7 +2453,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) ENDIF /* Decide about working dir */ - IF ! lStopAfterInit + IF ! lStopAfterInit .AND. ! hbmk[ _HBMK_lCreateImpLib ] IF hbmk[ _HBMK_lINC ] /* NOTE: We store -hbdyn objects in different dirs by default as - for Windows platforms - they're always built using different compilation options @@ -2500,7 +2500,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) ENDIF ENDIF - IF ! lStopAfterInit .AND. ! hbmk[ _HBMK_lStopAfterHarbour ] + IF ! lStopAfterInit .AND. ! hbmk[ _HBMK_lStopAfterHarbour ] .AND. ! hbmk[ _HBMK_lCreateImpLib ] /* /boot/common/include (beos) @@ -2526,7 +2526,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) NEXT ENDIF - IF ( ! lStopAfterInit .AND. ! hbmk[ _HBMK_lStopAfterHarbour ] ) .OR. hbmk[ _HBMK_lCreateImpLib ] + IF ! lStopAfterInit .AND. ! hbmk[ _HBMK_lStopAfterHarbour ] IF hbmk[ _HBMK_cGT ] != NIL .AND. hbmk[ _HBMK_cGT ] == hbmk[ _HBMK_cGTDEFAULT ] hbmk[ _HBMK_cGT ] := NIL @@ -3965,8 +3965,9 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) /* ; */ - IF hbmk[ _HBMK_lCreateImpLib ] + IF ! lStopAfterInit .AND. hbmk[ _HBMK_lCreateImpLib ] DoIMPLIB( hbmk, bBlk_ImpLib, cLibLibPrefix, cLibLibExt ) + lStopAfterInit := .T. ENDIF DEFAULT hbmk[ _HBMK_nScr_Esc ] TO hbmk[ _HBMK_nCmd_Esc ] @@ -4163,17 +4164,6 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) NEXT ENDIF - /* Check if we've found all dependencies */ - - IF ! lSkipBuild .AND. ! lStopAfterInit .AND. ! hbmk[ _HBMK_lStopAfterHarbour ] - IF ! dep_evaluate( hbmk ) - IF hbmk[ _HBMK_lBEEP ] - DoBeep( .F. ) - ENDIF - RETURN 10 - ENDIF - ENDIF - /* Dump hbmk2 build information */ IF lDumpInfo @@ -4189,6 +4179,17 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) RETURN 0 ENDIF + /* Check if we've found all dependencies */ + + IF ! lSkipBuild .AND. ! lStopAfterInit .AND. ! hbmk[ _HBMK_lStopAfterHarbour ] + IF ! dep_evaluate( hbmk ) + IF hbmk[ _HBMK_lBEEP ] + DoBeep( .F. ) + ENDIF + RETURN 10 + ENDIF + ENDIF + /* Harbour compilation */ IF ! lSkipBuild .AND. ! lStopAfterInit .AND. Len( l_aPRG_TODO ) > 0 .AND. ! hbmk[ _HBMK_lCLEAN ] .AND. hbmk[ _HBMK_nHBMODE ] != _HBMODE_RAW_C