From 53030631bf0dc0c2e5e3aecef7a240abb7e6da61 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 7 May 2008 10:26:41 +0000 Subject: [PATCH] 2008-05-07 11:21 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * contrib/rddads/make_b32.bat * contrib/rddads/make_vc.bat * contrib/rddads/ads.ch * contrib/rddads/rddads.h * contrib/rddads/ads1.c * contrib/rddads/adsfunc.c * contrib/rddads/adsmgmnt.c + Added ACE version autodetection. You can override with: -DADS_LIB_VERSION=700 (and similar) (ADS_REQUIRE_VERSION still accepted for compatibility) ! Fixed a few lib version related problems. ! hMgmtHandle global renamed to ads_g_hMgmtHandle. * Formatting. * contrib/rddads/rddads.h + QUESTION: added about ADS_MAX_KEY_LENGTH redefinition. Is it needed? * source/compiler/hbmain.c * Changed output device (hb_compOutStd() -> hb_compOutErr()) for following texts: "Compiling..." "No code generated" "Lines x, Functions/Procedures x" This is to replicate CA-Cl*pper behaviour a bit more. * include/hbextern.ch * common.mak * source/rtl/Makefile * source/rtl/maxrow.c + source/rtl/scrrow.c * contrib/xhb/hbcompat.ch + Added hb_ScrMaxRow(), hb_ScrMaxCol() These will return the screen dimensions regardless of the size of an active window (when using CT windows for example). Functionality is the same as MaxRow(.T.) and MaxCol(.T.) previously. ! MaxRow()/MaxCol() extended parameters removed. + Added MaxRow(.T.)/MaxCol(.T.) conversions for xhb lib (hbcompat.ch) in both directions. ; XBase++ doesn't have any extended parameters for Max*() function. Flagship has two of them, both of them doing something different. CAVO doesn't have these functions at all. * contrib/xhb/hbcompat.ch ! GTI_* macros updated to HB_GTI_*. * source/vm/memvclip.c % Minor opt in __QQPUB(). * source/vm/extend.c * 0 -> NULL * source/vm/estack.c - QUESTION removed. * source/lang/msgbgmik.c * source/rtl/console.c * source/rtl/philes.c * source/rtl/adir.prg * source/rtl/getsys53.prg * source/rtl/getsys.prg * source/rtl/tget.prg * source/rtl/ttopbar.prg * source/rtl/pushbtn.prg * source/rtl/mod.c * source/rtl/memofile.c * source/rtl/radiobtn.prg * source/rtl/filesys.c * source/rtl/tbrowse.prg * source/vm/estack.c * source/vm/itemapi.c * source/vm/hvm.c * source/vm/cmdarg.c * source/vm/fm.c * source/vm/eval.c * source/common/hbver.c * source/common/expropt2.c * utils/hbtest/hbtest.prg * utils/hbtest/rt_misc.prg * utils/hbtest/rt_str.prg ! Comment fixes and minor formatting. --- harbour/ChangeLog | 86 ++++++++++++++++- harbour/common.mak | 1 + harbour/contrib/rddads/ads.ch | 6 +- harbour/contrib/rddads/ads1.c | 38 ++++---- harbour/contrib/rddads/adsfunc.c | 141 ++++++++++++++-------------- harbour/contrib/rddads/adsmgmnt.c | 86 +++++++++-------- harbour/contrib/rddads/make_b32.bat | 4 - harbour/contrib/rddads/make_vc.bat | 4 - harbour/contrib/rddads/rddads.h | 30 +++++- harbour/contrib/xhb/hbcompat.ch | 14 ++- harbour/include/hbextern.ch | 3 + harbour/source/common/expropt2.c | 2 +- harbour/source/common/hbver.c | 4 +- harbour/source/compiler/hbmain.c | 8 +- harbour/source/lang/msgbgmik.c | 2 +- harbour/source/rtl/Makefile | 1 + harbour/source/rtl/adir.prg | 2 +- harbour/source/rtl/console.c | 2 +- harbour/source/rtl/filesys.c | 8 +- harbour/source/rtl/getsys.prg | 2 +- harbour/source/rtl/getsys53.prg | 2 +- harbour/source/rtl/maxrow.c | 33 +------ harbour/source/rtl/memofile.c | 6 +- harbour/source/rtl/mod.c | 2 +- harbour/source/rtl/philes.c | 2 +- harbour/source/rtl/pushbtn.prg | 2 +- harbour/source/rtl/radiobtn.prg | 2 +- harbour/source/rtl/scrrow.c | 78 +++++++++++++++ harbour/source/rtl/tbrowse.prg | 8 +- harbour/source/rtl/tget.prg | 12 +-- harbour/source/rtl/ttopbar.prg | 2 +- harbour/source/vm/cmdarg.c | 8 +- harbour/source/vm/estack.c | 3 +- harbour/source/vm/eval.c | 10 +- harbour/source/vm/extend.c | 2 +- harbour/source/vm/fm.c | 2 +- harbour/source/vm/hvm.c | 2 +- harbour/source/vm/itemapi.c | 2 +- harbour/source/vm/memvclip.c | 16 ++-- harbour/utils/hbtest/hbtest.prg | 6 +- harbour/utils/hbtest/rt_misc.prg | 2 +- harbour/utils/hbtest/rt_str.prg | 2 +- 42 files changed, 409 insertions(+), 239 deletions(-) create mode 100644 harbour/source/rtl/scrrow.c diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8568ab55f7..83fcd94034 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,91 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-05-07 11:21 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * contrib/rddads/make_b32.bat + * contrib/rddads/make_vc.bat + * contrib/rddads/ads.ch + * contrib/rddads/rddads.h + * contrib/rddads/ads1.c + * contrib/rddads/adsfunc.c + * contrib/rddads/adsmgmnt.c + + Added ACE version autodetection. + You can override with: -DADS_LIB_VERSION=700 (and similar) + (ADS_REQUIRE_VERSION still accepted for compatibility) + ! Fixed a few lib version related problems. + ! hMgmtHandle global renamed to ads_g_hMgmtHandle. + * Formatting. + + * contrib/rddads/rddads.h + + QUESTION: added about ADS_MAX_KEY_LENGTH redefinition. + Is it needed? + + * source/compiler/hbmain.c + * Changed output device (hb_compOutStd() -> hb_compOutErr()) + for following texts: + "Compiling..." + "No code generated" + "Lines x, Functions/Procedures x" + This is to replicate CA-Cl*pper behaviour a bit more. + + * include/hbextern.ch + * common.mak + * source/rtl/Makefile + * source/rtl/maxrow.c + + source/rtl/scrrow.c + * contrib/xhb/hbcompat.ch + + Added hb_ScrMaxRow(), hb_ScrMaxCol() + These will return the screen dimensions regardless + of the size of an active window (when using CT + windows for example). Functionality is the same + as MaxRow(.T.) and MaxCol(.T.) previously. + ! MaxRow()/MaxCol() extended parameters removed. + + Added MaxRow(.T.)/MaxCol(.T.) conversions for + xhb lib (hbcompat.ch) in both directions. + ; XBase++ doesn't have any extended parameters + for Max*() function. Flagship has two of them, + both of them doing something different. CAVO doesn't + have these functions at all. + + * contrib/xhb/hbcompat.ch + ! GTI_* macros updated to HB_GTI_*. + + * source/vm/memvclip.c + % Minor opt in __QQPUB(). + + * source/vm/extend.c + * 0 -> NULL + + * source/vm/estack.c + - QUESTION removed. + + * source/lang/msgbgmik.c + * source/rtl/console.c + * source/rtl/philes.c + * source/rtl/adir.prg + * source/rtl/getsys53.prg + * source/rtl/getsys.prg + * source/rtl/tget.prg + * source/rtl/ttopbar.prg + * source/rtl/pushbtn.prg + * source/rtl/mod.c + * source/rtl/memofile.c + * source/rtl/radiobtn.prg + * source/rtl/filesys.c + * source/rtl/tbrowse.prg + * source/vm/estack.c + * source/vm/itemapi.c + * source/vm/hvm.c + * source/vm/cmdarg.c + * source/vm/fm.c + * source/vm/eval.c + * source/common/hbver.c + * source/common/expropt2.c + * utils/hbtest/hbtest.prg + * utils/hbtest/rt_misc.prg + * utils/hbtest/rt_str.prg + ! Comment fixes and minor formatting. + 2008-05-06 02:44 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/bin/hb-func.sh ! do not add .exe suffix if user added it explicitly in W32/DOS builds @@ -24,7 +109,6 @@ set C_USR=-DHB_PP_STRICT_LINEINFO_TOKEN %C_USR% and making clean build. - 2008-05-05 11:31 UTC+0100 Miguel Angel Marchuet Frutos * include/hbmemory.ch * source/vm/fm.c diff --git a/harbour/common.mak b/harbour/common.mak index 92d2666637..f6f313e92b 100644 --- a/harbour/common.mak +++ b/harbour/common.mak @@ -540,6 +540,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\samples$(OBJEXT) \ $(OBJ_DIR)\saverest$(OBJEXT) \ $(OBJ_DIR)\scroll$(OBJEXT) \ + $(OBJ_DIR)\scrrow$(OBJEXT) \ $(OBJ_DIR)\secondfs$(OBJEXT) \ $(OBJ_DIR)\seconds$(OBJEXT) \ $(OBJ_DIR)\set$(OBJEXT) \ diff --git a/harbour/contrib/rddads/ads.ch b/harbour/contrib/rddads/ads.ch index 59342f8cb4..dc8ea82974 100644 --- a/harbour/contrib/rddads/ads.ch +++ b/harbour/contrib/rddads/ads.ch @@ -109,9 +109,9 @@ /* If you want to limit your app to use an ADS version earlier than the current one, you must set this constant - ADS_REQUIRE_VERSION + ADS_LIB_VERSION to the *latest* version you want to allow/require, as in - -DADS_REQUIRE_VERSION=5 + -DADS_LIB_VERSION=500 As of 6/7/2004, the default supports linking to v6 and v7, as there are no v7-specific features yet. @@ -123,7 +123,7 @@ dll that imports these functions, and 2) Set this "define" when compiling rddads: - -DADS_REQUIRE_VERSION=5 + -DADS_LIB_VERSION=500 */ diff --git a/harbour/contrib/rddads/ads1.c b/harbour/contrib/rddads/ads1.c index 5e44b5d882..a3fb5e1639 100644 --- a/harbour/contrib/rddads/ads1.c +++ b/harbour/contrib/rddads/ads1.c @@ -174,7 +174,7 @@ static ERRCODE commonError( ADSAREAP pArea, USHORT uiGenCode, USHORT uiSubCode, hb_errPutOsCode( pError, uiOsCode ); if( szFileName ) hb_errPutFileName( pError, szFileName ); - if ( uiFlags ) + if( uiFlags ) hb_errPutFlags( pError, uiFlags ); errCode = SUPER_ERROR( ( AREAP ) pArea, pError ); hb_itemRelease( pError ); @@ -458,7 +458,7 @@ static void adsGetKeyItem( ADSAREAP pArea, PHB_ITEM pItem, int iKeyType, break; case ADS_DATE: - if ( pArea->iFileType == ADS_NTX ) + if( pArea->iFileType == ADS_NTX ) { hb_itemPutDS( pItem, pKeyBuf ); } @@ -565,7 +565,7 @@ static ERRCODE adsScopeSet( ADSAREAP pArea, ADSHANDLE hOrder, USHORT nScope, PHB { double dTemp; /* bTypeError = FALSE; */ - dTemp = hb_itemGetDL( pItem ) ; + dTemp = hb_itemGetDL( pItem ); u16DataType = ADS_DOUBLEKEY ; AdsSetScope( hOrder, nScope, (UNSIGNED8*) &dTemp, @@ -1072,7 +1072,7 @@ static ERRCODE adsSeek( ADSAREAP pArea, BOOL bSoftSeek, PHB_ITEM pKey, BOOL bFin */ if( SELF_SKIPFILTER( ( AREAP ) pArea, bFindLast ? -1 : 1 ) != SUCCESS ) { - if ( pucSavedKey ) + if( pucSavedKey ) { hb_xfree( pucSavedKey ); } @@ -1113,7 +1113,7 @@ static ERRCODE adsSeek( ADSAREAP pArea, BOOL bSoftSeek, PHB_ITEM pKey, BOOL bFin */ pArea->fBof = FALSE; - if ( pucSavedKey ) + if( pucSavedKey ) { hb_xfree( pucSavedKey ); } @@ -1874,7 +1874,7 @@ static ERRCODE adsFlush( ADSAREAP pArea ) if( !pArea->fReadonly ) { AdsWriteRecord( pArea->hTable ); -#if ADS_REQUIRE_VERSION >= 6 +#if ADS_LIB_VERSION >= 600 if( hb_setGetL( HB_SET_HARDCOMMIT ) ) { AdsFlushFileBuffers( pArea->hTable ); @@ -1984,7 +1984,7 @@ static ERRCODE adsGetValue( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) hb_itemPutNLLen( pItem, ( LONG ) lVal, 11 ); break; } -#if ADS_REQUIRE_VERSION >= 700 && !defined(HB_LONG_LONG_OFF) +#if ADS_LIB_VERSION >= 700 && !defined(HB_LONG_LONG_OFF) case HB_FT_AUTOINC: { @@ -2583,7 +2583,7 @@ static ERRCODE adsCreate( ADSAREAP pArea, LPDBOPENINFO pCreateInfo ) */ uiLen = ( UNSIGNED32 ) pArea->uiFieldCount * (pArea->uiMaxFieldNameLength + 20) + 1; - if ( uiLen > 65135 ) + if( uiLen > 65135 ) { uiLen = 65135; } @@ -3448,7 +3448,7 @@ static ERRCODE adsOrderListClear( ADSAREAP pArea ) { HB_TRACE(HB_TR_DEBUG, ("adsOrderListClear(%p)", pArea)); -#if ADS_REQUIRE_VERSION >= 6 +#if ADS_LIB_VERSION >= 600 if( !pArea->fReadonly ) { AdsFlushFileBuffers( pArea->hTable ); /* meaningful with local server; ignored by remote server */ @@ -3539,7 +3539,7 @@ static ERRCODE adsOrderListFocus( ADSAREAP pArea, LPDBORDERINFO pOrderInfo ) if( u32RetVal != AE_SUCCESS ) { /* ntx compatibilty: keep current order if failed */ - if ( pArea->iFileType == ADS_NTX ) + if( pArea->iFileType == ADS_NTX ) return SUCCESS; pArea->hOrdCurrent = 0; @@ -3917,7 +3917,7 @@ static ERRCODE adsOrderInfo( ADSAREAP pArea, USHORT uiIndex, LPDBORDERINFO pOrde break; case DBOI_POSITION : - if ( pOrderInfo->itmNewVal && HB_IS_NUMERIC( pOrderInfo->itmNewVal ) ) + if( pOrderInfo->itmNewVal && HB_IS_NUMERIC( pOrderInfo->itmNewVal ) ) { /* TODO: results will be wrong if filter is not valid for ADS server */ AdsGotoTop( hIndex ); @@ -3933,12 +3933,12 @@ static ERRCODE adsOrderInfo( ADSAREAP pArea, USHORT uiIndex, LPDBORDERINFO pOrde { if( hIndex ) { - UNSIGNED16 usFilterOption = ( pArea->dbfi.itmCobExpr ? ADS_RESPECTFILTERS : ADS_RESPECTSCOPES ) ; + UNSIGNED16 usFilterOption = ( pArea->dbfi.itmCobExpr ? ADS_RESPECTFILTERS : ADS_RESPECTSCOPES ); AdsGetKeyNum( hIndex, usFilterOption, &u32); } else { - UNSIGNED16 usFilterOption = ( pArea->dbfi.itmCobExpr ? ADS_RESPECTFILTERS : ADS_IGNOREFILTERS ) ; + UNSIGNED16 usFilterOption = ( pArea->dbfi.itmCobExpr ? ADS_RESPECTFILTERS : ADS_IGNOREFILTERS ); AdsGetRecordNum( pArea->hTable, usFilterOption, &u32); } /* @@ -4073,7 +4073,7 @@ static ERRCODE adsOrderInfo( ADSAREAP pArea, USHORT uiIndex, LPDBORDERINFO pOrde */ if( hIndex ) { - if ( pArea->dbfi.itmCobExpr ) + if( pArea->dbfi.itmCobExpr ) { AdsGetScope( hIndex, ADS_BOTTOM, aucBuffer, &u16len ); @@ -4181,7 +4181,7 @@ static ERRCODE adsOrderInfo( ADSAREAP pArea, USHORT uiIndex, LPDBORDERINFO pOrde { if( pOrderInfo->itmResult ) { - adsScopeGet( pArea, hIndex, 0, pOrderInfo->itmResult ) ; + adsScopeGet( pArea, hIndex, 0, pOrderInfo->itmResult ); } AdsClearScope( hIndex, ADS_TOP ); /* ADS scopes are 1/2 instead of 0/1 */ } @@ -4196,7 +4196,7 @@ static ERRCODE adsOrderInfo( ADSAREAP pArea, USHORT uiIndex, LPDBORDERINFO pOrde { if( pOrderInfo->itmResult ) { - adsScopeGet( pArea, hIndex, 1, pOrderInfo->itmResult ) ; + adsScopeGet( pArea, hIndex, 1, pOrderInfo->itmResult ); } AdsClearScope( hIndex, ADS_BOTTOM ); } @@ -4438,7 +4438,7 @@ static ERRCODE adsLock( ADSAREAP pArea, LPDBLOCKINFO pLockInfo ) HB_TRACE(HB_TR_DEBUG, ("adsLock(%p, %p)", pArea, pLockInfo)); - ulRecNo = ( ULONG ) hb_itemGetNL( pLockInfo->itmRecID ) ; + ulRecNo = ( ULONG ) hb_itemGetNL( pLockInfo->itmRecID ); switch( pLockInfo->uiMethod ) { @@ -4692,7 +4692,7 @@ static ERRCODE adsExit( LPRDDNODE pRDD ) { if( s_iSetListenerHandle ) { - hb_setListenerRemove( s_iSetListenerHandle ) ; + hb_setListenerRemove( s_iSetListenerHandle ); s_iSetListenerHandle = 0; } #ifdef __BORLANDC__ @@ -4878,7 +4878,7 @@ static void adsRegisterRDD( USHORT * pusRddId ) if( uiCount ) * uiCount = RDDFUNCSCOUNT; errCode = hb_rddInherit( pTable, &adsTable, &adsSuper, NULL ); - if ( errCode == SUCCESS ) + if( errCode == SUCCESS ) { /* * we successfully register our RDD so now we can initialize it diff --git a/harbour/contrib/rddads/adsfunc.c b/harbour/contrib/rddads/adsfunc.c index 26a64f3f6c..51a60500ad 100644 --- a/harbour/contrib/rddads/adsfunc.c +++ b/harbour/contrib/rddads/adsfunc.c @@ -227,7 +227,7 @@ HB_FUNC( ADSGETCONNECTIONTYPE ) if( hConnToCheck ) { - ulRetVal = AdsGetConnectionType ( hConnToCheck, &pusConnectType ) ; + ulRetVal = AdsGetConnectionType ( hConnToCheck, &pusConnectType ); if( ulRetVal != AE_SUCCESS ) { // it may have set an error value, or leave as 0. @@ -274,11 +274,11 @@ HB_FUNC( ADSGETTABLECONTYPE ) { AdsGetTableConnection( pArea->hTable, &pTableConnectHandle ); - if ( pTableConnectHandle ) + if( pTableConnectHandle ) { - ulRetVal = AdsGetConnectionType( pTableConnectHandle, &pusConnectType ) ; + ulRetVal = AdsGetConnectionType( pTableConnectHandle, &pusConnectType ); - if ( ulRetVal != AE_SUCCESS ) + if( ulRetVal != AE_SUCCESS ) { pusConnectType = 0; } @@ -306,7 +306,7 @@ HB_FUNC( ADSGETSERVERTIME ) if( ulRetVal == AE_SUCCESS ) { - hb_reta( 3 ) ; + hb_reta( 3 ); hb_storc( (char * )pucDateBuf, -1, 1 ); hb_storc( (char *) pucTimeBuf, -1, 2 ); hb_stornl( plTime, -1, 3 ); @@ -331,7 +331,7 @@ HB_FUNC( ADSISTABLELOCKED ) ulRetVal = AdsIsTableLocked( pArea->hTable, &pbLocked ); } - if ( ulRetVal != AE_SUCCESS ) + if( ulRetVal != AE_SUCCESS ) { hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "ADSISTABLELOCKED" ); } @@ -409,7 +409,6 @@ HB_FUNC( ADSSETCHARTYPE ) #endif } hb_retni( oldType ); - return; } // return whether the current table is opened with OEM or ANSI character set @@ -419,7 +418,6 @@ HB_FUNC( ADSGETTABLECHARTYPE ) ADSAREAP pArea = hb_rddGetADSWorkAreaPointer(); AdsGetTableCharType( pArea->hTable, &usCharType ); hb_retni( usCharType ); - return; } @@ -460,7 +458,7 @@ HB_FUNC( ADSSETDELETED ) UNSIGNED16 usShowDeleted = hb_parl( 1 ); UNSIGNED16 pbShowDeleted ; - AdsGetDeleted( &pbShowDeleted ) ; + AdsGetDeleted( &pbShowDeleted ); hb_retl( ! pbShowDeleted ); if( ISLOG( 1 ) ) @@ -474,7 +472,7 @@ HB_FUNC( ADSSETEXACT ) UNSIGNED16 usExact = hb_parl( 1 ); UNSIGNED16 pbExact ; - AdsGetExact( &pbExact ) ; + AdsGetExact( &pbExact ); hb_retl( pbExact ); if( ISLOG( 1 ) ) @@ -502,11 +500,11 @@ HB_FUNC( ADSBLOB2FILE ) ulRetVal = AdsBinaryToFile( pArea->hTable, (UNSIGNED8*)szFieldName, (UNSIGNED8*)szFileName ); if( ulRetVal == AE_SUCCESS ) { - hb_retl( 1 ); + hb_retl( TRUE ); } else { - hb_retl( 0 ); + hb_retl( FALSE ); } } @@ -539,11 +537,11 @@ HB_FUNC( ADSFILE2BLOB ) ulRetVal = AdsFileToBinary( pArea->hTable, (UNSIGNED8*)szFieldName, usBinaryType, (UNSIGNED8*)szFileName ); if( ulRetVal == AE_SUCCESS ) { - hb_retl( 1 ); + hb_retl( TRUE ); } else { - hb_retl( 0 ); + hb_retl( FALSE ); } } @@ -561,7 +559,7 @@ HB_FUNC( ADSKEYNO ) PHB_ITEM pFilterOption = hb_param( 3, HB_IT_NUMERIC ); /* if arg 1 or 3 is bad, toss error */ - if ( ( pxOrder != NULL && !HB_IS_STRING( pxOrder ) && !HB_IS_NUMBER( pxOrder ) && !HB_IS_NIL( pxOrder ) ) || + if( ( pxOrder != NULL && !HB_IS_STRING( pxOrder ) && !HB_IS_NUMBER( pxOrder ) && !HB_IS_NIL( pxOrder ) ) || ( pFilterOption != NULL && !HB_IS_NUMBER( pFilterOption ) ) ) { hb_errRT_DBCMD( EG_ARG, 1014, NULL, "ADSKEYNO" ); @@ -635,13 +633,13 @@ HB_FUNC( ADSKEYCOUNT ) /* 2nd parameter: unsupported Bag Name. */ PHB_ITEM pFilterOption = hb_param( 3, HB_IT_NUMERIC ); - if ( pxOrder != NULL && HB_IS_NIL( pxOrder ) ) + if( pxOrder != NULL && HB_IS_NIL( pxOrder ) ) { pxOrder = NULL; // simplifies arg checks below } /* if arg 1 or 3 is bad, toss error */ - if ( ( pxOrder != NULL && !HB_IS_STRING( pxOrder ) && !HB_IS_NUMBER( pxOrder ) ) || + if( ( pxOrder != NULL && !HB_IS_STRING( pxOrder ) && !HB_IS_NUMBER( pxOrder ) ) || ( pFilterOption != NULL && !HB_IS_NUMBER( pFilterOption ) ) ) { hb_errRT_DBCMD( EG_ARG, 1014, NULL, "ADSKEYCOUNT" ); @@ -1005,11 +1003,11 @@ HB_FUNC( ADSISRECORDINAOF ) if( ulRetVal == AE_SUCCESS && bIsInAOF ) { - hb_retl( 1 ); + hb_retl( TRUE ); } else { - hb_retl( 0 ); + hb_retl( FALSE ); } } else @@ -1313,16 +1311,16 @@ HB_FUNC( ADSCONNECT ) if( ulRetVal == AE_SUCCESS ) { adsConnectHandle = hConnect; - hb_retl( 1 ); + hb_retl( TRUE ); } else { - hb_retl( 0 ); + hb_retl( FALSE ); } } else { - hb_retl( 0 ); + hb_retl( FALSE ); } } @@ -1343,22 +1341,22 @@ HB_FUNC( ADSDISCONNECT ) // Only allow disconnect of 0 if explicitly passed or adsConnectHandle is 0 // (hConnect might be 0 if caller accidentally disconnects twice; this should not close all connections!) - if ( hConnect != 0 || ISNUM( 1 ) ) + if( hConnect != 0 || ISNUM( 1 ) ) { ulRetVal = AdsDisconnect( hConnect ); } if( ulRetVal == AE_SUCCESS ) { - if ( hConnect == adsConnectHandle ) + if( hConnect == adsConnectHandle ) { adsConnectHandle = 0; } - hb_retl( 1 ); + hb_retl( TRUE ); } else { - hb_retl( 0 ); + hb_retl( FALSE ); } } @@ -1543,17 +1541,17 @@ bh removed test for adsConnectHandle as it is not actually used; { adsCloseCursor( pArea ); } - hb_retl( 1 ); + hb_retl( TRUE ); } else { AdsShowError( (UNSIGNED8 *) "ExecuteSQL error:" ); - hb_retl( 0 ); + hb_retl( FALSE ); } } else { - hb_retl( 0 ); + hb_retl( FALSE ); } } @@ -1607,7 +1605,7 @@ HB_FUNC( ADSCOPYTABLE ) if( ulRetVal == AE_SUCCESS ) { - hb_retl( 1 ); + hb_retl( TRUE ); return; } } @@ -1621,7 +1619,7 @@ HB_FUNC( ADSCOPYTABLE ) { hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "ADSCOPYTABLE" ); } - hb_retl( 0 ); + hb_retl( FALSE ); } @@ -1819,7 +1817,7 @@ HB_FUNC( ADSGETNUMOPENTABLES ) { UNSIGNED16 pusNum = 0; - AdsGetNumOpenTables( &pusNum ) ; + AdsGetNumOpenTables( &pusNum ); hb_retnl( pusNum ); } @@ -1951,11 +1949,11 @@ HB_FUNC( ADSREINDEX ) if( ulRetVal == AE_SUCCESS ) { - hb_retl( 1 ); + hb_retl( TRUE ); } else { - hb_retl( 0 ); + hb_retl( FALSE ); } } @@ -2037,9 +2035,9 @@ HB_FUNC( ADSISEMPTY ) hb_retl( pbEmpty ); } -#if ADS_REQUIRE_VERSION >= 6 +#if ADS_LIB_VERSION >= 620 -HB_FUNC( ADSGETNUMACTIVELINKS ) // requires 6.2 ! Only valid for a DataDict +HB_FUNC( ADSGETNUMACTIVELINKS ) // Only valid for a DataDict { UNSIGNED16 pusNumLinks = 0; ADSHANDLE hConnect = HB_ADS_PARCONNECTION( 1 ); @@ -2051,6 +2049,9 @@ HB_FUNC( ADSGETNUMACTIVELINKS ) // requires 6.2 ! Only valid for a DataD hb_retnl( pusNumLinks ); } +#endif + +#if ADS_LIB_VERSION >= 600 HB_FUNC( ADSDDADDTABLE ) { @@ -2064,11 +2065,11 @@ HB_FUNC( ADSDDADDTABLE ) if( ulRetVal == AE_SUCCESS ) { - hb_retl( 1 ); + hb_retl( TRUE ); } else { - hb_retl( 0 ); + hb_retl( FALSE ); } } @@ -2083,11 +2084,11 @@ HB_FUNC( ADSDDREMOVETABLE ) if( ulRetVal == AE_SUCCESS ) { - hb_retl( 1 ); + hb_retl( TRUE ); } else { - hb_retl( 0 ); + hb_retl( FALSE ); } } @@ -2103,11 +2104,11 @@ HB_FUNC( ADSDDREMOVEINDEXFILE ) if( ulRetVal == AE_SUCCESS ) { - hb_retl( 1 ); + hb_retl( TRUE ); } else { - hb_retl( 0 ); + hb_retl( FALSE ); } } @@ -2122,11 +2123,11 @@ HB_FUNC( ADSDDADDUSERTOGROUP ) if( ulRetVal == AE_SUCCESS ) { - hb_retl( 1 ); + hb_retl( TRUE ); } else { - hb_retl( 0 ); + hb_retl( FALSE ); } } @@ -2142,11 +2143,11 @@ HB_FUNC( ADSDDREMOVEUSERFROMGROUP ) if( ulRetVal == AE_SUCCESS ) { - hb_retl( 1 ); + hb_retl( TRUE ); } else { - hb_retl( 0 ); + hb_retl( FALSE ); } } @@ -2176,11 +2177,11 @@ HB_FUNC( ADSCONNECT60 ) { hb_stornl( hConnect, 6 ); } - hb_retl( 1 ); + hb_retl( TRUE ); } else { - hb_retl( 0 ); + hb_retl( FALSE ); } } @@ -2242,7 +2243,7 @@ HB_FUNC( ADSDDGETDATABASEPROPERTY ) BOOL bChar = FALSE; ADSHANDLE hConnect = HB_ADS_PARCONNECTION( 2 ); - switch ( ulProperty ) + switch( ulProperty ) { case ADS_DD_COMMENT: case ADS_DD_DEFAULT_TABLE_PATH: @@ -2298,7 +2299,7 @@ HB_FUNC( ADSDDSETDATABASEPROPERTY ) UNSIGNED32 ulRetVal; UNSIGNED16 ulBuffer; UNSIGNED16 ulProperty = ( UNSIGNED16 ) hb_parni( 1 ); - PHB_ITEM pParam = hb_param( 2, HB_IT_ANY ) ; + PHB_ITEM pParam = hb_param( 2, HB_IT_ANY ); ADSHANDLE hConnect = HB_ADS_PARCONNECTION( 3 ); switch( ulProperty ) @@ -2315,17 +2316,19 @@ HB_FUNC( ADSDDSETDATABASEPROPERTY ) } case ADS_DD_MAX_FAILED_ATTEMPTS: case ADS_DD_INTERNET_SECURITY_LEVEL: +#if ADS_LIB_VERSION >= 620 case ADS_DD_VERSION_MAJOR: case ADS_DD_VERSION_MINOR: +#endif { ulBuffer = hb_itemGetNI( pParam ); ulRetVal = AdsDDSetDatabaseProperty( hConnect, ulProperty, &ulBuffer, 2 ); break; } - case ADS_DD_LOG_IN_REQUIRED: - case ADS_DD_VERIFY_ACCESS_RIGHTS: - case ADS_DD_ENCRYPT_NEW_TABLE: - case ADS_DD_ENABLE_INTERNET: + case ADS_DD_LOG_IN_REQUIRED: + case ADS_DD_VERIFY_ACCESS_RIGHTS: + case ADS_DD_ENCRYPT_NEW_TABLE: + case ADS_DD_ENABLE_INTERNET: { ulBuffer = hb_itemGetL( pParam ); ulRetVal = AdsDDSetDatabaseProperty( hConnect, ulProperty, &ulBuffer, 2 ); @@ -2337,7 +2340,7 @@ HB_FUNC( ADSDDSETDATABASEPROPERTY ) break; } } - hb_retl( ulRetVal == AE_SUCCESS); + hb_retl( ulRetVal == AE_SUCCESS ); } /* @@ -2367,7 +2370,7 @@ HB_FUNC( ADSDDGETUSERPROPERTY ) ulRetVal = AdsDDGetUserProperty( hConnect, pucUserName, usPropertyID, pvProperty, &usPropertyLen ); - if (ulRetVal == AE_SUCCESS ) + if(ulRetVal == AE_SUCCESS ) { hb_storc( (char *) pvProperty, 3 ); } @@ -2422,11 +2425,11 @@ HB_FUNC( ADSTESTLOGIN ) pvProperty, &usPropertyLen ); } AdsDisconnect( adsTestHandle ); - hb_retl( 1 ) ; + hb_retl( TRUE ); } else { - hb_retl( 0 ) ; + hb_retl( FALSE ); } } @@ -2479,11 +2482,11 @@ HB_FUNC( ADSCOPYTABLECONTENTS ) ADS_IGNOREFILTERS ); if( ulRetVal == AE_SUCCESS ) { - hb_retl( 1 ); + hb_retl( TRUE ); } else { - hb_retl( 0 ); + hb_retl( FALSE ); } } } @@ -2504,7 +2507,7 @@ HB_FUNC( ADSDIRECTORY ) UNSIGNED32 ulRetVal; UNSIGNED8 ucFileName[ ADS_MAX_TABLE_NAME ]; UNSIGNED16 usFileNameLen; -#if ADS_REQUIRE_VERSION >= 900 +#if ADS_LIB_VERSION >= 900 ADSHANDLE sHandle = 0; #else SIGNED32 sHandle = 0; @@ -2517,7 +2520,7 @@ HB_FUNC( ADSDIRECTORY ) usFileNameLen = ADS_MAX_TABLE_NAME; ulRetVal = AdsFindFirstTable( hConnect, ( UNSIGNED8* ) ( ISCHAR( 1 ) ? hb_parcx( 1 ) : "" ), ( UNSIGNED8* ) ucFileName, &usFileNameLen, &sHandle ); - if ( ulRetVal == AE_SUCCESS || ulRetVal == AE_NO_FILE_FOUND ) + if( ulRetVal == AE_SUCCESS || ulRetVal == AE_NO_FILE_FOUND ) { while( ulRetVal == AE_SUCCESS ) { @@ -2602,9 +2605,9 @@ HB_FUNC( ADSGETSERVERNAME ) } } -#endif /* ADS_REQUIRE_VERSION >= 6 */ +#endif /* ADS_LIB_VERSION >= 600 */ -#if ADS_REQUIRE_VERSION >= 7 +#if ADS_LIB_VERSION >= 700 HB_FUNC( ADSCLOSECACHEDTABLES ) { @@ -2613,17 +2616,17 @@ HB_FUNC( ADSCLOSECACHEDTABLES ) if( hConnect ) { AdsCloseCachedTables( hConnect ); - hb_retl( 1 ); + hb_retl( TRUE ); } else { - hb_retl( 0 ); + hb_retl( FALSE ); } } -#endif /* ADS_REQUIRE_VERSION >= 7 */ +#endif /* ADS_LIB_VERSION >= 700 */ -#if ADS_REQUIRE_VERSION >= 800 +#if ADS_LIB_VERSION >= 800 HB_FUNC( ADSCREATESAVEPOINT ) { @@ -2644,7 +2647,7 @@ HB_FUNC( ADSROLLBACKSAVEPOINT ) #endif -#if ADS_REQUIRE_VERSION >= 900 +#if ADS_LIB_VERSION >= 900 HB_FUNC( ADSDDCREATELINK ) { diff --git a/harbour/contrib/rddads/adsmgmnt.c b/harbour/contrib/rddads/adsmgmnt.c index fc0081798e..c725fddeac 100644 --- a/harbour/contrib/rddads/adsmgmnt.c +++ b/harbour/contrib/rddads/adsmgmnt.c @@ -63,24 +63,24 @@ Advantage Management API Examples */ -ADSHANDLE hMgmtHandle = 0; +ADSHANDLE ads_g_hMgmtHandle = 0; HB_FUNC( ADSMGCONNECT ) { - /* ulRetVal = AdsMgConnect( "\\\\server\\volume:", NULL, NULL, &hMgmtHandle ); + /* ulRetVal = AdsMgConnect( "\\\\server\\volume:", NULL, NULL, &ads_g_hMgmtHandle ); // UNSIGNED32 ENTRYPOINT AdsMgConnect( UNSIGNED8 *pucServerName, // UNSIGNED8 *pucUserName, // UNSIGNED8 *pucPassword, - // ADSHANDLE *phMgmtHandle ); + // ADSHANDLE *pads_g_hMgmtHandle ); */ - hb_retnl( AdsMgConnect( (UNSIGNED8 *) hb_parcx(1), (UNSIGNED8 *) hb_parcx(2), (UNSIGNED8 *) hb_parcx(3), &hMgmtHandle ) ); + hb_retnl( AdsMgConnect( (UNSIGNED8 *) hb_parcx(1), (UNSIGNED8 *) hb_parcx(2), (UNSIGNED8 *) hb_parcx(3), &ads_g_hMgmtHandle ) ); } HB_FUNC( ADSMGDISCONNECT ) { - hb_retnl( AdsMgDisconnect( hMgmtHandle ) ); - hMgmtHandle = 0; + hb_retnl( AdsMgDisconnect( ads_g_hMgmtHandle ) ); + ads_g_hMgmtHandle = 0; } HB_FUNC( ADSMGGETINSTALLINFO ) @@ -90,10 +90,10 @@ HB_FUNC( ADSMGGETINSTALLINFO ) ADS_MGMT_INSTALL_INFO stInstallInfo; usStructSize = sizeof( ADS_MGMT_INSTALL_INFO ); - ulRetVal = AdsMgGetInstallInfo( hMgmtHandle, &stInstallInfo, &usStructSize ); + ulRetVal = AdsMgGetInstallInfo( ads_g_hMgmtHandle, &stInstallInfo, &usStructSize ); /* - //if ( sizeof( ADS_MGMT_INSTALL_INFO ) < usStructSize ) + //if( sizeof( ADS_MGMT_INSTALL_INFO ) < usStructSize ) // printf( "\nInstallation Information structure on server is larger." ); // printf( "\nMore possible info available." ); */ @@ -120,15 +120,15 @@ HB_FUNC( ADSMGGETACTIVITYINFO ) unsigned int iOption = hb_parni( 1 ); usStructSize = sizeof( ADS_MGMT_ACTIVITY_INFO ); - ulRetVal = AdsMgGetActivityInfo( hMgmtHandle, &stActivityInfo, &usStructSize ); + ulRetVal = AdsMgGetActivityInfo( ads_g_hMgmtHandle, &stActivityInfo, &usStructSize ); /* - // if ( sizeof( ADS_MGMT_ACTIVITY_INFO ) < usStructSize ) + // if( sizeof( ADS_MGMT_ACTIVITY_INFO ) < usStructSize ) // printf( "\nActivity Information structure on server is larger." ); // printf( "\nMore possible info available." ); */ - if ( iOption && ulRetVal == AE_SUCCESS ) + if( iOption && ulRetVal == AE_SUCCESS ) { - switch ( iOption ) + switch( iOption ) { case 1 : hb_retnl( stActivityInfo.ulOperations ); /* Number operations since started */ @@ -238,15 +238,15 @@ HB_FUNC( ADSMGGETCOMMSTATS ) ADS_MGMT_COMM_STATS stCommStats; usStructSize = sizeof( ADS_MGMT_COMM_STATS ); - ulRetVal = AdsMgGetCommStats( hMgmtHandle, &stCommStats, &usStructSize ); + ulRetVal = AdsMgGetCommStats( ads_g_hMgmtHandle, &stCommStats, &usStructSize ); /* - // if ( sizeof( ADS_MGMT_COMM_STATS ) < usStructSize ) + // if( sizeof( ADS_MGMT_COMM_STATS ) < usStructSize ) // { // HB_TRACE(HB_TR_INFO, ("The Communication Statistics structure on the server is larger. // \nMore info is available with the current ACE.H." )); // } */ - if ( ulRetVal == AE_SUCCESS ) + if( ulRetVal == AE_SUCCESS ) { hb_reta( 11 ); hb_stornd( stCommStats.dPercentCheckSums, -1, 1 ); /* % of pkts with checksum failures */ @@ -265,9 +265,9 @@ HB_FUNC( ADSMGGETCOMMSTATS ) HB_FUNC( ADSMGRESETCOMMSTATS ) { - if ( hMgmtHandle ) + if( ads_g_hMgmtHandle ) { - hb_retnl( AdsMgResetCommStats( hMgmtHandle ) ); + hb_retnl( AdsMgResetCommStats( ads_g_hMgmtHandle ) ); } else { @@ -290,19 +290,19 @@ HB_FUNC( ADSMGGETCONFIGINFO ) usConfigValuesStructSize = sizeof( ADS_MGMT_CONFIG_PARAMS ); usConfigMemoryStructSize = sizeof( ADS_MGMT_CONFIG_MEMORY ); - ulRetVal = AdsMgGetConfigInfo( hMgmtHandle, &stConfigValues, + ulRetVal = AdsMgGetConfigInfo( ads_g_hMgmtHandle, &stConfigValues, &usConfigValuesStructSize, &stConfigMemory, &usConfigMemoryStructSize ); /* - // if ( sizeof( ADS_MGMT_CONFIG_PARAMS ) < usConfigValuesStructSize ) + // if( sizeof( ADS_MGMT_CONFIG_PARAMS ) < usConfigValuesStructSize ) // printf( "\nConfiguration Values structure on server is larger." ); - // if ( sizeof( ADS_MGMT_CONFIG_MEMORY ) < usConfigMemoryStructSize ) + // if( sizeof( ADS_MGMT_CONFIG_MEMORY ) < usConfigMemoryStructSize ) // printf( "\nConfiguration Memory structure on server is larger." ); */ - if ( ulRetVal == AE_SUCCESS ) + if( ulRetVal == AE_SUCCESS ) { - if ( iOption == 0 ) + if( iOption == 0 ) { hb_reta( 25 ); hb_stornl( stConfigValues.ulNumConnections , -1, 1 ); /* number connections */ @@ -320,15 +320,15 @@ HB_FUNC( ADSMGGETCONFIGINFO ) hb_stornl( stConfigValues.usNumSendECBs , -1, 13); /* number send ECBs (NLM only) */ hb_stornd( stConfigValues.usNumBurstPackets , -1, 14); /* number packets per burst */ hb_stornl( stConfigValues.usNumWorkerThreads , -1, 15); /* number worker threads */ -#if defined(ADS_REQUIRE_VERSION) && ADS_REQUIRE_VERSION >= 810 +#if ADS_LIB_VERSION >= 810 hb_stornl( stConfigValues.ulSortBuffSize , -1, 16); /* index sort buffer size */ hb_storni( 0 , -1, 17); /* reserved */ hb_storni( 0 , -1, 18); /* reserved */ -#elif defined(ADS_REQUIRE_VERSION) && ADS_REQUIRE_VERSION < 810 +#elif ADS_LIB_VERSION < 810 hb_stornl( stConfigValues.usSortBuffSize , -1, 16); /* index sort buffer size */ hb_storni( stConfigValues.ucReserved1 , -1, 17); /* reserved */ hb_storni( stConfigValues.ucReserved2 , -1, 18); /* reserved */ -#else +#else /* not currently used */ hb_stornl( 0 , -1, 16); /* index sort buffer size */ hb_storni( 0 , -1, 17); /* reserved */ hb_storni( 0 , -1, 18); /* reserved */ @@ -343,7 +343,7 @@ HB_FUNC( ADSMGGETCONFIGINFO ) /* hb_stornl( stConfigValues.usReserved5 , -1, 26); reserved */ } - else if ( iOption == 1 ) + else if( iOption == 1 ) { hb_reta( 13 ); hb_stornd( stConfigMemory.ulTotalConfigMem , -1, 1 ); /* Total mem taken by cfg params */ @@ -377,7 +377,7 @@ HB_FUNC( ADSMGGETUSERNAMES ) /* Return array of connected users */ ADS_MGMT_USER_INFO astUserInfo[MAX_NUM_USERS]; bh: Enhancement: Get # of tables from ADS_MGMT_ACTIVITY_INFO.stUsers instead of set size */ - if ( ISNUM( 2 ) ) + if( ISNUM( 2 ) ) { ulMaxUsers = (UNSIGNED16) hb_parnl( 2 ); } @@ -390,26 +390,28 @@ HB_FUNC( ADSMGGETUSERNAMES ) /* Return array of connected users */ UNSIGNED16 *pusArrayLen, UNSIGNED16 *pusStructSize ); */ - ulRetVal = AdsMgGetUserNames( hMgmtHandle, ISCHAR( 1 ) ? (UNSIGNED8 *) hb_parcx( 1 ) : NULL, + ulRetVal = AdsMgGetUserNames( ads_g_hMgmtHandle, ISCHAR( 1 ) ? (UNSIGNED8 *) hb_parcx( 1 ) : NULL, pastUserInfo, &ulMaxUsers, &usStructSize ); /* - if ( sizeof( ADS_MGMT_USER_INFO ) < usStructSize ) + if( sizeof( ADS_MGMT_USER_INFO ) < usStructSize ) { HB_TRACE(HB_TR_INFO, ("The \nUser Information structure on the server is larger. \nMore info is available with the current ACE.H." )); } */ - if ( ulRetVal == AE_SUCCESS ) + if( ulRetVal == AE_SUCCESS ) { PHB_ITEM pArray = hb_itemArrayNew( ulMaxUsers ), pArrayItm; - for ( ulCount = 1; ulCount <= ulMaxUsers; ulCount++ ) + for( ulCount = 1; ulCount <= ulMaxUsers; ulCount++ ) { pArrayItm = hb_arrayGetItemPtr( pArray, ulCount ); -#if ADS_REQUIRE_VERSION >= 800 +#if ADS_LIB_VERSION >= 810 hb_arrayNew( pArrayItm, 6 ); +#elif ADS_LIB_VERSION >= 800 + hb_arrayNew( pArrayItm, 5 ); #else hb_arrayNew( pArrayItm, 3 ); #endif @@ -419,11 +421,13 @@ HB_FUNC( ADSMGGETUSERNAMES ) /* Return array of connected users */ pastUserInfo[ulCount].usConnNumber ); hb_itemPutC( hb_arrayGetItemPtr( pArrayItm, 3 ), ( char * ) pastUserInfo[ulCount].aucAddress ); -#if ADS_REQUIRE_VERSION >= 800 +#if ADS_LIB_VERSION >= 800 hb_itemPutC( hb_arrayGetItemPtr( pArrayItm, 4 ), ( char * ) pastUserInfo[ulCount].aucAuthUserName ); hb_itemPutC( hb_arrayGetItemPtr( pArrayItm, 5 ), ( char * ) pastUserInfo[ulCount].aucOSUserLoginName ); +#endif +#if ADS_LIB_VERSION >= 810 hb_itemPutC( hb_arrayGetItemPtr( pArrayItm, 6 ), ( char * ) pastUserInfo[ulCount].aucTSAddress ); #endif @@ -466,13 +470,13 @@ HB_FUNC( ADSMGGETLOCKOWNER ) ADS_MGMT_USER_INFO * pstUserInfo; pstUserInfo = (ADS_MGMT_USER_INFO *) hb_xgrab( sizeof( ADS_MGMT_USER_INFO ) ); - ulRetVal = AdsMgGetLockOwner( hMgmtHandle, + ulRetVal = AdsMgGetLockOwner( ads_g_hMgmtHandle, (UNSIGNED8 *) hb_parcx( 1 ), (UNSIGNED32) hb_parnl(2), pstUserInfo, &usStructSize, &pusLockType); - if ( ulRetVal== AE_SUCCESS ) + if( ulRetVal== AE_SUCCESS ) { hb_reta(5); hb_storc ( (char *) pstUserInfo->aucUserName , -1, 1); /* Machine name under NT */ @@ -493,8 +497,8 @@ HB_FUNC( ADSMGGETSERVERTYPE ) /* Determine OS ADS is running on; see ADS_MGMT_ UNSIGNED32 ulRetVal; UNSIGNED16 usServerType; - ulRetVal = AdsMgGetServerType( hMgmtHandle, &usServerType ); - if ( ulRetVal == AE_SUCCESS ) + ulRetVal = AdsMgGetServerType( ads_g_hMgmtHandle, &usServerType ); + if( ulRetVal == AE_SUCCESS ) { hb_retnl( usServerType ); } @@ -536,7 +540,7 @@ HB_FUNC( ADSMGGETOPENTABLES ) /* nMaxNumberOfFilesToReturn, cUserName, astOpenTableInfo = ( ADS_MGMT_TABLE_INFO * ) hb_xgrab( sizeof( ADS_MGMT_TABLE_INFO ) * pusArrayLen ); - ulRetVal = AdsMgGetOpenTables( hMgmtHandle, + ulRetVal = AdsMgGetOpenTables( ads_g_hMgmtHandle, (UNSIGNED8 *) pucUserName, usConnNumber, astOpenTableInfo, @@ -599,7 +603,7 @@ HB_FUNC( ADSMGGETOPENINDEXES ) /* nMaxNumberOfFilesToReturn, cTableName, cU astOpenIndexInfo = ( ADS_MGMT_INDEX_INFO * ) hb_xgrab( sizeof( ADS_MGMT_INDEX_INFO ) * pusArrayLen ); - ulRetVal = AdsMgGetOpenIndexes( hMgmtHandle, + ulRetVal = AdsMgGetOpenIndexes( ads_g_hMgmtHandle, (UNSIGNED8 *) pucTableName, (UNSIGNED8 *) pucUserName, usConnNumber, @@ -652,10 +656,10 @@ HB_FUNC( ADSMGKILLUSER ) HB_FUNC( ADSMGKILLUSER ) { - hb_retnl( (UNSIGNED16) AdsMgKillUser( hMgmtHandle, (UNSIGNED8 *) hb_parc(1), (UNSIGNED16) hb_parnl(2) )); + hb_retnl( (UNSIGNED16) AdsMgKillUser( ads_g_hMgmtHandle, (UNSIGNED8 *) hb_parc(1), (UNSIGNED16) hb_parnl(2) )); } HB_FUNC( ADSMGGETHANDLE ) { - hb_retnl( (LONG) hMgmtHandle ); + hb_retnl( (LONG) ads_g_hMgmtHandle ); } diff --git a/harbour/contrib/rddads/make_b32.bat b/harbour/contrib/rddads/make_b32.bat index 6ffef105a5..40e0841e61 100644 --- a/harbour/contrib/rddads/make_b32.bat +++ b/harbour/contrib/rddads/make_b32.bat @@ -18,10 +18,6 @@ goto POST_EXIT :DIR_OK set CFLAGS=-I%ADS_DIR% -if "%ADS_VER%" == "" goto DEFAULT_VER -set CFLAGS=%CFLAGS% -DADS_REQUIRE_VERSION=%ADS_VER% -:DEFAULT_VER - set HB_DLL_NAME=ace32 if exist "%SystemRoot%\system32\%HB_DLL_NAME%.dll" set HB_DLL_DIR=%SystemRoot%\system32 if exist "%ADS_DIR%\Redistribute\%HB_DLL_NAME%.dll" set HB_DLL_DIR=%ADS_DIR%\Redistribute diff --git a/harbour/contrib/rddads/make_vc.bat b/harbour/contrib/rddads/make_vc.bat index b71cb8947e..2c713c1136 100644 --- a/harbour/contrib/rddads/make_vc.bat +++ b/harbour/contrib/rddads/make_vc.bat @@ -18,10 +18,6 @@ goto POST_EXIT :DIR_OK set CFLAGS=-I%ADS_DIR% -if "%ADS_VER%" == "" goto DEFAULT_VER -set CFLAGS=%CFLAGS% -DADS_REQUIRE_VERSION=%ADS_VER% -:DEFAULT_VER - set HB_DLL_NAME=ace32 if exist "%SystemRoot%\system32\%HB_DLL_NAME%.dll" set HB_DLL_DIR=%SystemRoot%\system32 if exist "%ADS_DIR%\Redistribute\%HB_DLL_NAME%.dll" set HB_DLL_DIR=%ADS_DIR%\Redistribute diff --git a/harbour/contrib/rddads/rddads.h b/harbour/contrib/rddads/rddads.h index 3394e01ccf..887d695e76 100644 --- a/harbour/contrib/rddads/rddads.h +++ b/harbour/contrib/rddads/rddads.h @@ -64,8 +64,36 @@ #include "ace.h" +/* Autodetect ACE version. */ + +/* Compatibility */ +#ifdef ADS_REQUIRE_VERSION + #define ADS_LIB_VERSION ADS_REQUIRE_VERSION +#endif + +#ifndef ADS_LIB_VERSION + #if defined(ADS_NOTIFICATION_CONNECTION) + #define ADS_LIB_VERSION 900 // or upper + #elif defined(ADS_UDP_IP_CONNECTION) + #define ADS_LIB_VERSION 810 // or upper + #elif defined(ADS_REPLICATION_CONNECTION) + #define ADS_LIB_VERSION 800 // or upper + #elif defined(ADS_NOT_AUTO_OPEN) + #define ADS_LIB_VERSION 710 // or upper + #elif defined(ADS_FTS_INDEX_ORDER) + #define ADS_LIB_VERSION 700 // or upper + #elif defined(ADS_COMPRESS_ALWAYS) + #define ADS_LIB_VERSION 620 // or upper + #elif defined(ADS_USER_DEFINED) + #define ADS_LIB_VERSION 611 // or upper + #else + #define ADS_LIB_VERSION 500 // or lower + #endif +#endif + +/* QUESTION: Why do we redefine this? Normally it is 4082 in 7.10 or upper and 256 in lower versions. */ #undef ADS_MAX_KEY_LENGTH -#if ADS_REQUIRE_VERSION >= 8 +#if ADS_LIB_VERSION >= 800 #define ADS_MAX_KEY_LENGTH 4082 /* maximum key value length. This is the max key length */ #else /* of ADI indexes. Max CDX key length is 240. Max */ #define ADS_MAX_KEY_LENGTH 256 /* NTX key length is 256 */ diff --git a/harbour/contrib/xhb/hbcompat.ch b/harbour/contrib/xhb/hbcompat.ch index f741d3ed2f..c57ef25ffa 100644 --- a/harbour/contrib/xhb/hbcompat.ch +++ b/harbour/contrib/xhb/hbcompat.ch @@ -61,6 +61,9 @@ #xtranslate hb_gtInfo([]) => gtInfo() #xtranslate hb_gtVersion([]) => hb_gt_Version() + #xtranslate hb_ScrMaxRow() => MaxRow(.T.) + #xtranslate hb_ScrMaxCol() => MaxCol(.T.) + #xtranslate hb_isregex([]) => hb_isregexstring() #xtranslate hb_pvalue([]) => pvalue() #xtranslate hb_methodName([])=> methodName() @@ -114,13 +117,15 @@ #xtranslate gtInfo([]) => hb_gtInfo() #xtranslate hb_gt_Version([]) => hb_gtVersion() - #xtranslate gtSetClipboard() => hb_gtInfo( GTI_CLIPBOARDDATA, ) - #xtranslate gtGetClipboard() => hb_gtInfo( GTI_CLIPBOARDDATA ) - #xtranslate gtGetClipBoardSize() => Len( hb_gtInfo( GTI_CLIPBOARDDATA ) ) - #xtranslate gtPasteClipBoard([]) => hb_gtInfo( GTI_CLIPBOARDPAST ) + #xtranslate gtSetClipboard() => hb_gtInfo( HB_GTI_CLIPBOARDDATA, ) + #xtranslate gtGetClipboard() => hb_gtInfo( HB_GTI_CLIPBOARDDATA ) + #xtranslate gtGetClipBoardSize() => Len( hb_gtInfo( HB_GTI_CLIPBOARDDATA ) ) + #xtranslate gtPasteClipBoard([]) => hb_gtInfo( HB_GTI_CLIPBOARDPAST ) #xtranslate gtProcessMessages() => NextKey() #xtranslate gfxPrimitive([]) => hb_gfxPrimitive() #xtranslate gfxText([]) => hb_gfxText() + #xtranslate MaxRow(.T.) => hb_ScrMaxRow() + #xtranslate MaxCol(.T.) => hb_ScrMaxCol() #xtranslate hb_isregexstring([]) => hb_isregex() #xtranslate pvalue([]) => hb_pvalue() @@ -259,4 +264,3 @@ #endif #endif /* __HARBOUR__ */ - diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index 7522a16d53..6ea763599e 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -905,6 +905,9 @@ EXTERNAL HB_GETSTDOUT EXTERNAL HB_DBPACK EXTERNAL HB_DBZAP +EXTERNAL HB_SCRMAXROW +EXTERNAL HB_SCRMAXCOL + /* Codepage support */ EXTERNAL HB_CODEPAGE_BG866 EXTERNAL HB_CODEPAGE_BGISO diff --git a/harbour/source/common/expropt2.c b/harbour/source/common/expropt2.c index 7ddc823fcc..e1ecfb7528 100644 --- a/harbour/source/common/expropt2.c +++ b/harbour/source/common/expropt2.c @@ -1459,7 +1459,7 @@ BOOL hb_compExprReduceAT( HB_EXPR_PTR pSelf, HB_COMP_DECL ) if( pSub->ExprType == HB_ET_STRING && pText->ExprType == HB_ET_STRING ) { - /* This is CA-Clipper compiler optimizer behavior, + /* This is CA-Cl*pper compiler optimizer behavior, * macro compiler does not have optimizer [druzus] */ if( pSub->ulLength == 0 ) diff --git a/harbour/source/common/hbver.c b/harbour/source/common/hbver.c index fa3b7d6dde..764d69dd9c 100644 --- a/harbour/source/common/hbver.c +++ b/harbour/source/common/hbver.c @@ -555,8 +555,8 @@ char * hb_verHarbour( void ) pszVersion = ( char * ) hb_xgrab( 80 ); /* NOTE: - CA-Clipper 5.2e returns: "Clipper (R) 5.2e Intl. (x216) (1995.02.07)" - CA-Clipper 5.3b returns: "Clipper (R) 5.3b Intl. (Rev. 338) (1997.04.25)" + CA-Cl*pper 5.2e returns: "Clipper (R) 5.2e Intl. (x216) (1995.02.07)" + CA-Cl*pper 5.3b returns: "Clipper (R) 5.3b Intl. (Rev. 338) (1997.04.25)" */ snprintf( pszVersion, 80, "Harbour %s build %d.%d-%d Intl. (Rev. %d)", diff --git a/harbour/source/compiler/hbmain.c b/harbour/source/compiler/hbmain.c index 0dcc476c76..3bbe473ec3 100644 --- a/harbour/source/compiler/hbmain.c +++ b/harbour/source/compiler/hbmain.c @@ -4631,7 +4631,7 @@ static int hb_compCompile( HB_COMP_DECL, const char * szPrg, int iFileType ) szFileName, szPpoName ); else snprintf( buffer, sizeof( buffer ), "Compiling '%s'...\n", szFileName ); - hb_compOutStd( HB_COMP_PARAM, buffer ); + hb_compOutErr( HB_COMP_PARAM, buffer ); } if( HB_COMP_PARAM->fI18n ) @@ -4749,7 +4749,7 @@ static int hb_compCompile( HB_COMP_DECL, const char * szPrg, int iFileType ) "\r%i error%s\n\nNo code generated\n", HB_COMP_PARAM->iErrorCount, HB_COMP_PARAM->iErrorCount > 1 ? "s" : "" ); - hb_compOutStd( HB_COMP_PARAM, buffer ); + hb_compOutErr( HB_COMP_PARAM, buffer ); } else if( HB_COMP_PARAM->iExitLevel == HB_EXITLEVEL_SETEXIT ) { @@ -4759,7 +4759,7 @@ static int hb_compCompile( HB_COMP_DECL, const char * szPrg, int iFileType ) { iStatus = EXIT_FAILURE; bSkipGen = TRUE; - hb_compOutStd( HB_COMP_PARAM, "\nNo code generated.\n" ); + hb_compOutErr( HB_COMP_PARAM, "\nNo code generated.\n" ); } } @@ -4817,7 +4817,7 @@ static int hb_compCompile( HB_COMP_DECL, const char * szPrg, int iFileType ) "\rLines %i, Functions/Procedures %i\n", hb_pp_lineTot( HB_COMP_PARAM->pLex->pPP ), HB_COMP_PARAM->iFunctionCnt ); - hb_compOutStd( HB_COMP_PARAM, buffer ); + hb_compOutErr( HB_COMP_PARAM, buffer ); } hb_compGenOutput( HB_COMP_PARAM, HB_COMP_PARAM->iLanguage ); diff --git a/harbour/source/lang/msgbgmik.c b/harbour/source/lang/msgbgmik.c index 357f5cb9ae..d8c96ad327 100644 --- a/harbour/source/lang/msgbgmik.c +++ b/harbour/source/lang/msgbgmik.c @@ -93,7 +93,7 @@ static HB_LANG s_lang = "Пе▓║к", "С║бо▓а", - /* CA-Clipper compatible natmsg items */ + /* CA-Cl*pper compatible natmsg items */ "Файлове ▒ данни # Запи▒ По▒л.Поп░ави Разме░", "Do you want more samples?", diff --git a/harbour/source/rtl/Makefile b/harbour/source/rtl/Makefile index 063916c56c..415891c195 100644 --- a/harbour/source/rtl/Makefile +++ b/harbour/source/rtl/Makefile @@ -109,6 +109,7 @@ C_SOURCES=\ samples.c \ saverest.c \ scroll.c \ + scrrow.c \ secondfs.c \ seconds.c \ set.c \ diff --git a/harbour/source/rtl/adir.prg b/harbour/source/rtl/adir.prg index 010d81718a..92bafd059c 100644 --- a/harbour/source/rtl/adir.prg +++ b/harbour/source/rtl/adir.prg @@ -67,7 +67,7 @@ FUNCTION ADir( cFileMask, aName, aSize, aDate, aTime, aAttr ) LOCAL cName LOCAL cExt - // ; CA-Clipper would fail on this case. + // ; CA-Cl*pper would fail on this case. IF !ISCHARACTER( cFileMask ) RETURN 0 diff --git a/harbour/source/rtl/console.c b/harbour/source/rtl/console.c index e5f4611386..1e7608e972 100644 --- a/harbour/source/rtl/console.c +++ b/harbour/source/rtl/console.c @@ -122,7 +122,7 @@ void hb_conInit( void ) #ifdef HB_C52_UNDOC { - /* Undocumented CA-Clipper switch //STDERR:x */ + /* Undocumented CA-Cl*pper switch //STDERR:x */ FHANDLE hStderr = ( FHANDLE ) hb_cmdargNum( "STDERR" ); if( hStderr == 0 ) /* //STDERR with no parameter or 0 */ diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index 2f827370b5..6515590d51 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -81,10 +81,10 @@ * */ -/* NOTE: In DOS/DJGPP under WinNT4 hb_fsSeek( fhnd, offset < 0, FS_SET) will - set the file pointer to the passed negative value, and the subsequent - hb_fsWrite() call will fail. In CA-Clipper hb_fsSeek() will fail, - the pointer will not be moved, and thus the hb_fsWrite() call will +/* NOTE: In DOS/DJGPP under WinNT4 hb_fsSeek( fhnd, offset < 0, FS_SET ) will + set the file pointer to the passed negative value and the subsequent + hb_fsWrite() call will fail. In CA-Cl*pper, _fsSeek() will fail, + the pointer will not be moved and thus the _fsWrite() call will successfully write the buffer to the current file position. [vszakats] This has been corrected by ptucker diff --git a/harbour/source/rtl/getsys.prg b/harbour/source/rtl/getsys.prg index c8cd53dd85..b9670b279d 100644 --- a/harbour/source/rtl/getsys.prg +++ b/harbour/source/rtl/getsys.prg @@ -55,7 +55,7 @@ * www - http://www.harbour-project.org * * Copyright 2001 Luiz Rafael Culik - * Support for CA-Clipper 5.3 Getsystem + * Support for CA-Cl*pper 5.3 Getsystem * * See doc/license.txt for licensing terms. * diff --git a/harbour/source/rtl/getsys53.prg b/harbour/source/rtl/getsys53.prg index 77a9b4ef9f..3824356620 100644 --- a/harbour/source/rtl/getsys53.prg +++ b/harbour/source/rtl/getsys53.prg @@ -55,7 +55,7 @@ * www - http://www.harbour-project.org * * Copyright 2001 Luiz Rafael Culik - * Support for CA-Clipper 5.3 Getsystem + * Support for CA-Cl*pper 5.3 Getsystem * * See doc/license.txt for licensing terms. * diff --git a/harbour/source/rtl/maxrow.c b/harbour/source/rtl/maxrow.c index cfd008df6c..d008e861c1 100644 --- a/harbour/source/rtl/maxrow.c +++ b/harbour/source/rtl/maxrow.c @@ -53,37 +53,12 @@ #include "hbapi.h" #include "hbapigt.h" -HB_FUNC( MAXROW ) /* Return the maximum screen row number (zero origin) */ +HB_FUNC( MAXROW ) /* Return the maximum screen/"viewport" row number (zero origin) */ { - /* - * if called with logical .T. parameter then return real screen high - 1 - * It gives exactly the same result in all standard GT drivers so we - * are still Clipper compatible. The difference can appear in some extended - * GT drivers which have additional functionality, f.e. CTW GT which - * is upper level GT and add CTIII Window support. When it's activated - * then MaxRow() will return current window max row and MaxRow(.t.) real - * screen (window 0) max row what is the exact behavior of MaxRow() - * in CT3, [druzus] - */ - if( ISLOG( 1 ) && hb_parl( 1 ) ) - { - USHORT uiRows, uiCols; - hb_gtScrDim( &uiRows, &uiCols ); - hb_retni( uiRows - 1 ); - } - else - hb_retni( hb_gtMaxRow() ); + hb_retni( hb_gtMaxRow() ); } -HB_FUNC( MAXCOL ) /* Return the maximum screen column number (zero origin) */ +HB_FUNC( MAXCOL ) /* Return the maximum screen/"viewport" column number (zero origin) */ { - /* See the note about MaxRow(.t.) above */ - if( ISLOG( 1 ) && hb_parl( 1 ) ) - { - USHORT uiRows, uiCols; - hb_gtScrDim( &uiRows, &uiCols ); - hb_retni( uiCols - 1 ); - } - else - hb_retni( hb_gtMaxCol() ); + hb_retni( hb_gtMaxCol() ); } diff --git a/harbour/source/rtl/memofile.c b/harbour/source/rtl/memofile.c index c333e1c27f..fa20ddc1e4 100644 --- a/harbour/source/rtl/memofile.c +++ b/harbour/source/rtl/memofile.c @@ -54,7 +54,7 @@ #include "hbapiitm.h" #include "hbapifs.h" -/* NOTE: CA-Clipper has 64K (65516 bytes exactly) limit on read, in Harbour +/* NOTE: CA-Cl*pper has 64K (65516 bytes exactly) limit on read, in Harbour this limit is extended, so we are not *strictly* compatible here. [vszakats] */ @@ -123,8 +123,8 @@ static BOOL hb_memowrit( BOOL bWriteEOF ) bRetVal = ( hb_fsWriteLarge( fhnd, ( BYTE * ) hb_itemGetCPtr( pString ), ulSize ) == ulSize ); - /* NOTE: CA-Clipper will add the EOF even if the write failed. [vszakats] */ - /* NOTE: CA-Clipper will not return .F. when the EOF could not be written. [vszakats] */ + /* NOTE: CA-Cl*pper will add the EOF even if the write failed. [vszakats] */ + /* NOTE: CA-Cl*pper will not return .F. when the EOF could not be written. [vszakats] */ #if ! defined(OS_UNIX_COMPATIBLE) if( bWriteEOF ) /* if true, then write EOF */ { diff --git a/harbour/source/rtl/mod.c b/harbour/source/rtl/mod.c index a19373d8db..db2559bd3b 100644 --- a/harbour/source/rtl/mod.c +++ b/harbour/source/rtl/mod.c @@ -87,7 +87,7 @@ HB_FUNC( MOD ) { PHB_ITEM pResult = hb_errRT_BASE_Subst( EG_ZERODIV, 1341, NULL, "%", HB_ERR_ARGS_BASEPARAMS ); - /* In CA-Clipper MOD() function ignores substitution result + /* In CA-Cl*pper MOD() function ignores substitution result * and return original numeric item keeping its internal * representation: integer or double, size and number of * decimal places, it can be seen in code like: diff --git a/harbour/source/rtl/philes.c b/harbour/source/rtl/philes.c index 9e32a3ff4e..40a9f65068 100644 --- a/harbour/source/rtl/philes.c +++ b/harbour/source/rtl/philes.c @@ -111,7 +111,7 @@ HB_FUNC( FREAD ) { ulRead = hb_parnl( 3 ); - /* NOTE: CA-Clipper determines the maximum size by calling _parcsiz() + /* NOTE: CA-Cl*pper determines the maximum size by calling _parcsiz() instead of _parclen(), this means that the maximum read length will be one more than the length of the passed buffer, because the terminating zero could be used if needed. [vszakats] */ diff --git a/harbour/source/rtl/pushbtn.prg b/harbour/source/rtl/pushbtn.prg index 0f51242f9e..a1d48c817c 100644 --- a/harbour/source/rtl/pushbtn.prg +++ b/harbour/source/rtl/pushbtn.prg @@ -70,7 +70,7 @@ CREATE CLASS PUSHBUTTON FUNCTION HBPushButton EXPORTED: - VAR cargo /* NOTE: CA-Clipper 5.3 has a bug, where this var cannot be assigned NIL. */ + VAR cargo /* NOTE: CA-Cl*pper 5.3 has a bug, where this var cannot be assigned NIL. */ VAR bmpXOff INIT -1 /* NOTE: Fully compatible behaviour not implemented. */ VAR bmpYOff INIT -1 /* NOTE: Fully compatible behaviour not implemented. */ diff --git a/harbour/source/rtl/radiobtn.prg b/harbour/source/rtl/radiobtn.prg index 2f5a6144e1..cedf5f2579 100644 --- a/harbour/source/rtl/radiobtn.prg +++ b/harbour/source/rtl/radiobtn.prg @@ -69,7 +69,7 @@ CREATE CLASS RADIOBUTTN FUNCTION HBRadioButton EXPORTED: - VAR cargo /* NOTE: CA-Clipper 5.3 has a bug, where this var is filled with NIL everytime its value is read ( cargo := o:cargo ). */ + VAR cargo /* NOTE: CA-Cl*pper 5.3 has a bug, where this var is filled with NIL everytime its value is read ( cargo := o:cargo ). */ METHOD display() METHOD hitTest( nMRow, nMCol ) diff --git a/harbour/source/rtl/scrrow.c b/harbour/source/rtl/scrrow.c new file mode 100644 index 0000000000..d4da38c863 --- /dev/null +++ b/harbour/source/rtl/scrrow.c @@ -0,0 +1,78 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * hb_SCRMAXROW(), hb_SCRMAXCOL() functions + * + * Copyright 2006 Przemyslaw Czerpak + * 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. + * + */ + +#include "hbapi.h" +#include "hbapigt.h" + +/* + * Normally it gives exactly the same result in all standard GT drivers + * as MaxRow()/MaxCol(). The difference can appear in some extended + * GT drivers which have additional functionality, f.e. CTW GT which + * is upper level GT and add CTIII Window support. When it's activated + * then MaxRow() will return current window max row and hb_ScrMaxRow() real + * screen (window 0) max row what is the exact behavior of MaxRow() + * in CT3, [druzus] + */ + +HB_FUNC( HB_SCRMAXROW ) /* Return the maximum screen row number (zero origin) */ +{ + USHORT uiRows, uiCols; + hb_gtScrDim( &uiRows, &uiCols ); + hb_retni( uiRows - 1 ); +} + +HB_FUNC( HB_SCRMAXCOL ) /* Return the maximum screen column number (zero origin) */ +{ + USHORT uiRows, uiCols; + hb_gtScrDim( &uiRows, &uiCols ); + hb_retni( uiCols - 1 ); +} diff --git a/harbour/source/rtl/tbrowse.prg b/harbour/source/rtl/tbrowse.prg index 5bdbbd6b54..eed6a418c7 100644 --- a/harbour/source/rtl/tbrowse.prg +++ b/harbour/source/rtl/tbrowse.prg @@ -1320,7 +1320,7 @@ METHOD doConfigure() CLASS TBROWSE nColCount := Len( ::columns ) ASize( ::aColData, nColCount ) FOR EACH oCol, aCol IN ::columns, ::aColData - /* CA-Clipper always evaluates column block even if column is + /* CA-Cl*pper always evaluates column block even if column is * hidden by setting :width to 0. [druzus] */ xValue := Eval( oCol:block ) @@ -1482,7 +1482,7 @@ METHOD doConfigure() CLASS TBROWSE ::lFrames := .T. ::lRefresh := .T. - /* CA-Clipper update visible columns here but without + /* CA-Cl*pper update visible columns here but without * colPos repositioning. [druzus] */ _SETVISIBLE( ::aColData, _TBR_COORD( ::n_Right ) - _TBR_COORD( ::n_Left ) + 1, ; @@ -1776,7 +1776,7 @@ METHOD setVisible() CLASS TBROWSE #if 0 /* Always try to locate visible column. - * CA-Clipper does not have such condition. [druzus] + * CA-Cl*pper does not have such condition. [druzus] */ IF ::nColPos >= 1 .AND. ::aColData[ ::nColPos ][ _TBCI_CELLWIDTH ] <= 0 nCol := _PREVCOLUMN( ::aColData, ::nColPos - 1 ) @@ -1930,7 +1930,7 @@ METHOD freeze( nColumns ) CLASS TBROWSE ::nFrozen := nCols ::lFrames := .T. ::nLastPos := 0 - /* CA-Clipper update visible columns here but without + /* CA-Cl*pper update visible columns here but without * colPos repositioning. [druzus] */ _SETVISIBLE( ::aColData, _TBR_COORD( ::n_Right ) - _TBR_COORD( ::n_Left ) + 1, ; diff --git a/harbour/source/rtl/tget.prg b/harbour/source/rtl/tget.prg index 40261264bf..5cd7372262 100644 --- a/harbour/source/rtl/tget.prg +++ b/harbour/source/rtl/tget.prg @@ -92,12 +92,12 @@ CREATE CLASS Get VAR exitState /* 09. */ VAR reader /* 10. */ #ifdef HB_COMPAT_C53 - VAR oControl PROTECTED /* 11. CA-Clipper 5.3 only. */ - VAR cCaption PROTECTED INIT "" /* 12. CA-Clipper 5.3 only. */ - VAR nCapCol PROTECTED INIT 0 /* 13. CA-Clipper 5.3 only. */ - VAR nCapRow PROTECTED INIT 0 /* 14. CA-Clipper 5.3 only. */ - VAR cMessage PROTECTED INIT "" /* 15. CA-Clipper 5.3 only. */ - VAR nDispLen PROTECTED /* 16. CA-Clipper 5.3 places it here. */ + VAR oControl PROTECTED /* 11. CA-Cl*pper 5.3 only. */ + VAR cCaption PROTECTED INIT "" /* 12. CA-Cl*pper 5.3 only. */ + VAR nCapCol PROTECTED INIT 0 /* 13. CA-Cl*pper 5.3 only. */ + VAR nCapRow PROTECTED INIT 0 /* 14. CA-Cl*pper 5.3 only. */ + VAR cMessage PROTECTED INIT "" /* 15. CA-Cl*pper 5.3 only. */ + VAR nDispLen PROTECTED /* 16. CA-Cl*pper 5.3 places it here. */ #endif VAR cType PROTECTED /* +1. Only accessible in CA-Cl*pper when ::hasFocus == .T. In CA-Cl*pper the field may contain random chars after the first one, which is the type. */ VAR cBuffer PROTECTED /* +2. Only accessible in CA-Cl*pper when ::hasFocus == .T. */ diff --git a/harbour/source/rtl/ttopbar.prg b/harbour/source/rtl/ttopbar.prg index 5fe60dec74..3b08346961 100644 --- a/harbour/source/rtl/ttopbar.prg +++ b/harbour/source/rtl/ttopbar.prg @@ -446,7 +446,7 @@ METHOD right( nRight ) CLASS TOPBARMENU METHOD row( nRow ) CLASS TOPBARMENU IF nRow != NIL - /* NOTE: CA-Clipper 5.3 has a bug, where it would show "TOP" in case of an error. */ + /* NOTE: CA-Cl*pper 5.3 has a bug, where it would show "TOP" in case of an error. */ ::nRow := __eInstVar53( Self, "ROW", nRow, "N", 1001 ) ENDIF diff --git a/harbour/source/vm/cmdarg.c b/harbour/source/vm/cmdarg.c index 83efa9ef52..eb9d199b97 100644 --- a/harbour/source/vm/cmdarg.c +++ b/harbour/source/vm/cmdarg.c @@ -168,7 +168,7 @@ static char * hb_cmdargGet( const char * pszName, BOOL bRetValue ) /* Step through all envvar switches. */ - /* NOTE: CA-Clipper doesn't need the switches to be separated by any + /* NOTE: CA-Cl*pper doesn't need the switches to be separated by any chars at all, Harbour is more strict/standard in this respect, it requires the switches to be separated. */ @@ -338,7 +338,7 @@ ULONG hb_cmdargProcessVM( int *pCancelKey, int *pCancelKeyEx ) if( hb_cmdargCheck( "BUILD" ) ) hb_verBuildInfo(); - if( (cFlags = hb_cmdargString( "FLAGS" )) != NULL ) + if( ( cFlags = hb_cmdargString( "FLAGS" ) ) != NULL ) { int i = 0; while( cFlags[ i ] ) @@ -371,7 +371,7 @@ ULONG hb_cmdargProcessVM( int *pCancelKey, int *pCancelKeyEx ) hb_xfree( cFlags ); } - if( (cFlags=hb_cmdargString( "CANCEL" )) != NULL ) + if( ( cFlags = hb_cmdargString( "CANCEL" ) ) != NULL ) { int iVal = atoi( cFlags ); if( iVal ) @@ -379,7 +379,7 @@ ULONG hb_cmdargProcessVM( int *pCancelKey, int *pCancelKeyEx ) hb_xfree( cFlags ); } - if( (cFlags=hb_cmdargString( "CANCELEX" )) != NULL ) + if( ( cFlags = hb_cmdargString( "CANCELEX" ) ) != NULL ) { int iVal = atoi( cFlags ); if( iVal ) diff --git a/harbour/source/vm/estack.c b/harbour/source/vm/estack.c index 4a0b89e9a7..304b8467c1 100644 --- a/harbour/source/vm/estack.c +++ b/harbour/source/vm/estack.c @@ -73,7 +73,7 @@ HB_STACK hb_stack; -static HB_SYMB s_initSymbol = { "hb_stackInit", {HB_FS_STATIC}, {NULL}, NULL }; +static HB_SYMB s_initSymbol = { "hb_stackInit", { HB_FS_STATIC }, { NULL }, NULL }; /* ------------------------------- */ @@ -251,7 +251,6 @@ HB_ITEM_PTR hb_stackNewFrame( PHB_STACK_STATE pStack, USHORT uiParams ) if( ! HB_IS_SYMBOL( pItem ) ) { - /* QUESTION: Is this call needed ? [vszakats] */ hb_stackDispLocal(); hb_errInternal( HB_EI_VMNOTSYMBOL, NULL, "hb_vmDo()", NULL ); } diff --git a/harbour/source/vm/eval.c b/harbour/source/vm/eval.c index 98f03c93c1..01adf70d89 100644 --- a/harbour/source/vm/eval.c +++ b/harbour/source/vm/eval.c @@ -88,15 +88,15 @@ BOOL hb_evalNew( PEVALINFO pEvalInfo, PHB_ITEM pItem ) /* NOTE: CA-Cl*pper is buggy and will not check if more parameters are added than the maximum (9). [vszakats] */ -/* NOTE: CA-Cl*pper NG suggest that the Items passed as parameters should/may +/* NOTE: CA-Cl*pper NG suggests that the Items passed as parameters should/may be released by the programmer explicitly. But in fact hb_evalRelease() - will automatically release all of them. The sample programs in the + will automatically release them all. The sample programs in the NG are doing it that way. Releasing the parameters explicitly in Harbour will cause an internal error, while it will be silently ignored (?) in CA-Cl*pper. This is due to the different internal - handling of the Items, but IIRC it causes leak in CA-Clipper. All in + handling of the Items, but IIRC it causes leak in CA-Cl*pper. All in all, don't release the eval parameter Items explicitly to make both - Harbour and CA-Clipper happy. [vszakats] */ + Harbour and CA-Cl*pper happy. [vszakats] */ BOOL hb_evalPutParam( PEVALINFO pEvalInfo, PHB_ITEM pItem ) { @@ -153,7 +153,7 @@ PHB_ITEM hb_evalLaunch( PEVALINFO pEvalInfo ) return pResult; } -/* NOTE: CA-Clipper NG states that hb_evalLaunch() must be called at least +/* NOTE: CA-Cl*pper NG states that hb_evalLaunch() must be called at least once and only once before calling hb_evalRelease(). Harbour doesn't have these requirements. [vszakats] */ diff --git a/harbour/source/vm/extend.c b/harbour/source/vm/extend.c index f0b472ecd5..5b83941b60 100644 --- a/harbour/source/vm/extend.c +++ b/harbour/source/vm/extend.c @@ -184,7 +184,7 @@ HB_EXPORT char * hb_parc( int iParam, ... ) } } - return ( char * ) 0; + return ( char * ) NULL; } HB_EXPORT char * hb_parcx( int iParam, ... ) diff --git a/harbour/source/vm/fm.c b/harbour/source/vm/fm.c index f7136e4a07..c633291409 100644 --- a/harbour/source/vm/fm.c +++ b/harbour/source/vm/fm.c @@ -898,7 +898,7 @@ ULONG hb_xquery( USHORT uiMode ) #endif break; - case HB_MEM_BLOCKS: /* Harbour extension (Memory blocks used) */ + case HB_MEM_BLOCKS: /* Harbour extension (Memory blocks used) */ #ifdef HB_FM_STATISTICS ulResult = s_lMemoryBlocks; #else diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 28001210b4..fb4f65e9a6 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -448,7 +448,7 @@ HB_EXPORT void hb_vmInit( BOOL bStartMainProc ) hb_vmDoModuleInitFunctions(); /* process AtInit registered functions */ hb_vmDoInitFunctions(); /* process defined INIT functions */ - /* This is undocumented CA-Clipper, if there's a function called _APPMAIN + /* This is undocumented CA-Cl*pper, if there's a function called _APPMAIN it will be executed first. [vszakats] */ { PHB_DYNS pDynSym = hb_dynsymFind( "_APPMAIN" ); diff --git a/harbour/source/vm/itemapi.c b/harbour/source/vm/itemapi.c index f1ae23d20a..711dcb517f 100644 --- a/harbour/source/vm/itemapi.c +++ b/harbour/source/vm/itemapi.c @@ -265,7 +265,7 @@ HB_EXPORT PHB_ITEM hb_itemPutCL( PHB_ITEM pItem, const char * szText, ULONG ulLe else pItem = hb_itemNew( NULL ); - /* NOTE: CA-Clipper seems to be buggy here, it will return ulLen bytes of + /* NOTE: CA-Cl*pper seems to be buggy here, it will return ulLen bytes of trash if the szText buffer is NULL, at least with hb_retclen(). [vszakats] */ diff --git a/harbour/source/vm/memvclip.c b/harbour/source/vm/memvclip.c index c65a31c474..54843067c1 100644 --- a/harbour/source/vm/memvclip.c +++ b/harbour/source/vm/memvclip.c @@ -59,26 +59,24 @@ HB_FUNC_EXTERN( __MVXRELEASE ); HB_FUNC_EXTERN( __MVSAVE ); HB_FUNC_EXTERN( __MVRESTORE ); -/* NOTE: Undocumented Clipper internal function */ +/* NOTE: Undocumented Clipper internal function. */ #ifdef HB_C52_UNDOC HB_FUNC( __QQPUB ) { - if( hb_pcount() == 1 ) + /* In Clipper __QQPUB function does not check number of parameters + or parameter type - just simply takes directly the top item from + VM stack */ + if( hb_pcount() == 1 && hb_param( 1, HB_IT_STRING ) ) { - /* In Clipper __QQPUB function does not check number of parameters - or parameter type - just simply takes directly the top item from - VM stack */ - PHB_ITEM pItem = hb_param( 1, HB_IT_STRING ); - if( pItem ) - HB_FUNC_EXEC( __MVPUBLIC ); + HB_FUNC_EXEC( __MVPUBLIC ); } } #endif -/* CA-Clipper 5.2e compatibility functions. */ +/* CA-Cl*pper 5.2e compatibility functions. */ HB_FUNC( __MCLEAR ) { diff --git a/harbour/utils/hbtest/hbtest.prg b/harbour/utils/hbtest/hbtest.prg index f9f73829df..ea3d56793c 100644 --- a/harbour/utils/hbtest/hbtest.prg +++ b/harbour/utils/hbtest/hbtest.prg @@ -62,7 +62,7 @@ /* NOTE: Guard all Harbour extensions with __HARBOUR__ #ifdefs */ /* NOTE: Use ":className()" instead of ":className" to make your code work with Xbase++. Xbase++ seem to take differenciate between the - object method and object variable form. In CA-Clipper and Harbour + object method and object variable form. In CA-Cl*pper and Harbour both syntax is accepted. Same goes for ":Eval()" */ /* TODO: Add checks for string parameters with embedded NUL character */ @@ -422,8 +422,8 @@ STATIC FUNCTION TEST_END() IF s_nFail != 0 IF "CLIPPER (R)" $ Upper( Version() ) - OutMsg( s_nFhnd, "WARNING ! Failures detected using CA-Clipper." + HB_OSNewLine() +; - "Please fix those expected results which are not bugs in CA-Clipper itself." + HB_OSNewLine() ) + OutMsg( s_nFhnd, "WARNING ! Failures detected using CA-Cl*pper." + HB_OSNewLine() +; + "Please fix those expected results which are not bugs in CA-Cl*pper itself." + HB_OSNewLine() ) ELSE OutMsg( s_nFhnd, "WARNING ! Failures detected" + HB_OSNewLine() ) ENDIF diff --git a/harbour/utils/hbtest/rt_misc.prg b/harbour/utils/hbtest/rt_misc.prg index 2004a5bde6..00167d4243 100644 --- a/harbour/utils/hbtest/rt_misc.prg +++ b/harbour/utils/hbtest/rt_misc.prg @@ -408,7 +408,7 @@ FUNCTION Main_MISC() TEST_LINE( NationMsg(11) , " - " ) TEST_LINE( NationMsg(12) , "Y/N" ) TEST_LINE( NationMsg(13) , "INVALID EXPRESSION" ) - TEST_LINE( NationMsg(14) , "" ) /* Bug in CA-Clipper 5.3a/b, it will return "ATSORT v1.3i x19 06/Mar/95" */ + TEST_LINE( NationMsg(14) , "" ) /* Bug in CA-Cl*pper 5.3a/b, it will return "ATSORT v1.3i x19 06/Mar/95" */ #ifndef __CLIPPER__ /* Causes GPF in CA-Cl*pper (5.2e International, 5.3b) */ TEST_LINE( NationMsg(200) , "" ) /* Bug in CA-Cl*pper, it will return "74?" or other trash */ #endif diff --git a/harbour/utils/hbtest/rt_str.prg b/harbour/utils/hbtest/rt_str.prg index 8a6783e250..b1aed0ecae 100644 --- a/harbour/utils/hbtest/rt_str.prg +++ b/harbour/utils/hbtest/rt_str.prg @@ -387,7 +387,7 @@ FUNCTION Main_STR() /* NOTE: It seems like CA-Cl*pper 5.x is not aware of the BREAK return value of the error handler, so the error is thrown, but we can't catch it. - This bug is fixed in CA-Clipper 5.3 [vszakats] */ + This bug is fixed in CA-Cl*pper 5.3 [vszakats] */ #ifndef __CLIPPER__ #ifndef __XPP__ TEST_LINE( StrTran() , "E BASE 1126 Argument error STRTRAN F:S" ) /* CA-Cl*pper bug, it will exit on this */