diff --git a/harbour/ChangeLog.txt b/harbour/ChangeLog.txt index 42b6579b5a..d1c9e5259c 100644 --- a/harbour/ChangeLog.txt +++ b/harbour/ChangeLog.txt @@ -10,6 +10,102 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-02-26 14:41 UTC+0100 Viktor Szakats (harbour syenar.net) + * utils/hbmk2/hbmk2.*.po + * utils/hbmk2/hbmk2.prg + + do not share plugin variables (hbmk[ "vars" ]) + between different plugins. It avoids potentially nasty + issues with plugins stepping onto each other's toes. + [INCOMPATIBLE - though it's unlikely anyone is + affected. If you must communicate between plugins, + use public function or variable.] + + clarified in help that -icon might not work on all + platforms/compilers and detailed Windows implementation + (in particular it's disabled on bcc/bcc64 and on + mingw it won't work when a manual .rc is specified, + also on some (old?) msvc versions. Consult your + C compiler's Windows resource handling limitations.) + + clarified in help the syntax of filters + + clarified in help that .hbp references are handled as + sub-projects + + clarification to command substitution macro + + clarification to filter syntax note + ! strict parameter checks in all public shell APIs to + avoid RTEs inside hbmk2 due to faulty API usage by scripts + + * utils/hbmk2/examples/plug_bis.hb + * updated according to latest plugin changes + + * include/harbour.hbx + * include/hbapi.h + * src/vm/debug.c + * src/vm/hvm.c + + added internal function hb_vmInternalsEnabled() + to query whether potentially sensitive internals + are allowed to be accessed by public Harbour APIs + + added .prg level function __vmNoInternals() + to disable potentially sensitive internals + by default accessible via public APIs. + Intentionally a one-way function: once disabled, + it cannot be reenabled from .prg or .c level. + NOTE: It will break Harbour debug functionality, + so it'd will be useful for hbrun scripts and + release (non-debug) builds. + + modified internal __dbg*() functions to return + dummy values when internals are disabled via + __vmNoInternals() functions. While the function + return types are kept, apps relying on their + specific values and certain relationships between + them might break. + ; NOTE: In the future, some more internals might + be protected by this setting (f.e. low-level + object and class functions and some API from + hbdebug lib) + ; Please review + + * tests/debugtst.prg + ! fixed to compile warning-free without lowering + warning level + ! fixed to run RTE-free with internals disabled + + * bin/3rdpatch.hb + * bin/commit.hb + * config/postinst.hb + * contrib/make.hb + * contrib/hbtest/hbtest.ch + * src/debug/*.prg + * src/rtl/tclass.prg + * utils/hbmk2/examples/plug_bis.hb + * utils/hbmk2/examples/plug_tpl.hb + * use short form #pragmas (the ones identical + to Harbour options) + ; NOTE: Except -l which works reversed compared + to cmdline -l option. TOFIX? (I tried and failed) + + * src/rtl/hbi18n2.prg + * contrib/xhb/tfile.prg + * use F_ERROR instead of -1 literal + + * contrib/xhb/xhbtedit.prg + ! replaced dirty xhb extension with std SubStr() call + Reported by Tony Quick + [pls report such bugs on Harbour devl list] + + * contrib/hbodbc/todbc.prg + ! Don't continue ::Open() when SQLExecDir() have error + Fix from xhb via Vicente Guerra, with cleanups. + + * tests/multifnc/multifnc.hbp + + added comment + + support for watcom + + * tests/multifnc/t1.prg + ! missing file ending EOL + + * tests/*.prg + * extras/gtwvw/tests/wvwtest9.prg + * formatting + 2013-02-25 17:56 UTC+0100 Viktor Szakats (harbour syenar.net) * utils/hbmk2/hbmk2.prg + documented hbmk2 plugin API calls diff --git a/harbour/bin/3rdpatch.hb b/harbour/bin/3rdpatch.hb index 64b5f95fcb..f05203034d 100755 --- a/harbour/bin/3rdpatch.hb +++ b/harbour/bin/3rdpatch.hb @@ -213,7 +213,7 @@ * */ -#pragma warninglevel=3 +#pragma -w3 #pragma -km+ #pragma -ko+ diff --git a/harbour/bin/commit.hb b/harbour/bin/commit.hb index 8b62cc9e19..5cfbbb1977 100644 --- a/harbour/bin/commit.hb +++ b/harbour/bin/commit.hb @@ -29,7 +29,7 @@ #define _CONFIGFIL_ ".hbcommit" #define _CONFIGENV_ "HBCOMMIT_USER" -#pragma warninglevel=3 +#pragma -w3 #pragma -km+ #pragma -ko+ diff --git a/harbour/config/postinst.hb b/harbour/config/postinst.hb index 897ed5b17a..990e394440 100644 --- a/harbour/config/postinst.hb +++ b/harbour/config/postinst.hb @@ -11,7 +11,7 @@ * See COPYING.txt for licensing terms. */ -#pragma warninglevel=3 +#pragma -w3 #pragma -km+ #pragma -ko+ diff --git a/harbour/contrib/hbmisc/fcomma.prg b/harbour/contrib/hbmisc/fcomma.prg index 244ba03778..4fa59cc2d9 100644 --- a/harbour/contrib/hbmisc/fcomma.prg +++ b/harbour/contrib/hbmisc/fcomma.prg @@ -51,11 +51,11 @@ */ /* - * A simple RDD which uses HB_F*() functions from MISC library + * A simple RDD which uses hb_F*() functions from MISC library * to access CSV files. It allow to open an CSV file and navigate - * using SKIP()/GOTO()/GOTOP()/GOBOTTOM() functions using + * using Skip()/Goto()/GoTop()/GoBottom() functions using * Bof()/Eof()/RecNo()/LastRec() to check current state. - * HB_F*() functions does not support single field access and allow + * hb_F*() functions does not support single field access and allow * to read only the whole line. This RDD also. I only added one * virtual field which exist in all tables open by this RDD called * LINE which contains the current .csv file line. @@ -77,8 +77,8 @@ STATIC FUNCTION FCM_INIT( nRDD ) LOCAL aRData := Array( 10 ) - /* Set in our private RDD ITEM the array with HB_F*() work are numbers */ - AFill( aRData, -1 ) + /* Set in our private RDD ITEM the array with hb_F*() work are numbers */ + AFill( aRData, F_ERROR ) USRRDD_RDDDATA( nRDD, aRData ) RETURN HB_SUCCESS @@ -96,7 +96,7 @@ STATIC FUNCTION FCM_NEW( pWA ) /* * Set in our private AREA item the array with slot number and - * BOF/EOF flags. There is no BOF support in HB_F* function so + * BOF/EOF flags. There is no BOF support in hb_F* function so * we have to emulate it and there is no phantom record so we * cannot return EOF flag directly. */ @@ -135,7 +135,7 @@ STATIC FUNCTION FCM_OPEN( nWA, aOpenInfo ) aRData := USRRDD_RDDDATA( USRRDD_ID( nWA ) ) aWData := USRRDD_AREADATA( nWA ) - nSlot := AScan( aRData, -1 ) + nSlot := AScan( aRData, F_ERROR ) IF nSlot == 0 oError := ErrorNew() @@ -150,7 +150,7 @@ STATIC FUNCTION FCM_OPEN( nWA, aOpenInfo ) hb_FSelect( nSlot ) nHandle := hb_FUse( aOpenInfo[ UR_OI_NAME ], nMode ) - IF nHandle == -1 + IF nHandle == F_ERROR oError := ErrorNew() oError:GenCode := EG_OPEN oError:SubCode := 1001 @@ -193,7 +193,7 @@ STATIC FUNCTION FCM_CLOSE( nWA ) hb_FSelect( nSlot ) hb_FUse() aRData := USRRDD_RDDDATA( USRRDD_ID( nWA ) ) - aRData[ nSlot ] := -1 + aRData[ nSlot ] := F_ERROR ENDIF RETURN UR_SUPER_CLOSE( nWA ) @@ -226,7 +226,7 @@ STATIC FUNCTION FCM_GOTO( nWA, nRecord ) hb_FGoTop() aWData[ 2 ] := aWData[ 3 ] := hb_FEof() ELSE - hb_FSkip( 0 ) /* Clear the EOF flag inside HB_F* engin + hb_FSkip( 0 ) /* Clear the EOF flag inside hb_F* engin - it's not done automatically in hb_FGoBottom() :-( */ hb_FGoto( nRecord ) aWData[ 2 ] := hb_FRecNo() == 0 @@ -256,7 +256,7 @@ STATIC FUNCTION FCM_GOBOTTOM( nWA ) IF hb_FLastRec() == 0 aWData[ 2 ] := aWData[ 3 ] := .T. ELSE - hb_FSkip( 0 ) /* Clear the EOF flag inside HB_F* engin + hb_FSkip( 0 ) /* Clear the EOF flag inside hb_F* engin - it's not done automatically in hb_FGoBottom() :-( */ hb_FGoBottom() aWData[ 2 ] := aWData[ 3 ] := .F. diff --git a/harbour/contrib/hbodbc/todbc.prg b/harbour/contrib/hbodbc/todbc.prg index bd7b5cd170..01bbfe9705 100644 --- a/harbour/contrib/hbodbc/todbc.prg +++ b/harbour/contrib/hbodbc/todbc.prg @@ -299,7 +299,9 @@ METHOD Open() CLASS TODBC // Allocates and executes the statement SQLAllocStmt( ::hDbc, @::hStmt ) - nRet := SQLExecDirect( ::hStmt, ::cSQL ) + IF ( nRet := SQLExecDirect( ::hStmt, ::cSQL ) ) != SQL_SUCCESS + EXIT + ENDIF // Get result information about fields and stores it // on Fields collection diff --git a/harbour/contrib/make.hb b/harbour/contrib/make.hb index 3d7ad8631d..b0a4fd8829 100755 --- a/harbour/contrib/make.hb +++ b/harbour/contrib/make.hb @@ -27,7 +27,7 @@ * */ -#pragma warninglevel=3 +#pragma -w3 #pragma -km+ #pragma -ko+ diff --git a/harbour/contrib/xhb/tfile.prg b/harbour/contrib/xhb/tfile.prg index fab3829134..10f66c8b9c 100644 --- a/harbour/contrib/xhb/tfile.prg +++ b/harbour/contrib/xhb/tfile.prg @@ -190,7 +190,7 @@ METHOD Create( nAttr ) CLASS TCgiFile nSuccess := FCreate( ::Name, nAttr ) ::Handle := nSuccess - RETURN nSuccess != -1 + RETURN nSuccess != F_ERROR /* ** ::Size() --> nFileSize @@ -278,7 +278,7 @@ METHOD Readline( nSize ) CLASS TCgiFile RETURN ::Buffer /* -** ::ReadByte() --> nByte or -1 if unsuccessfull +** ::ReadByte() --> nByte or -1 if unsuccessfull */ METHOD ReadByte() CLASS TCgiFile @@ -304,7 +304,7 @@ METHOD ReadInt() CLASS TCgiFile RETURN iif( nBytes > 0, Bin2I( cBuff ), -1 ) /* -** ::ReadLong() --> nLong or -1 if unsuccessfull +** ::ReadLong() --> nLong or -1 if unsuccessfull */ METHOD ReadLong() CLASS TCgiFile diff --git a/harbour/contrib/xhb/xhbtedit.prg b/harbour/contrib/xhb/xhbtedit.prg index 6a24237348..1b80f7562b 100644 --- a/harbour/contrib/xhb/xhbtedit.prg +++ b/harbour/contrib/xhb/xhbtedit.prg @@ -2051,7 +2051,7 @@ STATIC FUNCTION GetParagraph( oSelf, nRow ) LOCAL cLine := "" DO WHILE oSelf:aText[ nRow ]:lSoftCR - cLine := cline + oSelf:aText[ nRow ]:cText + cLine += oSelf:aText[ nRow ]:cText // I don't need to increment nRow since I'm removing lines, ie line n is // a different line each time I add it to cLine oSelf:RemoveLine( nRow ) @@ -2150,7 +2150,7 @@ METHOD SplitLine( nRow ) CLASS XHBEditor // Split line at fist space before current position // - DO WHILE nFirstSpace > 1 .AND. !( cLine[ nFirstSpace ] == " " ) + DO WHILE nFirstSpace > 1 .AND. !( SubStr( cLine, nFirstSpace, 1 ) == " " ) nFirstSpace-- ENDDO diff --git a/harbour/extras/gtwvw/tests/wvwtest9.prg b/harbour/extras/gtwvw/tests/wvwtest9.prg index 478191541a..7e1d717772 100644 --- a/harbour/extras/gtwvw/tests/wvwtest9.prg +++ b/harbour/extras/gtwvw/tests/wvwtest9.prg @@ -674,7 +674,7 @@ FUNCTION VXBscroller( oBrowse, nWinNum, XBid, XBmsg ) LOCAL lNeedStabilize // if we can't handle non topmost window we must return right away - // if nWinNum != wvw_nNumWindows()-1 ; return ; endif + // IF nWinNum != wvw_nNumWindows() - 1 ; RETURN ; ENDIF nOldWin := wvw_nSetCurWindow( nWinNum ) @@ -719,7 +719,7 @@ FUNCTION HXBscroller( oBrowse, nWinNum, XBid, XBmsg ) LOCAL lNeedStabilize // if we can't handle non topmost window we must return right away - // if nWinNum != wvw_nNumWindows()-1 ; return ; endif + // IF nWinNum != wvw_nNumWindows() - 1 ; RETURN ; ENDIF nOldWin := wvw_nSetCurWindow( nWinNum ) @@ -758,10 +758,10 @@ FUNCTION HXBscroller( oBrowse, nWinNum, XBid, XBmsg ) /** 20040704 notes: -0 <= nPage <= (nMax - nMin + 1) +0 <= nPage <= ( nMax - nMin + 1 ) nPage :: pagesize -nMin <= nPos <= (nMax - Max(nPage-1, 0)) +nMin <= nPos <= ( nMax - Max( nPage - 1, 0 ) ) **/ STATIC FUNCTION RefreshVXB( oBrowse, nWinNum, XBid ) diff --git a/harbour/include/harbour.hbx b/harbour/include/harbour.hbx index 55858d52b3..4370bc3bc8 100644 --- a/harbour/include/harbour.hbx +++ b/harbour/include/harbour.hbx @@ -1490,6 +1490,7 @@ DYNAMIC __TextSave DYNAMIC __TracePrgCalls DYNAMIC __TypeFile DYNAMIC __vmItemID +DYNAMIC __vmNoInternals DYNAMIC __Wait DYNAMIC __wapi_GetACP DYNAMIC __wapi_GetOEMCP diff --git a/harbour/include/hbapi.h b/harbour/include/hbapi.h index 95f35d3a84..eed4d748c2 100644 --- a/harbour/include/hbapi.h +++ b/harbour/include/hbapi.h @@ -1156,6 +1156,7 @@ extern void * hb_i18n_alloc( void * cargo ); extern HB_EXPORT void hb_vmSetLinkedMain( const char * szMain ); extern HB_EXPORT void hb_vmSetDefaultGT( const char * szGtName ); +extern HB_EXPORT HB_BOOL hb_vmInternalsEnabled( void ); extern HB_EXPORT PHB_FUNC hb_vmProcAddress( const char * szFuncName ); diff --git a/harbour/src/debug/dbgbrwsr.prg b/harbour/src/debug/dbgbrwsr.prg index 3af34011a0..ad875ad88c 100644 --- a/harbour/src/debug/dbgbrwsr.prg +++ b/harbour/src/debug/dbgbrwsr.prg @@ -51,7 +51,7 @@ * */ -#pragma DEBUGINFO=OFF +#pragma -b- #define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */ #include "hbclass.ch" diff --git a/harbour/src/debug/dbghelp.prg b/harbour/src/debug/dbghelp.prg index ae7e6e9b95..920d084ed3 100644 --- a/harbour/src/debug/dbghelp.prg +++ b/harbour/src/debug/dbghelp.prg @@ -55,7 +55,7 @@ * */ -#pragma DEBUGINFO=OFF +#pragma -b- /* NOTE: Don't use SAY/DevOut()/DevPos() for screen output, otherwise the debugger output may interfere with the applications output diff --git a/harbour/src/debug/dbgmenu.prg b/harbour/src/debug/dbgmenu.prg index 907e55c0f0..b3826937e4 100644 --- a/harbour/src/debug/dbgmenu.prg +++ b/harbour/src/debug/dbgmenu.prg @@ -50,7 +50,7 @@ * */ -#pragma DEBUGINFO=OFF +#pragma -b- #xcommand MENU [] => [ := ] HBDbMenu():New() #xcommand MENUITEM [ PROMPT ] ; diff --git a/harbour/src/debug/dbgtarr.prg b/harbour/src/debug/dbgtarr.prg index 80fa284e1c..b1823a0fc1 100644 --- a/harbour/src/debug/dbgtarr.prg +++ b/harbour/src/debug/dbgtarr.prg @@ -50,7 +50,7 @@ * */ -#pragma DEBUGINFO=OFF +#pragma -b- #define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */ #include "hbclass.ch" diff --git a/harbour/src/debug/dbgthsh.prg b/harbour/src/debug/dbgthsh.prg index c54af4cd1f..b786afa128 100644 --- a/harbour/src/debug/dbgthsh.prg +++ b/harbour/src/debug/dbgthsh.prg @@ -50,7 +50,7 @@ * */ -#pragma DEBUGINFO=OFF +#pragma -b- #define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */ #include "hbclass.ch" diff --git a/harbour/src/debug/dbgtinp.prg b/harbour/src/debug/dbgtinp.prg index caee9e1efc..14b5db586c 100644 --- a/harbour/src/debug/dbgtinp.prg +++ b/harbour/src/debug/dbgtinp.prg @@ -50,7 +50,7 @@ * */ -#pragma DEBUGINFO=OFF +#pragma -b- #define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */ #include "hbclass.ch" diff --git a/harbour/src/debug/dbgtmenu.prg b/harbour/src/debug/dbgtmenu.prg index e9f6582c91..d999a779ea 100644 --- a/harbour/src/debug/dbgtmenu.prg +++ b/harbour/src/debug/dbgtmenu.prg @@ -54,7 +54,7 @@ the debugger output may interfere with the applications output redirection, and is also slower. [vszakats] */ -#pragma DEBUGINFO=OFF +#pragma -b- #define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */ #include "hbclass.ch" diff --git a/harbour/src/debug/dbgtmitm.prg b/harbour/src/debug/dbgtmitm.prg index 3a9b580213..fd44c08d60 100644 --- a/harbour/src/debug/dbgtmitm.prg +++ b/harbour/src/debug/dbgtmitm.prg @@ -54,7 +54,7 @@ the debugger output may interfere with the applications output redirection, and is also slower. [vszakats] */ -#pragma DEBUGINFO=OFF +#pragma -b- #define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */ #include "hbclass.ch" diff --git a/harbour/src/debug/dbgtobj.prg b/harbour/src/debug/dbgtobj.prg index 6b38ef8fe6..9f8763743a 100644 --- a/harbour/src/debug/dbgtobj.prg +++ b/harbour/src/debug/dbgtobj.prg @@ -50,7 +50,7 @@ * */ -#pragma DEBUGINFO=OFF +#pragma -b- #define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */ #include "hbclass.ch" diff --git a/harbour/src/debug/dbgtwin.prg b/harbour/src/debug/dbgtwin.prg index 9aa5dc105a..32fff29a49 100644 --- a/harbour/src/debug/dbgtwin.prg +++ b/harbour/src/debug/dbgtwin.prg @@ -65,7 +65,7 @@ the debugger output may interfere with the applications output redirection, and is also slower. [vszakats] */ -#pragma DEBUGINFO=OFF +#pragma -b- #define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */ #include "hbclass.ch" diff --git a/harbour/src/debug/dbgwa.prg b/harbour/src/debug/dbgwa.prg index b0d4c047f1..ae91907a2d 100644 --- a/harbour/src/debug/dbgwa.prg +++ b/harbour/src/debug/dbgwa.prg @@ -50,7 +50,7 @@ * */ -#pragma DEBUGINFO=OFF +#pragma -b- #include "box.ch" #include "setcurs.ch" diff --git a/harbour/src/debug/debugger.prg b/harbour/src/debug/debugger.prg index 0dca3a0d3c..3ea682b3c0 100644 --- a/harbour/src/debug/debugger.prg +++ b/harbour/src/debug/debugger.prg @@ -71,7 +71,7 @@ the debugger output may interfere with the applications output redirection, and is also slower. [vszakats] */ -#pragma DEBUGINFO=OFF +#pragma -b- #define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */ #include "hbclass.ch" diff --git a/harbour/src/debug/tbrwtext.prg b/harbour/src/debug/tbrwtext.prg index 7b7ce0249e..d61c341748 100644 --- a/harbour/src/debug/tbrwtext.prg +++ b/harbour/src/debug/tbrwtext.prg @@ -50,7 +50,7 @@ * */ -#pragma DEBUGINFO=OFF +#pragma -b- #define HB_CLS_NOTOBJECT /* do not inherit from HBObject calss */ #include "hbclass.ch" diff --git a/harbour/src/rtl/hbi18n2.prg b/harbour/src/rtl/hbi18n2.prg index dc26941ffc..01815c416b 100644 --- a/harbour/src/rtl/hbi18n2.prg +++ b/harbour/src/rtl/hbi18n2.prg @@ -66,7 +66,7 @@ #define LEFTEQUAL( l, r ) ( Left( l, Len( r ) ) == r ) -STATIC FUNCTION __I18N_fileName( cFileName ) +STATIC FUNCTION __i18n_fileName( cFileName ) IF Set( _SET_DEFEXTENSIONS ) cFileName := hb_FNameExtSetDef( cFileName, ".pot" ) @@ -74,11 +74,11 @@ STATIC FUNCTION __I18N_fileName( cFileName ) RETURN cFileName -STATIC FUNCTION __I18N_strEncode( cStr ) +STATIC FUNCTION __i18n_strEncode( cStr ) RETURN SubStr( hb_StrToExp( cStr, .T. ), 2 ) -STATIC FUNCTION __I18N_strDecode( cLine, cValue, lCont ) +STATIC FUNCTION __i18n_strDecode( cLine, cValue, lCont ) LOCAL lRet := .F. LOCAL cText @@ -106,9 +106,9 @@ FUNCTION __i18n_potArrayLoad( cFile, cErrorMsg ) LOCAL lCont LOCAL hFile - __I18N_fileName( @cFile ) + __i18n_fileName( @cFile ) hFile := FOpen( cFile, FO_READ ) - IF hFile == -1 + IF hFile == F_ERROR cErrorMsg := "cannot open file: " + cFile RETURN NIL ENDIF @@ -265,7 +265,7 @@ FUNCTION __i18n_potArrayLoad( cFile, cErrorMsg ) IF ( nMode != _I18N_CONTEXT .AND. ; nMode != _I18N_MSGID .AND. ; nMode != _I18N_MSGSTR ) .OR. ; - ! __I18N_strDecode( cLine, @cValue, @lCont ) + ! __i18n_strDecode( cLine, @cValue, @lCont ) cErrorMsg := "unrecognized line" EXIT ENDIF @@ -343,7 +343,7 @@ FUNCTION __i18n_potArraySave( cFile, aTrans, cErrorMsg, lVersionNo, lSourceRef ) cPOT += cFlg IF ! aItem[ _I18N_CONTEXT ] == "" cPOT += "msgctxt " - cPOT += __I18N_strEncode( aItem[ _I18N_CONTEXT ] ) + cPOT += __i18n_strEncode( aItem[ _I18N_CONTEXT ] ) cPOT += cEol ENDIF FOR EACH msg IN aItem[ _I18N_MSGID ] @@ -354,7 +354,7 @@ FUNCTION __i18n_potArraySave( cFile, aTrans, cErrorMsg, lVersionNo, lSourceRef ) ELSE cPOT += "msgid_plural" + hb_ntos( msg:__enumIndex() - 1 ) + " " ENDIF - cPOT += __I18N_strEncode( msg ) + cPOT += __i18n_strEncode( msg ) cPOT += cEol NEXT lPlural := aItem[ _I18N_PLURAL ] .OR. Len( aItem[ _I18N_MSGSTR ] ) > 1 @@ -364,14 +364,14 @@ FUNCTION __i18n_potArraySave( cFile, aTrans, cErrorMsg, lVersionNo, lSourceRef ) ELSE cPOT += "msgstr " ENDIF - cPOT += __I18N_strEncode( msg ) + cPOT += __i18n_strEncode( msg ) cPOT += cEol NEXT NEXT - __I18N_fileName( @cFile ) + __i18n_fileName( @cFile ) hFile := FCreate( cFile ) - IF hFile == -1 + IF hFile == F_ERROR cErrorMsg := "cannot create translation file: " + cFile ELSEIF FWrite( hFile, cPOT ) != hb_BLen( cPOT ) cErrorMsg := "cannot write to file: " + cFile @@ -560,34 +560,34 @@ FUNCTION hb_i18n_SavePOT( cFile, pI18N, cErrorMsg ) "#" + cEol FOR EACH context IN hI18N[ "CONTEXT" ] msgctxt := iif( context:__enumKey() == "", NIL, ; - "msgctxt " + __I18N_strEncode( context:__enumKey() ) + cEol ) + "msgctxt " + __i18n_strEncode( context:__enumKey() ) + cEol ) FOR EACH trans IN context cPOT += cEol + cFlg IF msgctxt != NIL cPOT += msgctxt ENDIF cPOT += "msgid " - cPOT += __I18N_strEncode( trans:__enumKey() ) + cPOT += __i18n_strEncode( trans:__enumKey() ) cPOT += cEol IF HB_ISARRAY( trans ) FOR EACH msgstr IN trans cPOT += "msgstr[" cPOT += hb_ntos( msgstr:__enumIndex() - 1 ) cPOT += "] " - cPOT += __I18N_strEncode( msgstr ) + cPOT += __i18n_strEncode( msgstr ) cPOT += cEol NEXT ELSE cPOT += "msgstr " - cPOT += __I18N_strEncode( trans ) + cPOT += __i18n_strEncode( trans ) cPOT += cEol ENDIF NEXT NEXT - __I18N_fileName( @cFile ) + __i18n_fileName( @cFile ) hFile := FCreate( cFile ) - IF hFile == -1 + IF hFile == F_ERROR cErrorMsg := "cannot create translation file: " + cFile lRet := .F. ELSEIF FWrite( hFile, cPOT ) != hb_BLen( cPOT ) diff --git a/harbour/src/rtl/tclass.prg b/harbour/src/rtl/tclass.prg index fc51236fa5..7a6e4e850c 100644 --- a/harbour/src/rtl/tclass.prg +++ b/harbour/src/rtl/tclass.prg @@ -74,7 +74,7 @@ /* NOTE: This .prg is also used by the debugger subsystem, therefore we need this switch to avoid an infinite loop when launching it. [vszakats] */ -#pragma DEBUGINFO=OFF +#pragma -b- /* Harbour Class HBClass to build classes */ diff --git a/harbour/src/vm/debug.c b/harbour/src/vm/debug.c index ed95870e58..32671ba287 100644 --- a/harbour/src/vm/debug.c +++ b/harbour/src/vm/debug.c @@ -137,7 +137,10 @@ static void AddToArray( PHB_ITEM pItem, PHB_ITEM pReturn, HB_SIZE nPos ) * $End$ */ HB_FUNC( __DBGVMSTKGCOUNT ) { - hb_retns( hb_stackTopOffset() ); + if( hb_vmInternalsEnabled() ) + hb_retns( hb_stackTopOffset() ); + else + hb_retns( 0 ); } /* $Doc$ @@ -146,16 +149,21 @@ HB_FUNC( __DBGVMSTKGCOUNT ) * $End$ */ HB_FUNC( __DBGVMSTKGLIST ) { - PHB_ITEM pReturn; - HB_ISIZ nLen = hb_stackTopOffset(); - HB_ISIZ nPos; + if( hb_vmInternalsEnabled() ) + { + PHB_ITEM pReturn; + HB_ISIZ nLen = hb_stackTopOffset(); + HB_ISIZ nPos; - pReturn = hb_itemArrayNew( nLen ); /* Create a transfer array */ + pReturn = hb_itemArrayNew( nLen ); /* Create a transfer array */ - for( nPos = 0; nPos < nLen; ++nPos ) - AddToArray( hb_stackItem( nPos ), pReturn, nPos + 1 ); + for( nPos = 0; nPos < nLen; ++nPos ) + AddToArray( hb_stackItem( nPos ), pReturn, nPos + 1 ); - hb_itemReturnRelease( pReturn ); + hb_itemReturnRelease( pReturn ); + } + else + hb_reta( 0 ); } /* $Doc$ @@ -189,7 +197,10 @@ static HB_ISIZ hb_stackLen( int iLevel ) * $End$ */ HB_FUNC( __DBGVMSTKLCOUNT ) { - hb_retns( hb_stackLen( hb_parni( 1 ) + 1 ) ); + if( hb_vmInternalsEnabled() ) + hb_retns( hb_stackLen( hb_parni( 1 ) + 1 ) ); + else + hb_retns( 0 ); } /* $Doc$ @@ -205,55 +216,68 @@ HB_FUNC( __DBGVMSTKLCOUNT ) * $End$ */ HB_FUNC( __DBGVMSTKLLIST ) { - PHB_ITEM pReturn; - HB_ISIZ nLen, n; - HB_ISIZ nBaseOffset, nPrevOffset; + if( hb_vmInternalsEnabled() ) + { + PHB_ITEM pReturn; + HB_ISIZ nLen, n; + HB_ISIZ nBaseOffset, nPrevOffset; - nBaseOffset = hb_stackBaseOffset(); - nPrevOffset = hb_stackItem( nBaseOffset - 1 )->item.asSymbol.stackstate->nBaseItem; + nBaseOffset = hb_stackBaseOffset(); + nPrevOffset = hb_stackItem( nBaseOffset - 1 )->item.asSymbol.stackstate->nBaseItem; - nLen = nBaseOffset - nPrevOffset - 3; - pReturn = hb_itemArrayNew( nLen ); /* Create a transfer array */ - for( n = 0; n < nLen; ++n ) - AddToArray( hb_stackItem( nPrevOffset + n ), pReturn, n + 1 ); + nLen = nBaseOffset - nPrevOffset - 3; + pReturn = hb_itemArrayNew( nLen ); /* Create a transfer array */ + for( n = 0; n < nLen; ++n ) + AddToArray( hb_stackItem( nPrevOffset + n ), pReturn, n + 1 ); - hb_itemReturnRelease( pReturn ); + hb_itemReturnRelease( pReturn ); + } + else + hb_reta( 0 ); } HB_FUNC( __DBGVMLOCALLIST ) { - PHB_ITEM pArray; - HB_ISIZ nBaseOffset, nPrevOffset, nLen, n; - int iLevel = hb_parni( 1 ) + 1; - - nBaseOffset = hb_stackBaseOffset(); - while( --iLevel > 0 && nBaseOffset > 1 ) - nBaseOffset = hb_stackItem( nBaseOffset - 1 )->item.asSymbol.stackstate->nBaseItem + 1; - - if( nBaseOffset > 1 ) + if( hb_vmInternalsEnabled() ) { - PHB_ITEM pSymItm; + PHB_ITEM pArray; + HB_ISIZ nBaseOffset, nPrevOffset, nLen, n; + int iLevel = hb_parni( 1 ) + 1; - nPrevOffset = hb_stackItem( nBaseOffset - 1 )->item.asSymbol.stackstate->nBaseItem; - pSymItm = hb_stackItem( nPrevOffset ); - nPrevOffset += HB_MAX( pSymItm->item.asSymbol.paramdeclcnt, - pSymItm->item.asSymbol.paramcnt ) + 1; - nLen = nBaseOffset - nPrevOffset - 2; + nBaseOffset = hb_stackBaseOffset(); + while( --iLevel > 0 && nBaseOffset > 1 ) + nBaseOffset = hb_stackItem( nBaseOffset - 1 )->item.asSymbol.stackstate->nBaseItem + 1; + + if( nBaseOffset > 1 ) + { + PHB_ITEM pSymItm; + + nPrevOffset = hb_stackItem( nBaseOffset - 1 )->item.asSymbol.stackstate->nBaseItem; + pSymItm = hb_stackItem( nPrevOffset ); + nPrevOffset += HB_MAX( pSymItm->item.asSymbol.paramdeclcnt, + pSymItm->item.asSymbol.paramcnt ) + 1; + nLen = nBaseOffset - nPrevOffset - 2; + } + else + nLen = nPrevOffset = 0; + + pArray = hb_itemArrayNew( nLen ); + for( n = 1; n <= nLen; ++n ) + hb_itemCopyFromRef( hb_arrayGetItemPtr( pArray, n ), + hb_stackItem( nPrevOffset + n ) ); + + hb_itemReturnRelease( pArray ); } else - nLen = nPrevOffset = 0; - - pArray = hb_itemArrayNew( nLen ); - for( n = 1; n <= nLen; ++n ) - hb_itemCopyFromRef( hb_arrayGetItemPtr( pArray, n ), - hb_stackItem( nPrevOffset + n ) ); - - hb_itemReturnRelease( pArray ); + hb_reta( 0 ); } HB_FUNC( __DBGVMPARLLIST ) { - hb_itemReturnRelease( hb_arrayFromParams( hb_parni( 1 ) + 1 ) ); + if( hb_vmInternalsEnabled() ) + hb_itemReturnRelease( hb_arrayFromParams( hb_parni( 1 ) + 1 ) ); + else + hb_reta( 0 ); } PHB_ITEM hb_dbg_vmVarLGet( int iLevel, int iLocal ) @@ -295,48 +319,54 @@ PHB_ITEM hb_dbg_vmVarLGet( int iLevel, int iLocal ) HB_FUNC( __DBGVMVARLGET ) { - int iLevel = hb_parni( 1 ) + 1; - int iLocal = hb_parni( 2 ); - PHB_ITEM pLocal = hb_dbg_vmVarLGet( iLevel, iLocal ); + if( hb_vmInternalsEnabled() ) + { + int iLevel = hb_parni( 1 ) + 1; + int iLocal = hb_parni( 2 ); + PHB_ITEM pLocal = hb_dbg_vmVarLGet( iLevel, iLocal ); - if( pLocal ) - hb_itemReturn( pLocal ); - else - hb_errRT_BASE( EG_ARG, 6005, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + if( pLocal ) + hb_itemReturn( pLocal ); + else + hb_errRT_BASE( EG_ARG, 6005, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + } } HB_FUNC( __DBGVMVARLSET ) { - int iLevel = hb_parni( 1 ) + 1; - int iLocal = hb_parni( 2 ); - HB_ISIZ nBaseOffset; - PHB_ITEM pLocal; - - nBaseOffset = hb_stackBaseOffset(); - while( iLevel-- > 0 && nBaseOffset > 1 ) - nBaseOffset = hb_stackItem( nBaseOffset - 1 )->item.asSymbol.stackstate->nBaseItem + 1; - - if( iLevel < 0 ) + if( hb_vmInternalsEnabled() ) { - if( iLocal > SHRT_MAX ) + int iLevel = hb_parni( 1 ) + 1; + int iLocal = hb_parni( 2 ); + HB_ISIZ nBaseOffset; + PHB_ITEM pLocal; + + nBaseOffset = hb_stackBaseOffset(); + while( iLevel-- > 0 && nBaseOffset > 1 ) + nBaseOffset = hb_stackItem( nBaseOffset - 1 )->item.asSymbol.stackstate->nBaseItem + 1; + + if( iLevel < 0 ) { - iLocal -= USHRT_MAX; - iLocal--; + if( iLocal > SHRT_MAX ) + { + iLocal -= USHRT_MAX; + iLocal--; + } + + if( iLocal >= 0 ) + { + PHB_ITEM pBase = hb_stackItem( nBaseOffset - 1 ); + + if( pBase->item.asSymbol.paramcnt > pBase->item.asSymbol.paramdeclcnt && + iLocal > pBase->item.asSymbol.paramdeclcnt ) + iLocal += pBase->item.asSymbol.paramcnt - pBase->item.asSymbol.paramdeclcnt; + + pLocal = hb_stackItem( nBaseOffset + iLocal ); + } + else + pLocal = hb_codeblockGetRef( hb_stackItem( nBaseOffset )->item.asBlock.value, iLocal ); + + hb_itemCopyToRef( pLocal, hb_stackItemFromBase( 3 ) ); } - - if( iLocal >= 0 ) - { - PHB_ITEM pBase = hb_stackItem( nBaseOffset - 1 ); - - if( pBase->item.asSymbol.paramcnt > pBase->item.asSymbol.paramdeclcnt && - iLocal > pBase->item.asSymbol.paramdeclcnt ) - iLocal += pBase->item.asSymbol.paramcnt - pBase->item.asSymbol.paramdeclcnt; - - pLocal = hb_stackItem( nBaseOffset + iLocal ); - } - else - pLocal = hb_codeblockGetRef( hb_stackItem( nBaseOffset )->item.asBlock.value, iLocal ); - - hb_itemCopyToRef( pLocal, hb_stackItemFromBase( 3 ) ); } } diff --git a/harbour/src/vm/hvm.c b/harbour/src/vm/hvm.c index 6ff634ccea..3693890b3f 100644 --- a/harbour/src/vm/hvm.c +++ b/harbour/src/vm/hvm.c @@ -226,6 +226,8 @@ static PHB_DYNS s_pDynsDbgEntry = NULL; /* Cached __DBGENTRY symbol */ static HB_DBGENTRY_FUNC s_pFunDbgEntry; /* C level debugger entry */ #endif +static HB_BOOL s_fInternalsEnabled = HB_TRUE; + #if defined( HB_MT_VM ) static int volatile hb_vmThreadRequest = 0; static void hb_vmRequestTest( void ); @@ -8918,6 +8920,11 @@ HB_BOOL hb_vmIsReady( void ) #endif } +HB_BOOL hb_vmInternalsEnabled( void ) +{ + return s_fInternalsEnabled; +} + PHB_CODEPAGE hb_vmCDP( void ) { HB_STACK_TLS_PRELOAD @@ -11845,23 +11852,34 @@ HB_FUNC( __DBGINVOKEDEBUG ) { HB_STACK_TLS_PRELOAD + if( hb_vmInternalsEnabled() ) + { #ifndef HB_NO_DEBUG - HB_BOOL * pfRequest = hb_stackDebugRequest(); + HB_BOOL * pfRequest = hb_stackDebugRequest(); - hb_retl( *pfRequest ); - *pfRequest = hb_parl( 1 ); + hb_retl( *pfRequest ); + *pfRequest = hb_parl( 1 ); #else - hb_retl( HB_FALSE ); + hb_retl( HB_FALSE ); #endif + } + else + hb_retl( HB_FALSE ); } /* $Doc$ * $FuncName$ __dbgvmVarSList() - * $Description$ Return the statics array. Please aClone before assignments + * $Description$ Return the statics array. Please AClone() before assignments * $End$ */ HB_FUNC( __DBGVMVARSLIST ) { - hb_itemReturnRelease( hb_vmStaticsArray() ); + if( hb_vmInternalsEnabled() ) + hb_itemReturnRelease( hb_vmStaticsArray() ); + else + { + HB_STACK_TLS_PRELOAD + hb_reta( 0 ); + } } /* $Doc$ @@ -11871,7 +11889,11 @@ HB_FUNC( __DBGVMVARSLIST ) HB_FUNC( __DBGVMVARSLEN ) { HB_STACK_TLS_PRELOAD - hb_retnint( hb_vmStaticsCount() ); + + if( hb_vmInternalsEnabled() ) + hb_retnint( hb_vmStaticsCount() ); + else + hb_retnint( 0 ); } /* $Doc$ @@ -11880,7 +11902,8 @@ HB_FUNC( __DBGVMVARSLEN ) * $End$ */ HB_FUNC( __DBGVMVARSGET ) { - hb_itemReturn( hb_dbg_vmVarSGet( hb_param( 1, HB_IT_ARRAY ), hb_parni( 2 ) ) ); + if( hb_vmInternalsEnabled() ) + hb_itemReturn( hb_dbg_vmVarSGet( hb_param( 1, HB_IT_ARRAY ), hb_parni( 2 ) ) ); } /* $Doc$ @@ -11889,17 +11912,23 @@ HB_FUNC( __DBGVMVARSGET ) * $End$ */ HB_FUNC( __DBGVMVARSSET ) { - PHB_ITEM pStaticsBase = hb_param( 1, HB_IT_ARRAY ); - PHB_ITEM pItem = hb_param( 3, HB_IT_ANY ); + if( hb_vmInternalsEnabled() ) + { + PHB_ITEM pStaticsBase = hb_param( 1, HB_IT_ARRAY ); + PHB_ITEM pItem = hb_param( 3, HB_IT_ANY ); - if( pStaticsBase && pItem ) - hb_arraySet( pStaticsBase, hb_parni( 2 ), pItem ); + if( pStaticsBase && pItem ) + hb_arraySet( pStaticsBase, hb_parni( 2 ), pItem ); + } } HB_FUNC( __DBGPROCLEVEL ) { - HB_STACK_TLS_PRELOAD - hb_retnl( hb_dbg_ProcLevel() - 1 ); /* Don't count self */ + if( hb_vmInternalsEnabled() ) + { + HB_STACK_TLS_PRELOAD + hb_retnl( hb_dbg_ProcLevel() - 1 ); /* Don't count self */ + } } /* @@ -11933,26 +11962,38 @@ PHB_ITEM hb_dbg_vmVarGGet( int nGlobal, int nOffset ) * $End$ */ HB_FUNC( __DBGVMVARGLIST ) { + if( hb_vmInternalsEnabled() ) + { #if 0 - PHB_ITEM pGlobals = hb_itemClone( &s_aGlobals ); + PHB_ITEM pGlobals = hb_itemClone( &s_aGlobals ); #else - PHB_ITEM pGlobals = hb_itemArrayNew( 0 ); + PHB_ITEM pGlobals = hb_itemArrayNew( 0 ); #endif - hb_itemReturnRelease( pGlobals ); + hb_itemReturnRelease( pGlobals ); + } + else + { + HB_STACK_TLS_PRELOAD + hb_reta( 0 ); + } } HB_FUNC( __DBGVMVARGGET ) { - hb_itemReturn( hb_dbg_vmVarGGet( hb_parni( 1 ), hb_parni( 2 ) ) ); + if( hb_vmInternalsEnabled() ) + hb_itemReturn( hb_dbg_vmVarGGet( hb_parni( 1 ), hb_parni( 2 ) ) ); } HB_FUNC( __DBGVMVARGSET ) { #if 0 - PHB_ITEM pItem = hb_param( 3, HB_IT_ANY ); - if( pItem ) - hb_arraySet( &s_aGlobals, hb_parni( 1 ) + hb_parni( 2 ), pItem ); + if( hb_vmInternalsEnabled() ) + { + PHB_ITEM pItem = hb_param( 3, HB_IT_ANY ); + if( pItem ) + hb_arraySet( &s_aGlobals, hb_parni( 1 ) + hb_parni( 2 ), pItem ); + } #endif } @@ -12106,6 +12147,11 @@ HB_FUNC( __QUITCANCEL ) } } +HB_FUNC( __VMNOINTERNALS ) +{ + s_fInternalsEnabled = HB_FALSE; +} + HB_FUNC( __VMITEMID ) { HB_STACK_TLS_PRELOAD diff --git a/harbour/tests/clasinit.prg b/harbour/tests/clasinit.prg index 43ae023c58..550f46c126 100644 --- a/harbour/tests/clasinit.prg +++ b/harbour/tests/clasinit.prg @@ -10,42 +10,42 @@ PROCEDURE Main() LOCAL oSecond ? "What's the default oForm and calculate area" - ? hb_ValToExp( oForm ) + ? hb_ValToExp( oForm ) ? oForm:CalcArea() ? "Set nTop to 5 and recalculate" oForm:nTop := 5 - ? hb_ValToExp( oForm ) + ? hb_ValToExp( oForm ) ? oForm:CalcArea() ? "Create a new instance and calculate area" oSecond := TForm():New() - ? hb_ValToExp( oSecond ) + ? hb_ValToExp( oSecond ) ? oSecond:CalcArea() RETURN FUNCTION TForm() - STATIC oClass + STATIC s_oClass - IF oClass == NIL - oClass := HBClass():New( "TFORM" ) // starts a new class definition + IF s_oClass == NIL + s_oClass := HBClass():New( "TFORM" ) // starts a new class definition - oClass:AddData( "cName" ) // define this class objects datas - oClass:AddData( "nTop" , 10 ) - oClass:AddData( "nLeft" , 10 ) - oClass:AddData( "nBottom", 20 ) - oClass:AddData( "nRight" , 40 ) + s_oClass:AddData( "cName" ) // define this class objects datas + s_oClass:AddData( "nTop" , 10 ) + s_oClass:AddData( "nLeft" , 10 ) + s_oClass:AddData( "nBottom", 20 ) + s_oClass:AddData( "nRight" , 40 ) - oClass:AddMethod( "New", @New() ) // define this class objects methods - oClass:AddMethod( "Show", @Show() ) - oClass:AddInline( "CalcArea", ; + s_oClass:AddMethod( "New", @New() ) // define this class objects methods + s_oClass:AddMethod( "Show", @Show() ) + s_oClass:AddInline( "CalcArea", ; {| self | ( ::nRight - ::nLeft ) * ( ::nBottom - ::nTop ) } ) - oClass:Create() // builds this class + s_oClass:Create() // builds this class ENDIF - RETURN oClass:Instance() // builds an object of this class + RETURN s_oClass:Instance() // builds an object of this class STATIC FUNCTION New() diff --git a/harbour/tests/classes.prg b/harbour/tests/classes.prg index a772030ca4..0cc8a4e57a 100644 --- a/harbour/tests/classes.prg +++ b/harbour/tests/classes.prg @@ -16,24 +16,24 @@ PROCEDURE Main() FUNCTION TForm() - STATIC oClass + STATIC s_oClass - IF oClass == NIL - oClass := HBClass():New( "TFORM" ) // starts a new class definition + IF s_oClass == NIL + s_oClass := HBClass():New( "TFORM" ) // starts a new class definition - oClass:AddData( "cName" ) // define this class objects datas - oClass:AddData( "nTop" ) - oClass:AddData( "nLeft" ) - oClass:AddData( "nBottom" ) - oClass:AddData( "nRight" ) + s_oClass:AddData( "cName" ) // define this class objects datas + s_oClass:AddData( "nTop" ) + s_oClass:AddData( "nLeft" ) + s_oClass:AddData( "nBottom" ) + s_oClass:AddData( "nRight" ) - oClass:AddMethod( "New", @New() ) // define this class objects methods - oClass:AddMethod( "Show", @Show() ) + s_oClass:AddMethod( "New", @New() ) // define this class objects methods + s_oClass:AddMethod( "Show", @Show() ) - oClass:Create() // builds this class + s_oClass:Create() // builds this class ENDIF - RETURN oClass:Instance() // builds an object of this class + RETURN s_oClass:Instance() // builds an object of this class STATIC FUNCTION New() diff --git a/harbour/tests/clsdata.prg b/harbour/tests/clsdata.prg index 4ea61a30b7..aca5a849e4 100644 --- a/harbour/tests/clsdata.prg +++ b/harbour/tests/clsdata.prg @@ -16,20 +16,20 @@ PROCEDURE Main() FUNCTION TBaseObject() - STATIC oClass + STATIC s_oClass - IF oClass == NIL - oClass := HBClass():New( "TBaseObject" ) - oClass:AddData( "Data1" ) - oClass:AddClassData( "ClassData1" ) - oClass:AddMethod( "NewBase", @NewBase() ) - oClass:AddMethod( "Test", @Test() ) - oClass:AddMethod( "Method1", @Method1Base() ) - oClass:AddMethod( "Method2", @Method2Base() ) - oClass:Create() + IF s_oClass == NIL + s_oClass := HBClass():New( "TBaseObject" ) + s_oClass:AddData( "Data1" ) + s_oClass:AddClassData( "ClassData1" ) + s_oClass:AddMethod( "NewBase", @NewBase() ) + s_oClass:AddMethod( "Test", @Test() ) + s_oClass:AddMethod( "Method1", @Method1Base() ) + s_oClass:AddMethod( "Method2", @Method2Base() ) + s_oClass:Create() ENDIF - RETURN oClass:Instance() + RETURN s_oClass:Instance() STATIC FUNCTION NewBase() @@ -69,19 +69,19 @@ STATIC FUNCTION Method2Base() FUNCTION HBObject() - STATIC oClass + STATIC s_oClass - IF oClass == NIL - oClass := HBClass():New( "HBObject", "TBaseObject" ) - oClass:AddData( "Data2" ) - oClass:AddClassData( "ClassData2" ) - oClass:AddMethod( "New", @New() ) - oClass:AddMethod( "Method1", @Method1() ) - oClass:AddMethod( "Method2", @Method2() ) - oClass:Create() + IF s_oClass == NIL + s_oClass := HBClass():New( "HBObject", "TBaseObject" ) + s_oClass:AddData( "Data2" ) + s_oClass:AddClassData( "ClassData2" ) + s_oClass:AddMethod( "New", @New() ) + s_oClass:AddMethod( "Method1", @Method1() ) + s_oClass:AddMethod( "Method2", @Method2() ) + s_oClass:Create() ENDIF - RETURN oClass:Instance() + RETURN s_oClass:Instance() STATIC FUNCTION New() diff --git a/harbour/tests/debugtst.prg b/harbour/tests/debugtst.prg index 3061e158a3..25d6897635 100644 --- a/harbour/tests/debugtst.prg +++ b/harbour/tests/debugtst.prg @@ -14,50 +14,49 @@ * Placed in the public domain */ -#pragma warninglevel=1 - PROCEDURE Main() LOCAL oForm := TForm():New() LOCAL nNumber := 15 + HB_SYMBOL_UNUSED( nNumber ) + ? oForm:ClassName() oForm:Show() ? ? "-OBJECT additions-" ? "What is in oForm ? " - ? hb_ValToExp( oForm:Transfer() ) + ? hb_ValToExp( oForm:Transfer() ) - ? "Does transfer exists ? ", __objHasMsg ( oForm, "Transfer" ) - ? "Is transfer DATA ? ", __objHasData ( oForm, "Transfer" ) + ? "Does transfer exists ? ", __objHasMsg( oForm, "Transfer" ) + ? "Is transfer DATA ? ", __objHasData( oForm, "Transfer" ) ? "Is transfer METHOD ? ", __objHasMethod( oForm, "Transfer" ) - ? "Does nLeft exists ? ", __objHasMsg ( oForm, "nLeft" ) - ? "Is nLeft DATA ? ", __objHasData ( oForm, "nLeft" ) + ? "Does nLeft exists ? ", __objHasMsg( oForm, "nLeft" ) + ? "Is nLeft DATA ? ", __objHasData( oForm, "nLeft" ) ? "Is nLeft METHOD ? ", __objHasMethod( oForm, "nLeft" ) - ? "Does unknown exists ? ", __objHasMsg ( oForm, "Unknown" ) - ? "Is unknown DATA ? ", __objHasData ( oForm, "Unknown" ) + ? "Does unknown exists ? ", __objHasMsg( oForm, "Unknown" ) + ? "Is unknown DATA ? ", __objHasData( oForm, "Unknown" ) ? "Is unknown METHOD ? ", __objHasMethod( oForm, "Unknown" ) ? "Set nLeft to 50 and nRight to 100" oForm:Transfer( { "nLeft", 50 }, { "nRight", 100 } ) - ? hb_ValToExp( oForm:Transfer() ) + ? hb_ValToExp( oForm:Transfer() ) Pause() - ? "-DEBUG Functions-" ? "-Statics-" - ? hb_ValToExp( __dbgVMVarSList() ) + ? hb_ValToExp( __dbgVMVarSList() ) ? "-Global Stack-" - ? hb_ValToExp( __dbgVMStkGList() ) + ? hb_ValToExp( __dbgVMStkGList() ) ? "-Local Stack-" - ? hb_ValToExp( __dbgVMStkLList() ) + ? hb_ValToExp( __dbgVMStkLList() ) ? "-Parameters-" - ? hb_ValToExp( __dbgVMParLList() ) + ? hb_ValToExp( __dbgVMParLList() ) Pause() @@ -76,25 +75,32 @@ FUNCTION FuncSecond( nParam, cParam, uParam ) LOCAL xParam LOCAL xStack + HB_SYMBOL_UNUSED( cWhat ) + HB_SYMBOL_UNUSED( nNumber ) + + HB_SYMBOL_UNUSED( nParam ) + HB_SYMBOL_UNUSED( cParam ) + HB_SYMBOL_UNUSED( uParam ) + ? ? "-Second procedure-" ? ? "-Statics-" - ? hb_ValToExp( __dbgVMVarSList() ) + ? hb_ValToExp( __dbgVMVarSList() ) ? ? "-Global Stack- Len=", __dbgVMStkGCount() - ? hb_ValToExp( __dbgVMStkGList() ) + ? hb_ValToExp( __dbgVMStkGList() ) ? ? "-Local Stack- Len=", __dbgVMStkLCount() - ? hb_ValToExp( xStack := __dbgVMStkLList() ) + ? hb_ValToExp( xStack := __dbgVMStkLList() ) ? ? "-Parameters-" - ? hb_ValToExp( xParam := __dbgVMParLList() ) - IF xParam[ xStack[ 7 ] ] == "Hello" + ? hb_ValToExp( xParam := __dbgVMParLList() ) + IF ! Empty( xStack ) .AND. xParam[ xStack[ 7 ] ] == "Hello" ? ":-)" ENDIF @@ -110,27 +116,27 @@ FUNCTION FuncSecond( nParam, cParam, uParam ) FUNCTION TForm() - STATIC oClass + STATIC s_oClass - IF oClass == NIL - oClass := HBClass():New( "TFORM" ) // starts a new class definition + IF s_oClass == NIL + s_oClass := HBClass():New( "TFORM" ) // starts a new class definition - oClass:AddData( "cName" ) // define this class objects datas - oClass:AddData( "nTop" ) - oClass:AddData( "nLeft" ) - oClass:AddData( "nBottom" ) - oClass:AddData( "nRight" ) + s_oClass:AddData( "cName" ) // define this class objects datas + s_oClass:AddData( "nTop" ) + s_oClass:AddData( "nLeft" ) + s_oClass:AddData( "nBottom" ) + s_oClass:AddData( "nRight" ) - oClass:AddVirtual( "aExcept" ) // Export exceptions + s_oClass:AddVirtual( "aExcept" ) // Export exceptions - oClass:AddMethod( "New", @New() ) // define this class objects methods - oClass:AddMethod( "Show", @Show() ) - oClass:AddMethod( "Transfer", @Transfer() ) + s_oClass:AddMethod( "New", @New() ) // define this class objects methods + s_oClass:AddMethod( "Show", @Show() ) + s_oClass:AddMethod( "Transfer", @Transfer() ) - oClass:Create() // builds this class + s_oClass:Create() // builds this class ENDIF - RETURN oClass:Instance() // builds an object of this class + RETURN s_oClass:Instance() // builds an object of this class /* $Doc$ @@ -223,21 +229,19 @@ STATIC FUNCTION Show() // oTarget:Transfer( DbObject->Memo ) // -STATIC FUNCTION Transfer( x1, x2, x3, x4, x5, x6, x7, x8, x9, x10 ) /* etc */ +STATIC FUNCTION Transfer( ... ) LOCAL self := QSelf() LOCAL aParam := __dbgVMParLList() LOCAL nLen := PCount() LOCAL xRet LOCAL xData - LOCAL n IF nLen == 0 xRet := __objGetValueList( self, ::aExcept() ) ELSE - FOR n := 1 TO nLen + FOR EACH xData IN aParam - xData := aParam[ n ] IF HB_ISARRAY( xData ) IF HB_ISARRAY( xData[ 1 ] ) // 2D array passed @@ -249,7 +253,7 @@ STATIC FUNCTION Transfer( x1, x2, x3, x4, x5, x6, x7, x8, x9, x10 ) /* etc */ ELSEIF HB_ISOBJECT( xData ) // Object passed xRet := ::Transfer( xData:Transfer() ) ELSEIF !( ValType( xData ) == "U" ) - ? "TRANSFER: Incorrect argument(", n, ") ", xData + ? "TRANSFER: Incorrect argument(", xData:__enumIndex(), ") ", xData ENDIF NEXT diff --git a/harbour/tests/dynobj.prg b/harbour/tests/dynobj.prg index f44b769b86..f63c039eb4 100644 --- a/harbour/tests/dynobj.prg +++ b/harbour/tests/dynobj.prg @@ -18,7 +18,7 @@ PROCEDURE Main() LOCAL oForm := TForm():New() ? "What methods are in the class :" - ? hb_ValToExp( __objGetMethodList( oForm ) ) + ? hb_ValToExp( __objGetMethodList( oForm ) ) /* Let's add an inline at run-time. Should already be possible */ @@ -28,7 +28,7 @@ PROCEDURE Main() {| self | ( ::nRight - ::nLeft ) * ( ::nBottom - ::nTop ) } ) ? "What methods are in the class :" - ? hb_ValToExp( __objGetMethodList( oForm ) ) + ? hb_ValToExp( __objGetMethodList( oForm ) ) ? "What is the Form area ?" ? oForm:CalcArea() @@ -38,7 +38,7 @@ PROCEDURE Main() __objAddMethod( oForm, "Smile", @Smile() ) ? "What methods are in the class :" - ? hb_ValToExp( __objGetMethodList( oForm ) ) + ? hb_ValToExp( __objGetMethodList( oForm ) ) ? "Smile please " oForm:Smile() @@ -46,7 +46,7 @@ PROCEDURE Main() Pause() ? "Data items before" - ? hb_ValToExp( oForm ) + ? hb_ValToExp( oForm ) ? "Let's add an additional data item" @@ -55,7 +55,7 @@ PROCEDURE Main() oForm:cHelp := "This is a real tricky test" ? "Data items after" - ? hb_ValToExp( oForm ) + ? hb_ValToExp( oForm ) Pause() @@ -75,31 +75,31 @@ PROCEDURE Main() ? oForm:CalcArea() ? "What methods are in the class :" - ? hb_ValToExp( __objGetMethodList( oForm ) ) + ? hb_ValToExp( __objGetMethodList( oForm ) ) ? "Delete CalcArea" __objDelInline( oForm, "CalcArea" ) ? "What methods are in the class :" - ? hb_ValToExp( __objGetMethodList( oForm ) ) + ? hb_ValToExp( __objGetMethodList( oForm ) ) ? "Delete Smile" __objDelMethod( oForm, "Smile" ) ? "What methods are in the class :" - ? hb_ValToExp( __objGetMethodList( oForm ) ) + ? hb_ValToExp( __objGetMethodList( oForm ) ) Pause() ? "Data items before" - ? hb_ValToExp( oForm ) + ? hb_ValToExp( oForm ) ? "Let's delete cHelp" __objDelData( oForm, "cHelp" ) ? "Data items after" - ? hb_ValToExp( oForm ) + ? hb_ValToExp( oForm ) /* oForm:cHelp := "Please crash" */ @@ -107,24 +107,24 @@ PROCEDURE Main() FUNCTION TForm() - STATIC oClass + STATIC s_oClass - IF oClass == NIL - oClass := HBClass():New( "TFORM" ) // starts a new class definition + IF s_oClass == NIL + s_oClass := HBClass():New( "TFORM" ) // starts a new class definition - oClass:AddData( "cText" ) // define this class objects datas - oClass:AddData( "nTop" ) - oClass:AddData( "nLeft" ) - oClass:AddData( "nBottom" ) - oClass:AddData( "nRight" ) + s_oClass:AddData( "cText" ) // define this class objects datas + s_oClass:AddData( "nTop" ) + s_oClass:AddData( "nLeft" ) + s_oClass:AddData( "nBottom" ) + s_oClass:AddData( "nRight" ) - oClass:AddMethod( "New", @New() ) // define this class objects methods - oClass:AddInline( "Show", {| self | ::cText } ) + s_oClass:AddMethod( "New", @New() ) // define this class objects methods + s_oClass:AddInline( "Show", {| self | ::cText } ) - oClass:Create() // builds this class + s_oClass:Create() // builds this class ENDIF - RETURN oClass:Instance() // builds an object of this class + RETURN s_oClass:Instance() // builds an object of this class STATIC FUNCTION New() diff --git a/harbour/tests/inherit.prg b/harbour/tests/inherit.prg index 33a23af8a5..7ca627a308 100644 --- a/harbour/tests/inherit.prg +++ b/harbour/tests/inherit.prg @@ -25,11 +25,11 @@ PROCEDURE Main() oTo := TTextFile():New( "hello.out", "W" ) ? "What's in oFrom" - ? hb_ValToExp( { oFrom, __objGetMethodList( oFrom ) } ) + ? hb_ValToExp( { oFrom, __objGetMethodList( oFrom ) } ) ? ? "What's in oFrom:TEmpty" - ? hb_ValToExp( { oFrom:TEmpty, __objGetMethodList( oFrom:TEmpty ) } ) + ? hb_ValToExp( { oFrom:TEmpty, __objGetMethodList( oFrom:TEmpty ) } ) ? ? "Let's call Run() from TEmpty : " diff --git a/harbour/tests/inline.prg b/harbour/tests/inline.prg index 55111b1b18..bd0e86c086 100644 --- a/harbour/tests/inline.prg +++ b/harbour/tests/inline.prg @@ -19,24 +19,24 @@ PROCEDURE Main() FUNCTION TForm() - STATIC oClass + STATIC s_oClass - IF oClass == NIL - oClass := HBClass():New( "TFORM" ) // starts a new class definition + IF s_oClass == NIL + s_oClass := HBClass():New( "TFORM" ) // starts a new class definition - oClass:AddData( "cText" ) // define this class objects datas - oClass:AddData( "nTop" ) - oClass:AddData( "nLeft" ) - oClass:AddData( "nBottom" ) - oClass:AddData( "nRight" ) + s_oClass:AddData( "cText" ) // define this class objects datas + s_oClass:AddData( "nTop" ) + s_oClass:AddData( "nLeft" ) + s_oClass:AddData( "nBottom" ) + s_oClass:AddData( "nRight" ) - oClass:AddMethod( "New", @New() ) // define this class objects methods - oClass:AddInline( "Show", {| self | QOut( self:cText ) } ) + s_oClass:AddMethod( "New", @New() ) // define this class objects methods + s_oClass:AddInline( "Show", {| self | QOut( self:cText ) } ) - oClass:Create() // builds this class + s_oClass:Create() // builds this class ENDIF - RETURN oClass:Instance() // builds an object of this class + RETURN s_oClass:Instance() // builds an object of this class STATIC FUNCTION New() diff --git a/harbour/tests/inline_c.prg b/harbour/tests/inline_c.prg index b703c03b64..b3307935f6 100644 --- a/harbour/tests/inline_c.prg +++ b/harbour/tests/inline_c.prg @@ -10,7 +10,7 @@ PROCEDURE Main() RETURN -#pragma BEGINDUMP +#pragma begindump #include "hbapi.h" @@ -19,7 +19,7 @@ HB_FUNC( C_FUNC ) hb_retc( "returned from C_FUNC()\n" ); } -#pragma ENDDUMP +#pragma enddump FUNCTION EndDumpTest() RETURN "End Dump Test" diff --git a/harbour/tests/multifnc/multifnc.hbp b/harbour/tests/multifnc/multifnc.hbp index 0b4de01bd5..62f0a79819 100644 --- a/harbour/tests/multifnc/multifnc.hbp +++ b/harbour/tests/multifnc/multifnc.hbp @@ -2,8 +2,9 @@ # $Id$ # +# Testing dirty function overload -ldflag={allgcc}-Wl,--allow-multiple-definition --ldflag={allmsvc|allpocc|xcc}/force:multiple +-ldflag={allmsvc|allpocc|xcc|watcom}/force:multiple t0.prg t1.prg diff --git a/harbour/tests/multifnc/t1.prg b/harbour/tests/multifnc/t1.prg index c547861a47..0fec6ca3df 100644 --- a/harbour/tests/multifnc/t1.prg +++ b/harbour/tests/multifnc/t1.prg @@ -32,4 +32,4 @@ HB_FUNC( P7 ) { hb_retc( "P7:t1.prg" ); } -#pragma enddump \ No newline at end of file +#pragma enddump diff --git a/harbour/tests/objarr.prg b/harbour/tests/objarr.prg index 2b417dc72c..37d694bd0d 100644 --- a/harbour/tests/objarr.prg +++ b/harbour/tests/objarr.prg @@ -55,9 +55,9 @@ PROCEDURE Main() ? "To the power 3 : ", hb_ValToStr( o:x ) ? "Global stack" - ? hb_ValToExp( __dbgVMStkGList() ) + ? hb_ValToExp( __dbgVMStkGList() ) ? "Statics" - ? hb_ValToExp( __dbgVMVarSList() ) + ? hb_ValToExp( __dbgVMVarSList() ) RETURN diff --git a/harbour/tests/objasign.prg b/harbour/tests/objasign.prg index 6add1085f1..90347fed77 100644 --- a/harbour/tests/objasign.prg +++ b/harbour/tests/objasign.prg @@ -47,9 +47,9 @@ PROCEDURE Main() ? "To the power 3 : ", o:x ? "Global stack" - ? hb_ValToExp( __dbgVMStkGList() ) + ? hb_ValToExp( __dbgVMStkGList() ) ? "Statics" - ? hb_ValToExp( __dbgVMVarSList() ) + ? hb_ValToExp( __dbgVMVarSList() ) RETURN diff --git a/harbour/tests/stripem.prg b/harbour/tests/stripem.prg index 748caf4cf7..af736dfcb7 100644 --- a/harbour/tests/stripem.prg +++ b/harbour/tests/stripem.prg @@ -32,11 +32,11 @@ PROCEDURE Main( cFrom, cTo ) hb_default( @cTo, "strip.out" ) oFrom := TTextFile() -// ? hb_ValToExp( __objGetMethodList( oFrom ) ) +// ? hb_ValToExp( __objGetMethodList( oFrom ) ) oFrom:New( cFrom, "R" ) oTo := TTextFile() -// ? hb_ValToExp( __objGetMethodList( oTo ) ) - oTo:New( cTo , "W" ) +// ? hb_ValToExp( __objGetMethodList( oTo ) ) + oTo:New( cTo, "W" ) DO WHILE ! oFrom:Eof() cOut := oFrom:Run() diff --git a/harbour/tests/testhtml.prg b/harbour/tests/testhtml.prg index ebbf978145..c82364c7c4 100644 --- a/harbour/tests/testhtml.prg +++ b/harbour/tests/testhtml.prg @@ -102,7 +102,7 @@ METHOD AddPara( cPara, cAlign ) CLASS THTML METHOD Generate() CLASS THTML - ::cContent := ; + ::cContent := ; "" + hb_eol() + ; "" + ::cTitle + "" + hb_eol() + ; " puede ser módulo #: hbmk2.prg:7960 hbmk2.prg:11650 hbmk2.prg:13120 #, c-format -msgid "Options accepting macro variables also support command substitution. Enclose command inside ``, and, if the command contains space, also enclose in double quotes. F.e. \"-cflag=`wx-config --cflags`\", or ldflags={unix&gcc}\"`wx-config --libs`\"." +msgid "Options accepting macro variables also support command substitution. Enclose command inside ``, and, if the command contains space, also enclose in double quotes. Standard output of the command will be used as the value. F.e. \"-cflag=`wx-config --cflags`\", or ldflags={unix&gcc}\"`wx-config --libs`\"." msgstr "Tambien acepta Opciones de macros sustitución de comandos. Incluya comando dentro de ``, y, si el comando contiene espacios, también entre comillas dobles. F.e. \"-cflag==`wx-config -cflags`\", o ldflags={unix&gcc}\"`wx-config --libs`\"." #: hbmk2.prg:6872 hbmk2.prg:10136 hbmk2.prg:10862 @@ -943,7 +943,7 @@ msgstr "no agregue lista adicional de librerías del sistema a lista de librerí #: hbmk2.prg:7960 hbmk2.prg:11650 hbmk2.prg:13120 #, c-format -msgid "Platform filters are accepted in each .hbc line and with several options.\nFilter format: {[!][|||]}. Filters can be combined using '&', '|' operators and grouped by parentheses. Ex.: {win}, {gcc}, {linux|darwin}, {win&!pocc}, {(win|linux)&!watcom}, {unix&mt&gui}, -cflag={win}-DMYDEF, -stop{dos}, -stop{!allwin}" +msgid "Filters are accepted in each .hbc line and most options.\nFilters can be combined using '&' (and), '|' (or) operators, negated by '!' operator and grouped by parentheses. Ex.: {win}, {gcc}, {linux|darwin}, {win&!pocc}, {(win|linux)&!watcom}, {unix&mt&gui}, -cflag={win}-DMYDEF, -stop{dos}, -stop{!allwin}" msgstr "filtros para plataformas son aceptados en cada linea de archivo .hbc y con varias opciones.\nFormato de filtro: {[!][|||]}. Filtros pueden ser combinados usando los operadores '&', '|' y agrupados en parénteses. Ej.: {win}, {gcc}, {linux|darwin}, {win&!pocc}, {(win|linux)&!watcom}, {unix&mt&gui}, -cflag={win}-DMYDEF, -stop{dos}, -stop{!allwin}" #: hbmk2.prg:7555 hbmk2.prg:7672 hbmk2.prg:7755 hbmk2.prg:11163 hbmk2.prg:11284 hbmk2.prg:11408 hbmk2.prg:12183 hbmk2.prg:12311 hbmk2.prg:12459 diff --git a/harbour/utils/hbmk2/hbmk2.hu_HU.po b/harbour/utils/hbmk2/hbmk2.hu_HU.po index 75196ad558..adb62f736d 100644 --- a/harbour/utils/hbmk2/hbmk2.hu_HU.po +++ b/harbour/utils/hbmk2/hbmk2.hu_HU.po @@ -99,7 +99,7 @@ msgstr "Figyelem: Hibás -gt érték figyelmen kívül hagyva: %1$s" #: hbmk2.prg:7959 hbmk2.prg:11650 hbmk2.prg:13120 #, c-format -msgid "Platform filters are accepted in each .hbc line and with several options.\nFilter format: {[!][|||]}. Filters can be combined using '&', '|' operators and grouped by parentheses. Ex.: {win}, {gcc}, {linux|darwin}, {win&!pocc}, {(win|linux)&!watcom}, {unix&mt&gui}, -cflag={win}-DMYDEF, -stop{dos}, -stop{!allwin}" +msgid "Filters are accepted in each .hbc line and most options.\nFilters can be combined using '&' (and), '|' (or) operators, negated by '!' operator and grouped by parentheses. Ex.: {win}, {gcc}, {linux|darwin}, {win&!pocc}, {(win|linux)&!watcom}, {unix&mt&gui}, -cflag={win}-DMYDEF, -stop{dos}, -stop{!allwin}" msgstr "A szűrők az egyes .hbc sorokban használhatók és számos opció esetén támogatottak.\nSzűrő formátum: {[!][|||]}. Szűrők kombinálhatók '&', '|' operátorokkal és zárójelekkel csoportosíthatók. Pl.: {win}, {gcc}, {linux|darwin}, {win&!pocc}, {(win|linux)&!watcom}, {unix&mt&gui}, -cflag={win}-DMYDEF, -stop{dos}, -stop{!allwin}" #: hbmk2.prg:4128 hbmk2.prg:5633 hbmk2.prg:6212 @@ -689,7 +689,7 @@ msgstr "nyelvek listája, amelyek a .pot/.po és .hbl/.po állományokban levő #: hbmk2.prg:7959 hbmk2.prg:11650 hbmk2.prg:13120 #, c-format -msgid "Options accepting macro variables also support command substitution. Enclose command inside ``, and, if the command contains space, also enclose in double quotes. F.e. \"-cflag=`wx-config --cflags`\", or ldflags={unix&gcc}\"`wx-config --libs`\"." +msgid "Options accepting macro variables also support command substitution. Enclose command inside ``, and, if the command contains space, also enclose in double quotes. Standard output of the command will be used as the value. F.e. \"-cflag=`wx-config --cflags`\", or ldflags={unix&gcc}\"`wx-config --libs`\"." msgstr "" #: hbmk2.prg:7959 hbmk2.prg:11650 hbmk2.prg:13120 diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 4d9d378a3e..5f0efdb592 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -641,7 +641,7 @@ PROCEDURE __hbmk_public_entry( ... ) RETURN #elif defined( HBMK_USE_APPMAIN ) -/* for GNU Make build (we can't override default entry, so we use this alternate built-in one */ +/* for GNU Make build (we cannot override default entry, so we use this alternate built-in one */ PROCEDURE _APPMAIN( ... ) hbmk_local_entry( ... ) @@ -7481,7 +7481,7 @@ STATIC PROCEDURE AAddWithWarning( hbmk, aArray, cOption, aParam, lNew ) STATIC sc_aWarning := { ; "-Wl,--allow-multiple-definition", ; /* gcc */ "muldefs", ; /* ld '-z muldefs' */ - "force:multiple", ; /* msvc, pocc, watcom */ + "force:multiple", ; /* msvc, pocc, watcom, xcc */ "w-dup" , ; /* bcc */ "w-dpl" } /* bcc (for libs) */ @@ -7534,7 +7534,7 @@ STATIC FUNCTION CheckParamLibPath( hbmk, cPath ) ENDIF /* check against Harbour core lib directory in its legacy - (non multi-compiler/platform) location. It's even more + (non multi-compiler/platform) location. It is even more dangerous than above. */ IF ! hbmk[ _HBMK_lSysLoc ] .AND. ; hb_FileMatch( cPath, hb_PathNormalize( hb_DirSepAdd( hbmk[ _HBMK_cHB_INSTALL_PFX ] ) + "lib" ) ) @@ -9314,7 +9314,8 @@ STATIC PROCEDURE PlugIn_Load( hbmk, cFileName ) ENDIF IF ! Empty( hrb ) - IF ! PlugIn_call_low( hbmk, cFileName, hrb, PlugIn_make_ctx( hbmk, "init" ) ) + hbmk[ _HBMK_hPLUGINVars ][ cFileName ] := { => } + IF ! PlugIn_call_low( hbmk, cFileName, hrb, PlugIn_make_ctx( hbmk, "init", hbmk[ _HBMK_hPLUGINVars ][ cFileName ] ) ) /* Do not call plugin any further if initialization returned error */ IF hbmk[ _HBMK_lInfo ] _hbmk_OutErr( hbmk, hb_StrFormat( I_( "Error: Initializing plugin: %1$s" ), cFileName ) ) @@ -9573,12 +9574,12 @@ STATIC FUNCTION hbmk_SecToken() /* ; */ -STATIC FUNCTION PlugIn_make_ctx( hbmk, cState ) +STATIC FUNCTION PlugIn_make_ctx( hbmk, cState, hVars ) RETURN { ; "apiver" => _HBMK_PLUGIN_APIVER , ; "cSTATE" => cState , ; "params" => hbmk[ _HBMK_aPLUGINPars ] , ; - "vars" => hbmk[ _HBMK_hPLUGINVars ] , ; + "vars" => hVars , ; "cPLAT" => hbmk[ _HBMK_cPLAT ] , ; "cCOMP" => hbmk[ _HBMK_cCOMP ] , ; "nCOMPVer" => hbmk[ _HBMK_nCOMPVer ] , ; @@ -9645,14 +9646,12 @@ STATIC FUNCTION PlugIn_Execute_All( hbmk, cState ) LOCAL ctx LOCAL lSuccess := .T. - IF ! Empty( hbmk[ _HBMK_hPLUGINHRB ] ) - ctx := PlugIn_make_ctx( hbmk, cState ) - FOR EACH hrb IN hbmk[ _HBMK_hPLUGINHRB ] - IF ! PlugIn_call_low( hbmk, hrb:__enumKey(), hrb, ctx ) - lSuccess := .F. - ENDIF - NEXT - ENDIF + FOR EACH hrb IN hbmk[ _HBMK_hPLUGINHRB ] + ctx := PlugIn_make_ctx( hbmk, cState, hbmk[ _HBMK_hPLUGINVars ][ hrb:__enumKey() ] ) + IF ! PlugIn_call_low( hbmk, hrb:__enumKey(), hrb, ctx ) + lSuccess := .F. + ENDIF + NEXT RETURN lSuccess @@ -10306,7 +10305,7 @@ STATIC FUNCTION AutoConfPathList( lCWD, lForDocOutput ) LOCAL aPath := {} - /* It will form the output so that it doesn't contain + /* It will form the output so that it does not contain configuration specific (potentially sensitive) information by using generic term. */ hb_default( @lForDocOutput, .F. ) @@ -13697,7 +13696,7 @@ STATIC FUNCTION __hbshell_ConfigDir( lForDocOutput ) LOCAL cDir - /* It will form the output so that it doesn't contain + /* It will form the output so that it does not contain configuration specific (potentially sensitive) information by using generic term. */ hb_default( @lForDocOutput, .F. ) @@ -13814,7 +13813,7 @@ FUNCTION hbshell_ext_load( cName ) LOCAL cHBC LOCAL cVersion - IF ! Empty( cName ) + IF HB_ISSTRING( cName ) .AND. ! Empty( cName ) IF __hbshell_CanLoadDyn() IF !( cName $ hbsh[ _HBSH_hLibExt ] ) @@ -13866,7 +13865,7 @@ FUNCTION hbshell_ext_unload( cName ) LOCAL hbsh := hbsh() - IF cName $ hbsh[ _HBSH_hLibExt ] .AND. hbsh[ _HBSH_hLibExt ][ cName ] != NIL + IF HB_ISSTRING( cName ) .AND. cName $ hbsh[ _HBSH_hLibExt ] .AND. hbsh[ _HBSH_hLibExt ][ cName ] != NIL hb_HDel( hbsh[ _HBSH_hINCPATH ], cName ) hb_HDel( hbsh[ _HBSH_hCH ], cName ) hb_HDel( hbsh[ _HBSH_hOPTPRG ], cName ) @@ -14665,11 +14664,14 @@ FUNCTION hbshell_include( cName ) LOCAL hbsh := hbsh() - cName := Lower( cName ) + IF HB_ISSTRING( cName ) - IF !( cName $ hbsh[ _HBSH_hCHCORE ] ) .AND. __hbshell_TryHeader( cName ) - hbsh[ _HBSH_hCHCORE ][ cName ] := NIL - RETURN .T. + cName := Lower( cName ) + + IF !( cName $ hbsh[ _HBSH_hCHCORE ] ) .AND. __hbshell_TryHeader( cName ) + hbsh[ _HBSH_hCHCORE ][ cName ] := NIL + RETURN .T. + ENDIF ENDIF RETURN .F. @@ -14678,11 +14680,14 @@ FUNCTION hbshell_uninclude( cName ) LOCAL hbsh := hbsh() - cName := Lower( cName ) + IF HB_ISSTRING( cName ) - IF cName $ hbsh[ _HBSH_hCHCORE ] - hb_HDel( hbsh[ _HBSH_hCHCORE ], cName ) - RETURN .T. + cName := Lower( cName ) + + IF cName $ hbsh[ _HBSH_hCHCORE ] + hb_HDel( hbsh[ _HBSH_hCHCORE ], cName ) + RETURN .T. + ENDIF ENDIF RETURN .F. @@ -15443,7 +15448,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lFull, lLong ) { "-run[-]" , I_( "run/do not run output executable" ) }, ; { "-vcshead=" , I_( "generate .ch header file with local repository information. SVN, CVS, Git, Mercurial, Bazaar, Fossil and Monotone are currently supported. Generated header will define preprocessor constant _HBMK_VCS_TYPE_ with the name of detected VCS and _HBMK_VCS_ID_ with the unique ID of local repository" ) }, ; { "-tshead=" , I_( "generate .ch header file with timestamp information. Generated header will define preprocessor constants _HBMK_BUILD_DATE_, _HBMK_BUILD_TIME_, _HBMK_BUILD_TIMESTAMP_ with the date/time of build" ) }, ; - { "-icon=" , I_( "set as application icon. should be a supported format on the target platform" ) }, ; + { "-icon=" , I_( "set as application icon. should be a supported format on the target platform (not supported by some platforms/compilers). On Windows, it is implemented by generating and linking a resource file." ) }, ; { "-manifest=" , I_( "embed manifest in executable/dynamic lib (Windows only)" ) }, ; { "-sign=" , I_( "sign executable with (Windows and Darwin only)" ) }, ; { "-signpw=" , I_( "use as password when signing executable (Windows and Darwin only)" ) }, ; @@ -15481,7 +15486,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lFull, lLong ) { "-clean" , I_( "clean (in incremental build mode)" ) }, ; { "-workdir=" , hb_StrFormat( I_( e"working directory\n(default: %1$s// [*] in incremental mode, OS temp directory otherwise)" ), _WORKDIR_BASE_ ) }, ; NIL, ; - { "-hbcontainer" , I_( "virtual target, it doesn't create anything. Useful for creating an .hbp with the sole purpose of referencing subprojects" ) }, ; + { "-hbcontainer" , I_( "virtual target, it does not create anything. Useful for creating an .hbp with the sole purpose of referencing sub-projects" ) }, ; { "-hbimplib" , I_( "create import library (Windows only)" ) }, ; NIL, ; { "-hbl[=]" , hb_StrFormat( I_( "output .hbl filename. %1$s macro is accepted in filename" ), _LNG_MARKER ) }, ; @@ -15615,7 +15620,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lFull, lLong ) LOCAL aLst_File := { ; NIL, ; - { "*.hbp" , I_( "project file. Can contain command line options, expected to create an output. Lines beginning with '#' character are ignored, otherwise newline is optional, same rules apply as for the command-line." ) }, ; + { "*.hbp" , I_( "project file. Can contain command line options, expected to create an output. Lines beginning with '#' character are ignored, otherwise newline is optional, same rules apply as for the command-line. Each .hbp file reference will be executed as a sub-project." ) }, ; { "*.hbm" , I_( "collection of options. Can be used to collect common ones into a file and include that into project files. Lines beginning with '#' character are ignored, otherwise newline is optional, same rules apply as for the command-line." ) }, ; { "*.hbc" , I_( "collection of options that accompany components (aka 'libs', aka packages). Use different syntax than command-line and .hbp/.hbm files. Lines beginning with '#' character are ignored, each directive must be placed in separate lines." ) }, ; { "*.hb" , I_( "Harbour script" ) }, ; @@ -15669,7 +15674,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lFull, lLong ) { "${hb_first}" , I_( "Name of source file that holds the entry function (without directory and extension)" ) }, ; { "${hb_outputdir}" , I_( "Directory of the output" ) }, ; { "${hb_outputname}" , I_( "Name of the output (without extension)" ) }, ; - { "${hb_level}" , I_( "Subproject recursion level" ) }, ; + { "${hb_level}" , I_( "Sub-project recursion level" ) }, ; { "${}" , I_( "Returns the header directory of dependency , or '1' if it is not detected" ) }, ; { "${}" , I_( "Returns the value of the environment variable " ) } } @@ -15804,7 +15809,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lFull, lLong ) LOCAL aLst_PredBuild := { ; NIL, ; { hb_StrFormat( _HBMK_HAS_TPL, I_( "" ) ) , I_( "when dependency was detected" ) }, ; - { hb_StrFormat( _HBMK_DIR_TPL, I_( "" ) ) , I_( "return the header directory where was detected, or empty if it wasn't." ) }, ; + { hb_StrFormat( _HBMK_DIR_TPL, I_( "" ) ) , I_( "return the header directory where was detected, or empty if it was not." ) }, ; { hb_StrFormat( _HBMK_HAS_TPL_LOCAL, I_( "" ) ) , I_( "when dependency was detected in a location configured by -depincpathlocal= option" ) } } #ifndef _HBMK_EMBEDDED_ @@ -15848,7 +15853,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lFull, lLong ) { "hbmk_PathSepToTarget( hbmk, cFileName ) -> " , I_( "Convert filename to the format required for the target toolchain." ) }, ; { "hbmk_PathSepToForward( ) -> " , I_( "Convert filename to have forward slash directory separators." ) }, ; { "hbmk_PathFromWorkdirToCWD( hbmk ) -> " , I_( "Return relative path of -workdir= value from current working directory." ) }, ; - { "hbmk_FindInPath( , [], [] ) -> | NIL" , I_( "Find file in (array or pathsep delimited string are accepted) with list of alternate extensions. Returns filename if found and NIL if not." ) }, ; + { "hbmk_FindInPath( , [], [] ) -> | NIL" , I_( "Find file in (array or pathsep delimited string are accepted) with list of alternate extensions (defaults to executable binaries). Returns filename if found and NIL if not." ) }, ; { "hbmk_FNameDirExtSet( , [], [] ) -> " , I_( "Change directory and/or extension in filename." ) }, ; { "hbmk_FuncNameEncode( ) -> " , I_( "Encode function name according to Harbour compiler rules for forming HB_FUNC() function names in C code." ) }, ; { "hbmk_StrStripQuote( cString ) -> " , I_( "Strip double quote enclosure from a string." ) }, ; @@ -15863,7 +15868,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lFull, lLong ) { '"apiver"' , I_( "API version as an integer" ) }, ; { '"cSTATE"' , I_( "callback state. Can be: 'init', 'pre_all', 'pre_prg', 'pre_res', 'pre_c', 'pre_link', 'pre_lib', 'pre_cleanup', 'post_build', 'post_all'" ) }, ; { '"params"' , I_( "array of parameters passed to plugins via -pflag=/pi= options or having an extension registered via hbmk_Register_Input_File_Extension()" ) }, ; - { '"vars"' , I_( "hash of plugin custom variables. Common to all plugins, writable" ) }, ; + { '"vars"' , I_( "hash of plugin custom variables. Writable, local to each plugin" ) }, ; { '"cPLAT"' , I_( "-plat value" ) }, ; { '"cCOMP"' , I_( "-comp value" ) }, ; { '"nCOMPVer"' , I_( "see HB_COMPILER_VER envvar" ) }, ; @@ -15904,9 +15909,9 @@ STATIC PROCEDURE ShowHelp( hbmk, lFull, lLong ) I_( e"Regular Harbour compiler options are also accepted as is.\n(see them with -harbourhelp option)" ), ; hb_StrFormat( I_( "%1$s option file in %2$s directory is always processed if it exists. On *nix platforms ~/.harbour, /etc/harbour, /etc/harbour, /etc are checked (in that order) before the %2$s directory." ), _HBMK_AUTOHBC_NAME, _SELF_NAME_ ), ; hb_StrFormat( I_( "%1$s make script in current directory is always processed if it exists." ), _HBMK_AUTOHBM_NAME ), ; - I_( e"Platform filters are accepted in each .hbc line and with several options.\nFilter format: {[!][|||]}. Filters can be combined using '&', '|' operators and grouped by parentheses. Ex.: {win}, {gcc}, {linux|darwin}, {win&!pocc}, {(win|linux)&!watcom}, {unix&mt&gui}, -cflag={win}-DMYDEF, -stop{dos}, -stop{!allwin}" ), ; + I_( e"Filters are accepted in each .hbc line and most options.\nFilters can be combined using '&' (and), '|' (or) operators, negated by '!' operator and grouped by parentheses. Ex.: {win}, {gcc}, {linux|darwin}, {win&!pocc}, {(win|linux)&!watcom}, {unix&mt&gui}, -cflag={win}-DMYDEF, -stop{dos}, -stop{!allwin}" ), ; I_( "Most .hbc lines (libs=, hbcs=, prgflags=, cflags=, ldflags=, libpaths=, instfiles=, instpaths=, echo=) and corresponding command line parameters will accept macro variables. libpaths= also accepts %{hb_name} which translates to the name of the .hbc file under search." ), ; - I_( 'Options accepting macro variables also support command substitution. Enclose command inside ``, and, if the command contains space, also enclose in double quotes. F.e. "-cflag=`wx-config --cflags`", or ldflags={unix&gcc}"`wx-config --libs`".' ), ; + I_( e"Options accepting macro variables also support command substitution. Enclose command inside ``, and, if the command contains space, also enclose in double quotes. Standard output of the command will be used as the value. F.e. \"-cflag=`wx-config --cflags`\", or ldflags={unix&gcc}\"`wx-config --libs`\"." ), ; I_( "Libraries and object files built with/for CA-Cl*pper will not work with any supported platform/compiler." ), ; I_( "Defaults and feature support may vary by platform/compiler." ), ; hb_StrFormat( I_( "GNU Make or any C compiler specific make tool and MSYS (on Windows) are not needed to run %1$s." ), _SELF_NAME_ ), ; @@ -15933,8 +15938,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lFull, lLong ) e"and other required tools and call them appropriately. " + ; e"%1$s allows to extend the types of supported source files via plugins.\n" + ; e"Besides building executables, %1$s is able to run Harbour scripts directly, " + ; - e"and it also features an integrated shell prompt." + ; - e"" ), _SELF_NAME_ ) + e"and it also features an integrated shell prompt." ), _SELF_NAME_ ) LOCAL aLst_Desc := { ; NIL, ; @@ -16047,10 +16051,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lFull, lLong ) AEval( aHdr_APIShell, {| tmp | OutHdr( hbmk, tmp + _OUT_EOL ) } ) AEval( aLst_APIShell, {| tmp | OutOpt( hbmk, tmp, -1 ) } ) #endif - /* TODO: Move to separate section from notes: - - filter and macro syntax, %{}, subprojects - - shell plugins - */ + /* TODO: %{}, shell plugins */ ENDIF AEval( aHdr_ExampleBasic, {| tmp | OutOpt( hbmk, tmp, 0 ) } ) AEval( aLst_ExampleBasic, {| tmp | OutOpt( hbmk, tmp, -1 ) } ) diff --git a/harbour/utils/hbmk2/hbmk2.pt_BR.po b/harbour/utils/hbmk2/hbmk2.pt_BR.po index fd60f42694..ca8d7aae31 100644 --- a/harbour/utils/hbmk2/hbmk2.pt_BR.po +++ b/harbour/utils/hbmk2/hbmk2.pt_BR.po @@ -723,7 +723,7 @@ msgstr "especifique um novo alvo para compilação.