diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f7ac137742..aab3dffc86 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,37 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-11-16 14:46 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * include/hbsetup.ch + ! Minor fix in comments. + + * contrib/xhb/hbcompat.ch + + Added hb_rddInfo() translation for xhb apps. + + * common.mak + * include/hbextern.ch + * source/rtl/Makefile + + source/rtl/natmsgu.c + * source/rtl/natmsg.c + + Added Harbour internal version of undocument Clipper + Nat*() (and friends) calls. These are always available + in core. + Harbour __natIsAffirm() = Clipper IsAffirm() + Harbour __natIsNegative() = Clipper IsNegative() + Harbour __natMsg() = Clipper NationMsg() + Harbour __natSortVer() = Clipper _NatSortVer() + Harbour __natMsgVer() = Clipper _NatMsgVer() + + * utils/hbtest/rt_misc.prg + * source/rtl/dircmd.prg + * source/rtl/getsys.prg + * source/rtl/tgetlist.prg + * source/rtl/tlabel.prg + * source/rtl/treport.prg + ! Now using Harbour internal __NAT*() functions + instead of C5.x undocumented calls, so Harbour + will now compile with HB_C52_UNDOC turned off. + 2007-11-16 01:25 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + contrib/freeimage + contrib/freeimage/Makefile diff --git a/harbour/common.mak b/harbour/common.mak index db8e3d4983..e52d9eef8f 100644 --- a/harbour/common.mak +++ b/harbour/common.mak @@ -493,6 +493,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\mousex$(OBJEXT) \ $(OBJ_DIR)\mtran$(OBJEXT) \ $(OBJ_DIR)\natmsg$(OBJEXT) \ + $(OBJ_DIR)\natmsgu$(OBJEXT) \ $(OBJ_DIR)\net$(OBJEXT) \ $(OBJ_DIR)\oemansi$(OBJEXT) \ $(OBJ_DIR)\oemansix$(OBJEXT) \ diff --git a/harbour/contrib/xhb/hbcompat.ch b/harbour/contrib/xhb/hbcompat.ch index debae87b87..8cab12ca61 100644 --- a/harbour/contrib/xhb/hbcompat.ch +++ b/harbour/contrib/xhb/hbcompat.ch @@ -70,6 +70,7 @@ #xtranslate hb_setLastKey([])=> setLastKey() #xtranslate hb_CStr([]) => CStr() #xtranslate hb_DirExists() => IsDirectory() + #xtranslate hb_rddInfo([]) => rddInfo() #xtranslate hb_HexToNum([]) => HexToNum() #xtranslate hb_NumToHex([]) => NumToHex() diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index 0a301352cd..8b15339338 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -442,6 +442,12 @@ EXTERNAL __XSAVESCREEN /* Harbour internal functions */ +EXTERNAL __NATISAFFIRM +EXTERNAL __NATISNEGATIVE +EXTERNAL __NATMSG +EXTERNAL __NATSORTVER +EXTERNAL __NATMSGVER + EXTERNAL __DBSQL EXTERNAL __RDDGETTEMPALIAS EXTERNAL __GETMSGPRF diff --git a/harbour/include/hbsetup.ch b/harbour/include/hbsetup.ch index e9241f2638..dcb0b7fc37 100644 --- a/harbour/include/hbsetup.ch +++ b/harbour/include/hbsetup.ch @@ -60,8 +60,8 @@ different Clipper implementations. */ /* #define HB_EXTENSION */ /* Enable Harbour extensions */ -#define HB_C52_UNDOC /* Enable CA-Cl*pper 5.2e undocumented features */ -/* #define HB_C52_STRICT */ /* Enable CA-Cl*pper 5.2e strict compatibility */ +#define HB_C52_UNDOC /* Enable CA-Cl*pper 5.2e/5.3x undocumented features */ +/* #define HB_C52_STRICT */ /* Enable CA-Cl*pper 5.2e/5.3x strict compatibility */ #define HB_COMPAT_C53 /* Enable CA-Cl*pper 5.3x extensions */ #define HB_COMPAT_XPP /* Enable Alaska Xbase++ extensions */ /* #define HB_COMPAT_VO */ /* Enable CA-VO extensions */ diff --git a/harbour/source/rtl/Makefile b/harbour/source/rtl/Makefile index 2442b02319..c9fe28a938 100644 --- a/harbour/source/rtl/Makefile +++ b/harbour/source/rtl/Makefile @@ -84,6 +84,7 @@ C_SOURCES=\ mousex.c \ mtran.c \ natmsg.c \ + natmsgu.c \ net.c \ oemansi.c \ oemansix.c \ diff --git a/harbour/source/rtl/dircmd.prg b/harbour/source/rtl/dircmd.prg index 9c13e3ced1..1123db8c37 100644 --- a/harbour/source/rtl/dircmd.prg +++ b/harbour/source/rtl/dircmd.prg @@ -70,7 +70,7 @@ PROCEDURE __Dir( cFileMask ) #ifdef HB_C52_STRICT QOut( "Database Files # Records Last Update Size" ) #else - QOut( NationMsg( _DIR_HEADER ) ) + QOut( __NatMsg( _DIR_HEADER ) ) #endif AEval( Directory( hb_FNameMerge( Set( _SET_DEFAULT ), "*", ".dbf" ) ),; diff --git a/harbour/source/rtl/getsys.prg b/harbour/source/rtl/getsys.prg index 704c7f955b..f64fe67c29 100644 --- a/harbour/source/rtl/getsys.prg +++ b/harbour/source/rtl/getsys.prg @@ -314,8 +314,8 @@ FUNCTION RangeCheck( oGet, xDummy, xLow, xHigh ) IF Set( _SET_SCOREBOARD ) - cMessage := Left( NationMsg( _GET_RANGE_FROM ) + LTrim( Transform( xLow, "" ) ) + ; - NationMsg( _GET_RANGE_TO ) + LTrim( Transform( xHigh, "" ) ), MaxCol() ) + cMessage := Left( __NatMsg( _GET_RANGE_FROM ) + LTrim( Transform( xLow, "" ) ) + ; + __NatMsg( _GET_RANGE_TO ) + LTrim( Transform( xHigh, "" ) ), MaxCol() ) nOldRow := Row() nOldCol := Col() diff --git a/harbour/source/rtl/natmsg.c b/harbour/source/rtl/natmsg.c index 8d57b100c0..82d0500b51 100644 --- a/harbour/source/rtl/natmsg.c +++ b/harbour/source/rtl/natmsg.c @@ -55,8 +55,8 @@ * www - http://www.harbour-project.org * * Copyright 1999-2001 Viktor Szakats - * _NATSORTVER() - * _NATMSGVER() + * __NATSORTVER() + * __NATMSGVER() * * See doc/license.txt for licensing terms. * @@ -93,23 +93,21 @@ static char * hb_nationGetMsg( USHORT uiMsg ) return ( uiMsg >= 1 && uiMsg <= 13 ) ? ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_NATMSG + uiMsg - 1 ) : ( char * ) ""; } -#ifdef HB_C52_UNDOC - -HB_FUNC( ISAFFIRM ) +HB_FUNC( __NATISAFFIRM ) { PHB_ITEM pItem = hb_param( 1, HB_IT_STRING ); hb_retl( pItem && hb_itemGetCLen( pItem ) >= 1 && toupper( hb_itemGetCPtr( pItem )[ 0 ] ) == ( ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_NATMSG + _LF_YN - 1 ) )[ 0 ] ); } -HB_FUNC( ISNEGATIVE ) +HB_FUNC( __NATISNEGATIVE ) { PHB_ITEM pItem = hb_param( 1, HB_IT_STRING ); hb_retl( pItem && hb_itemGetCLen( pItem ) >= 1 && toupper( hb_itemGetCPtr( pItem )[ 0 ] ) == ( ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_NATMSG + _LF_YN - 1 ) )[ 2 ] ); } -HB_FUNC( NATIONMSG ) +HB_FUNC( __NATMSG ) { if( hb_pcount() == 0 ) /* TODO: Replace this with Language API call. */ @@ -120,10 +118,7 @@ HB_FUNC( NATIONMSG ) hb_retc( NULL ); } -/* NOTE: Intentionally using one leading underscore, like in Clipper. - [vszakats] */ - -HB_FUNC( _NATSORTVER ) +HB_FUNC( __NATSORTVER ) { /* NOTE: CA-Cl*pper 5.2e Intl. will return: "NATSORT v1.2i x14 19/Mar/93" */ /* NOTE: CA-Cl*pper 5.3 Intl. will return: "NATSORT v1.3i x19 06/Mar/95" */ @@ -131,15 +126,10 @@ HB_FUNC( _NATSORTVER ) hb_retc( "NATSORT (Harbour)" ); } -/* NOTE: Intentionally using one leading underscore, like in Clipper. - [vszakats] */ - -HB_FUNC( _NATMSGVER ) +HB_FUNC( __NATMSGVER ) { /* NOTE: CA-Cl*pper 5.2e Intl. will return: "NATMSGS v1.2i x14 19/Mar/93" */ /* NOTE: CA-Cl*pper 5.3 Intl. will return: "NATMSGS v1.3i x19 06/Mar/95" */ hb_retc( "NATMSGS (Harbour)" ); } - -#endif diff --git a/harbour/source/rtl/natmsgu.c b/harbour/source/rtl/natmsgu.c new file mode 100644 index 0000000000..2799183cf7 --- /dev/null +++ b/harbour/source/rtl/natmsgu.c @@ -0,0 +1,110 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * NATION undocumented functions + * + * Copyright 1999 Jose Lalin + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +/* + * The following parts are Copyright of the individual authors. + * www - http://www.harbour-project.org + * + * Copyright 1999-2001 Viktor Szakats + * _NATSORTVER() + * _NATMSGVER() + * + * See doc/license.txt for licensing terms. + * + */ + +#include "hbapi.h" + +#ifdef HB_C52_UNDOC + +HB_FUNC_EXTERN( __NATISAFFIRM ); + +HB_FUNC( ISAFFIRM ) +{ + HB_FUNC_EXEC( __NATISAFFIRM ) +} + +HB_FUNC_EXTERN( __NATISNEGATIVE ); + +HB_FUNC( ISNEGATIVE ) +{ + HB_FUNC_EXEC( __NATISNEGATIVE ) +} + +HB_FUNC_EXTERN( __NATISAFFIRM ); + +HB_FUNC( NATIONMSG ) +{ + HB_FUNC_EXEC( __NATMSG ) +} + +/* NOTE: Intentionally using one leading underscore, like in Clipper. + [vszakats] */ + +HB_FUNC_EXTERN( __NATSORTVER ); + +HB_FUNC( _NATSORTVER ) +{ + HB_FUNC_EXEC( __NATSORTVER ) +} + +/* NOTE: Intentionally using one leading underscore, like in Clipper. + [vszakats] */ + +HB_FUNC_EXTERN( __NATMSGVER ); + +HB_FUNC( _NATMSGVER ) +{ + HB_FUNC_EXEC( __NATMSGVER ) +} + +#endif diff --git a/harbour/source/rtl/tgetlist.prg b/harbour/source/rtl/tgetlist.prg index ab375320eb..4650103ec6 100644 --- a/harbour/source/rtl/tgetlist.prg +++ b/harbour/source/rtl/tgetlist.prg @@ -807,7 +807,7 @@ METHOD ShowScoreboard() CLASS HBGetList nOldCursor := SetCursor( SC_NONE ) - DispOutAt( SCORE_ROW, SCORE_COL, iif( Set( _SET_INSERT ), NationMsg( _GET_INSERT_ON ), NationMsg( _GET_INSERT_OFF ) ) ) + DispOutAt( SCORE_ROW, SCORE_COL, iif( Set( _SET_INSERT ), __NatMsg( _GET_INSERT_ON ), __NatMsg( _GET_INSERT_OFF ) ) ) SetPos( nRow, nCol ) SetCursor( nOldCursor ) @@ -826,13 +826,13 @@ METHOD DateMsg() CLASS HBGetList nRow := Row() nCol := Col() - DispOutAt( SCORE_ROW, SCORE_COL, NationMsg( _GET_INVD_DATE ) ) + DispOutAt( SCORE_ROW, SCORE_COL, __NatMsg( _GET_INVD_DATE ) ) SetPos( nRow, nCol ) DO WHILE NextKey() == 0 ENDDO - DispOutAt( SCORE_ROW, SCORE_COL, Space( Len( NationMsg( _GET_INVD_DATE ) ) ) ) + DispOutAt( SCORE_ROW, SCORE_COL, Space( Len( __NatMsg( _GET_INVD_DATE ) ) ) ) SetPos( nRow, nCol ) ENDIF diff --git a/harbour/source/rtl/tlabel.prg b/harbour/source/rtl/tlabel.prg index 530ab1fed4..856d49c1ff 100644 --- a/harbour/source/rtl/tlabel.prg +++ b/harbour/source/rtl/tlabel.prg @@ -328,7 +328,7 @@ METHOD SampleLabels() CLASS HBLabelForm ENDIF // Prompt for more - @ ROW(), 0 SAY NationMsg(_LF_SAMPLES)+" ("+Nationmsg(_LF_YN)+")" + @ ROW(), 0 SAY __NatMsg(_LF_SAMPLES)+" ("+__NatMsg(_LF_YN)+")" nGetKey := INKEY(0) @ ROW(), COL() SAY CHR(nGetKey) IF ROW() == MAXROW() @@ -337,7 +337,7 @@ METHOD SampleLabels() CLASS HBLabelForm ELSE @ ROW()+1, 0 SAY "" ENDIF - IF IsNegative(CHR(nGetKey)) // Don't give sample labels + IF __NatIsNegative(CHR(nGetKey)) // Don't give sample labels lMoreSamples := .F. ENDIF ENDDO diff --git a/harbour/source/rtl/treport.prg b/harbour/source/rtl/treport.prg index 760c53ebd4..c2f6fff3cc 100644 --- a/harbour/source/rtl/treport.prg +++ b/harbour/source/rtl/treport.prg @@ -334,8 +334,8 @@ METHOD New( cFrmName, lPrinter, cAltFile, lNoConsole, bFor, bWhile, nNext, nReco // Print the first line ::PrintIt( SPACE( ::aReportData[RPT_LMARGIN] ) + ; - iif( nGroup == 1, NationMsg( _RFRM_SUBTOTAL ),; - NationMsg( _RFRM_SUBSUBTOTAL ) ) ) + iif( nGroup == 1, __NatMsg( _RFRM_SUBTOTAL ),; + __NatMsg( _RFRM_SUBSUBTOTAL ) ) ) // Print the second line QQOUT( SPACE(::aReportData[RPT_LMARGIN]) ) @@ -379,7 +379,7 @@ METHOD New( cFrmName, lPrinter, cAltFile, lNoConsole, bFor, bWhile, nNext, nReco ENDIF // Print the first line - ::PrintIt( SPACE(::aReportData[RPT_LMARGIN]) + NationMsg(_RFRM_TOTAL ) ) + ::PrintIt( SPACE(::aReportData[RPT_LMARGIN]) + __NatMsg(_RFRM_TOTAL ) ) // Print the second line QQOUT( SPACE(::aReportData[RPT_LMARGIN]) ) @@ -471,7 +471,7 @@ METHOD ReportHeader() CLASS HBReportForm IF !::aReportData[RPT_PLAIN] IF ::aReportData[RPT_HEADING] == "" - AADD( aPageHeader,NationMsg(_RFRM_PAGENO) + STR(::nPageNumber,6)) + AADD( aPageHeader,__NatMsg(_RFRM_PAGENO) + STR(::nPageNumber,6)) ELSE aTempPgHeader:=ParseHeader( ::aReportData[RPT_HEADING],; @@ -489,7 +489,7 @@ METHOD ReportHeader() CLASS HBReportForm NEXT nHeadLine NEXT nLine aPageHeader[ 1 ] := STUFF(aPageHeader[ 1 ], 1, 14, ; - NationMsg(_RFRM_PAGENO)+STR(::nPageNumber,6)) + __NatMsg(_RFRM_PAGENO)+STR(::nPageNumber,6)) ENDIF AADD( aPageHeader, DTOC(DATE()) ) @@ -619,8 +619,8 @@ METHOD ExecuteReport() CLASS HBReportForm IF lGroupChanged .OR. MakeAStr(EVAL(::aReportData[RPT_GROUPS,nGroup,RGT_EXP]),; ::aReportData[RPT_GROUPS,nGroup,RGT_TYPE]) != ::aGroupTotals[nGroup] - AADD( aRecordHeader, iif( nGroup == 1, NationMsg(_RFRM_SUBTOTAL),; - NationMsg(_RFRM_SUBSUBTOTAL) ) ) + AADD( aRecordHeader, iif( nGroup == 1, __NatMsg(_RFRM_SUBTOTAL),; + __NatMsg(_RFRM_SUBSUBTOTAL) ) ) AADD( aRecordHeader, "" ) diff --git a/harbour/utils/hbtest/rt_misc.prg b/harbour/utils/hbtest/rt_misc.prg index 79208133a2..36079808bc 100644 --- a/harbour/utils/hbtest/rt_misc.prg +++ b/harbour/utils/hbtest/rt_misc.prg @@ -378,6 +378,17 @@ FUNCTION Main_MISC() /* NATION functions (do not exist in 5.2e US) */ +#ifdef __HARBOUR__ + #ifndef HB_C52_UNDOC + /* NOTE: Use the identical internal versions if Harbour + was compiled without C5.x undocumented features. + [vszakats] */ + #xtranslate NationMsg([]) => __NatMsg() + #xtranslate IsAffirm([]) => __NatIsAffirm() + #xtranslate IsNegative([]) => __NatIsNegative() + #endif +#endif + #ifndef __XPP__ TEST_LINE( NationMsg() , "Invalid argument" ) #endif