2008-05-08 21:14 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* contrib/rddads/ads.ch
* contrib/rddads/rddads.h
* contrib/rddads/adsfunc.c
* contrib/rddads/ads1.c
* contrib/rddads/adsmgmnt.c
* Lots of minor code cleanups, formatting fixes, optimizations,
and several minor fixes.
! Lib version related fixes. (some features were not updated
for newer ACE versions).
+ Automatic version detection extended with 6.20 and 5.00.
6.00 is still missing, if someone has it, pls send it to
me. Even 6.11-8.00 versions disappeared from the vendor's
site lately.
+ Added support for all possible properties in
ADSDDGETDATABASEPROPERTY()
ADSDDSETDATABASEPROPERTY()
* ADSMGGETUSERNAMES() will now always return an array of
users with 6 elements in each item, all data which
is not available for the compiled version of the lib,
will be filled with empty strings. Previously the
number of elements depended on the compiled version.
; Besides the above, no functionality change should be
experienced.
; Please test.
* contrib/rddads/make_b32.bat
* contrib/rddads/make_vc.bat
! Changed to never look for ace32.dll in system32 dir
to generate the ace32.lib.
! Some other fixes to prev change where ADS_VER
was obsoleted.
* contrib/hbct/ctwfunc.c
* contrib/hbct/ctextern.ch
+ Added hbct_MaxRow()/hbct_MaxCol() emulating
the original overloaded MaxRow()/MaxCol()
functions of CT3 lib.
* source/rtl/maxrow.c
* Reverted previous change on request, thus introducing
a 3rd party lib specific function parameter extension.
Users of CT3 lib's overloaded MaxRow(.T.)/MaxCol(.T.)
functions are encouraged to change the app code
to rather use hbct_MaxRow()/hbct_MaxCol()
or hb_ScrMaxRow()/hbScrMaxCol(). These functions are
easy to implement in CA-Cl*pper too (simple wrappers
to Max*()).
* source/compiler/hbmain.c
* Reverted previous change on request. Some outputs
are not exactly CA-Cl*pper compatible this way, but
functionally it probably doesn't matter for most ppl.
* contrib/xhb/hbcompat.ch
! Corrected MaxRow()/MaxCol()/hb_ScrMaxRow()/hb_ScrMaxCol()
translations. (hopefully, someone using xhb please test)
- tests/ctwtest.prg
+ contrib/hbct/tests/ctwtest.prg
* Moved CT lib specific test to contrib local test
directory (containing lots of other CT tests
already). Building these is yet to be solved.
* contrib/hbct/tests/math.prg
* contrib/hbct/tests/trig.prg
* contrib/hbct/tests/num1.prg
! Added SVN header.
* include/hbgtinfo.ch
* Minor comment.
* contrib/rddads/make_gcc.sh
* Help text sync with *.bat.
This commit is contained in:
@@ -8,6 +8,81 @@
|
||||
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
2008-05-08 21:14 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
|
||||
* contrib/rddads/ads.ch
|
||||
* contrib/rddads/rddads.h
|
||||
* contrib/rddads/adsfunc.c
|
||||
* contrib/rddads/ads1.c
|
||||
* contrib/rddads/adsmgmnt.c
|
||||
* Lots of minor code cleanups, formatting fixes, optimizations,
|
||||
and several minor fixes.
|
||||
! Lib version related fixes. (some features were not updated
|
||||
for newer ACE versions).
|
||||
+ Automatic version detection extended with 6.20 and 5.00.
|
||||
6.00 is still missing, if someone has it, pls send it to
|
||||
me. Even 6.11-8.00 versions disappeared from the vendor's
|
||||
site lately.
|
||||
+ Added support for all possible properties in
|
||||
ADSDDGETDATABASEPROPERTY()
|
||||
ADSDDSETDATABASEPROPERTY()
|
||||
* ADSMGGETUSERNAMES() will now always return an array of
|
||||
users with 6 elements in each item, all data which
|
||||
is not available for the compiled version of the lib,
|
||||
will be filled with empty strings. Previously the
|
||||
number of elements depended on the compiled version.
|
||||
; Besides the above, no functionality change should be
|
||||
experienced.
|
||||
; Please test.
|
||||
|
||||
* contrib/rddads/make_b32.bat
|
||||
* contrib/rddads/make_vc.bat
|
||||
! Changed to never look for ace32.dll in system32 dir
|
||||
to generate the ace32.lib.
|
||||
! Some other fixes to prev change where ADS_VER
|
||||
was obsoleted.
|
||||
|
||||
* contrib/hbct/ctwfunc.c
|
||||
* contrib/hbct/ctextern.ch
|
||||
+ Added hbct_MaxRow()/hbct_MaxCol() emulating
|
||||
the original overloaded MaxRow()/MaxCol()
|
||||
functions of CT3 lib.
|
||||
|
||||
* source/rtl/maxrow.c
|
||||
* Reverted previous change on request, thus introducing
|
||||
a 3rd party lib specific function parameter extension.
|
||||
Users of CT3 lib's overloaded MaxRow(.T.)/MaxCol(.T.)
|
||||
functions are encouraged to change the app code
|
||||
to rather use hbct_MaxRow()/hbct_MaxCol()
|
||||
or hb_ScrMaxRow()/hbScrMaxCol(). These functions are
|
||||
easy to implement in CA-Cl*pper too (simple wrappers
|
||||
to Max*()).
|
||||
|
||||
* source/compiler/hbmain.c
|
||||
* Reverted previous change on request. Some outputs
|
||||
are not exactly CA-Cl*pper compatible this way, but
|
||||
functionally it probably doesn't matter for most ppl.
|
||||
|
||||
* contrib/xhb/hbcompat.ch
|
||||
! Corrected MaxRow()/MaxCol()/hb_ScrMaxRow()/hb_ScrMaxCol()
|
||||
translations. (hopefully, someone using xhb please test)
|
||||
|
||||
- tests/ctwtest.prg
|
||||
+ contrib/hbct/tests/ctwtest.prg
|
||||
* Moved CT lib specific test to contrib local test
|
||||
directory (containing lots of other CT tests
|
||||
already). Building these is yet to be solved.
|
||||
|
||||
* contrib/hbct/tests/math.prg
|
||||
* contrib/hbct/tests/trig.prg
|
||||
* contrib/hbct/tests/num1.prg
|
||||
! Added SVN header.
|
||||
|
||||
* include/hbgtinfo.ch
|
||||
* Minor comment.
|
||||
|
||||
* contrib/rddads/make_gcc.sh
|
||||
* Help text sync with *.bat.
|
||||
|
||||
2008-05-08 14:31 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/source/rtl/tbrowse.prg
|
||||
! fixed positioning when cursor is moved by :rowpos assignment and
|
||||
|
||||
@@ -362,4 +362,7 @@ EXTERNAL WSETSHADOW
|
||||
EXTERNAL WSTEP
|
||||
EXTERNAL XTOC
|
||||
|
||||
EXTERNAL HBCT_MAXROW
|
||||
EXTERNAL HBCT_MAXCOL
|
||||
|
||||
#endif /* HB_CTEXTERN_CH_ */
|
||||
|
||||
@@ -329,3 +329,30 @@ HB_FUNC( CTWLASTKEY )
|
||||
{
|
||||
hb_retni( hb_ctwLastKey() );
|
||||
}
|
||||
|
||||
/* NOTE: These two functions are emulating the MaxRow()/MaxCol() core functions
|
||||
"overloaded" by the CT3 library. */
|
||||
|
||||
HB_FUNC( HBCT_MAXROW ) /* Return the maximum screen/window row number (zero origin) */
|
||||
{
|
||||
if( ISLOG( 1 ) && hb_parl( 1 ) )
|
||||
{
|
||||
USHORT uiRows, uiCols;
|
||||
hb_gtScrDim( &uiRows, &uiCols );
|
||||
hb_retni( uiRows - 1 );
|
||||
}
|
||||
else
|
||||
hb_retni( hb_gtMaxRow() );
|
||||
}
|
||||
|
||||
HB_FUNC( HBCT_MAXCOL ) /* Return the maximum screen/window column number (zero origin) */
|
||||
{
|
||||
if( ISLOG( 1 ) && hb_parl( 1 ) )
|
||||
{
|
||||
USHORT uiRows, uiCols;
|
||||
hb_gtScrDim( &uiRows, &uiCols );
|
||||
hb_retni( uiCols - 1 );
|
||||
}
|
||||
else
|
||||
hb_retni( hb_gtMaxCol() );
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
*
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
*
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
*
|
||||
|
||||
@@ -50,6 +50,26 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
If you want to limit your app to use an ADS version
|
||||
earlier than the current one, you must set this constant
|
||||
ADS_LIB_VERSION
|
||||
to the *latest* version you want to allow/require, as in
|
||||
-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.
|
||||
It does cover v6 data dictionary support, built-in
|
||||
Internet Server capabilities, etc.
|
||||
|
||||
So to link to v5, do this:
|
||||
1) Link with an ACE32.LIB created from the version 5
|
||||
dll that imports these functions, and
|
||||
|
||||
2) Set this "define" when compiling rddads:
|
||||
-DADS_LIB_VERSION=500
|
||||
*/
|
||||
|
||||
/* Supported file types */
|
||||
#define ADS_NTX 1
|
||||
#define ADS_CDX 2
|
||||
@@ -82,21 +102,64 @@
|
||||
#define ADS_IGNOREFILTERS 2
|
||||
#define ADS_RESPECTSCOPES 3
|
||||
|
||||
#command SET FILETYPE TO <x:NTX,CDX,ADT> ;
|
||||
=> AdsSetFileType( if( upper( <(x)> ) == "NTX", 1, ;
|
||||
if( upper( <(x)> ) == "CDX", 2, 3 ) ) )
|
||||
|
||||
#command SET SERVER LOCAL => AdsSetServerType( 1 )
|
||||
#command SET SERVER REMOTE => AdsSetServerType( 2 )
|
||||
#command SET FILETYPE TO <x:NTX,CDX,ADT,VFP> ;
|
||||
=> AdsSetFileType( iif( Upper( <(x)> ) == "NTX", ADS_NTX, ;
|
||||
iif( Upper( <(x)> ) == "CDX", ADS_CDX, ;
|
||||
iif( Upper( <(x)> ) == "VFP", ADS_VFP, ADS_ADT ) ) ) )
|
||||
|
||||
/* Server type constants for ORing with AdsSetServerType() */
|
||||
#define ADS_LOCAL_SERVER 1
|
||||
#define ADS_REMOTE_SERVER 2
|
||||
#define ADS_AIS_SERVER 4
|
||||
|
||||
#command SET SERVER LOCAL => AdsSetServerType( ADS_LOCAL_SERVER )
|
||||
#command SET SERVER REMOTE => AdsSetServerType( ADS_REMOTE_SERVER )
|
||||
|
||||
#command SET AXS LOCKING <x:ON,OFF> ;
|
||||
=> AdsLocking( Upper( <(x)> ) == "ON" )
|
||||
|
||||
#command SET RIGHTS CHECKING <x:ON,OFF> ;
|
||||
=> AdsRightsCheck( Upper( <(x)> ) == "ON" )
|
||||
|
||||
/* character set types */
|
||||
#define ADS_ANSI 1
|
||||
#define ADS_OEM 2
|
||||
|
||||
#command SET CHARTYPE TO <x:ANSI,OEM> ;
|
||||
=> AdsSetCharType( iif( Upper( <(x)> ) == "OEM", ADS_OEM, ADS_ANSI ) )
|
||||
|
||||
#command COMMIT => AdsWriteAllRecords()
|
||||
#command BEGIN TRANSACTION => AdsBeginTransaction()
|
||||
#command COMMIT TRANSACTION => AdsCommitTransaction()
|
||||
#command ROLLBACK TRANSACTION => AdsRollback()
|
||||
|
||||
#command AUTOUSE <(db)> VIA <rdd> ALTERNATE <altrdd> ;
|
||||
[ALIAS <a>] ;
|
||||
[<new: NEW>] ;
|
||||
[<ex: EXCLUSIVE>] ;
|
||||
[<sh: SHARED>] ;
|
||||
[<ro: READONLY>] ;
|
||||
[INDEX <(index1)> [, <(indexn)>]] ;
|
||||
;
|
||||
=> IF AdsIsServerLoaded( <(db)> ) > 0 ;
|
||||
; dbUseArea( ;
|
||||
<.new.>, <rdd>, <(db)>, <(a)>, ;
|
||||
iif( <.sh.> .OR. <.ex.>, !<.ex.>, NIL ), <.ro.> ;
|
||||
) ;
|
||||
[; dbSetIndex( <(index1)> )] ;
|
||||
[; dbSetIndex( <(indexn)> )] ;
|
||||
; ELSE ;
|
||||
; dbUseArea( ;
|
||||
<.new.>, <altrdd>, <(db)>, <(a)>, ;
|
||||
iif( <.sh.> .OR. <.ex.>, !<.ex.>, NIL ), <.ro.> ;
|
||||
) ;
|
||||
[; dbSetIndex( <(index1)> )] ;
|
||||
[; dbSetIndex( <(indexn)> )] ;
|
||||
; ENDIF
|
||||
|
||||
/*
|
||||
* Constants for AdsMgGetServerType
|
||||
* Note ADS_MGMT_NETWARE_SERVER remains for backwards compatibility only
|
||||
* Constants for AdsMgGetServerType()
|
||||
* Note ADS_MGMT_NETWARE_SERVER remains for backwards compatibility only.
|
||||
*/
|
||||
#define ADS_MGMT_NETWARE_SERVER 1
|
||||
#define ADS_MGMT_NETWARE4_OR_OLDER_SERVER 1
|
||||
@@ -106,35 +169,6 @@
|
||||
#define ADS_MGMT_NETWARE5_OR_NEWER_SERVER 5
|
||||
#define ADS_MGMT_LINUX_SERVER 6
|
||||
|
||||
/*
|
||||
If you want to limit your app to use an ADS version
|
||||
earlier than the current one, you must set this constant
|
||||
ADS_LIB_VERSION
|
||||
to the *latest* version you want to allow/require, as in
|
||||
-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.
|
||||
It does cover v6 data dictionary support, built-in
|
||||
Internet Server capabilities, etc.
|
||||
|
||||
So to link to v5, do this:
|
||||
1) Link with an ACE32.LIB created from the version 5
|
||||
dll that imports these functions, and
|
||||
|
||||
2) Set this "define" when compiling rddads:
|
||||
-DADS_LIB_VERSION=500
|
||||
|
||||
*/
|
||||
|
||||
#command SET AXS LOCKING <x:ON,OFF> ;
|
||||
=> AdsLocking( if( upper( <(x)> ) == "ON", .t., .f. ) )
|
||||
|
||||
#command SET CHARTYPE TO <x:ANSI,OEM> ;
|
||||
=> AdsSetCharType( if( upper( <(x)> ) == "OEM", 2, 1 ) )
|
||||
|
||||
#command COMMIT => AdsWriteAllRecords()
|
||||
|
||||
/* ACE Handle types */
|
||||
#define ADS_CONNECTION 1
|
||||
#define ADS_TABLE 2
|
||||
@@ -147,13 +181,6 @@
|
||||
|
||||
#define AE_NO_CONNECTION 5036
|
||||
|
||||
|
||||
#command BEGIN TRANSACTION => AdsBeginTransaction()
|
||||
|
||||
#command COMMIT TRANSACTION => AdsCommitTransaction()
|
||||
|
||||
#command ROLLBACK TRANSACTION => AdsRollback()
|
||||
|
||||
#define ADS_DD_TABLE_OBJECT 1
|
||||
#define ADS_DD_RELATION_OBJECT 2
|
||||
#define ADS_DD_INDEX_FILE_OBJECT 3
|
||||
@@ -169,13 +196,11 @@
|
||||
#define ADS_DD_LINK_OBJECT 12
|
||||
#define ADS_DD_TABLE_VIEW_OR_LINK_OBJECT 13 /* Used in v6.2 AdsFindFirst/NextTable */
|
||||
|
||||
|
||||
/* Common properties numbers < 100 */
|
||||
#define ADS_DD_COMMENT 1
|
||||
#define ADS_DD_VERSION 2
|
||||
#define ADS_DD_USER_DEFINED_PROP 3
|
||||
|
||||
|
||||
/* Database properties between 100 and 199 */
|
||||
#define ADS_DD_DEFAULT_TABLE_PATH 100
|
||||
#define ADS_DD_ADMIN_PASSWORD 101
|
||||
@@ -281,7 +306,6 @@
|
||||
#define ADS_DD_LINK_OPTIONS 1301
|
||||
#define ADS_DD_LINK_USERNAME 1302
|
||||
|
||||
|
||||
#define ADS_DD_LEVEL_0 0
|
||||
#define ADS_DD_LEVEL_1 1
|
||||
#define ADS_DD_LEVEL_2 2
|
||||
@@ -296,30 +320,3 @@
|
||||
#define ADS_DD_DFV_UNKNOWN 1
|
||||
#define ADS_DD_DFV_NONE 2
|
||||
#define ADS_DD_DFV_VALUES_STORED 3
|
||||
|
||||
#command AUTOUSE <(db)> VIA <rdd> ALTERNATE <altrdd> ;
|
||||
[ALIAS <a>] ;
|
||||
[<new: NEW>] ;
|
||||
[<ex: EXCLUSIVE>] ;
|
||||
[<sh: SHARED>] ;
|
||||
[<ro: READONLY>] ;
|
||||
[INDEX <(index1)> [, <(indexn)>]] ;
|
||||
;
|
||||
=> if ADSISSERVERLOADED( <(db)> ) >0 ;
|
||||
; dbUseArea( ;
|
||||
<.new.>, <rdd>, <(db)>, <(a)>, ;
|
||||
if (<.sh.> .or. <.ex.>, !<.ex.>, NIL), <.ro.> ;
|
||||
) ;
|
||||
[; dbSetIndex( <(index1)> )] ;
|
||||
[; dbSetIndex( <(indexn)> )] ;
|
||||
; else ;
|
||||
; dbUseArea( ;
|
||||
<.new.>, <altrdd>, <(db)>, <(a)>, ;
|
||||
if (<.sh.> .or. <.ex.>, !<.ex.>, NIL), <.ro.> ;
|
||||
) ;
|
||||
[; dbSetIndex( <(index1)> )] ;
|
||||
[; dbSetIndex( <(indexn)> )] ;
|
||||
; endif
|
||||
|
||||
#command SET RIGHTS CHECKING <x:ON,OFF> ;
|
||||
=> ADSRIGHTSCHECK ( if( upper( <(x)> ) == "ON", 1,0) )
|
||||
|
||||
@@ -189,15 +189,15 @@ static ERRCODE commonError( ADSAREAP pArea, USHORT uiGenCode, USHORT uiSubCode,
|
||||
#if 0
|
||||
static void DumpArea( ADSAREAP pArea ) /* For debugging: call this to dump ads server settings to HB_TRACE. Currently in a quick-and-dirty state... */
|
||||
{
|
||||
UNSIGNED8 pucTemp[1025];
|
||||
UNSIGNED8 pucTemp[ 1025 ];
|
||||
UNSIGNED16 pusLen = 1024;
|
||||
UNSIGNED32 ulRetVal, ulRetAOF, ulRetFilt;
|
||||
UNSIGNED8 pucFormat[16];
|
||||
UNSIGNED8 pucFilter[1025];
|
||||
/*UNSIGNED8 aucBuffer[MAX_STR_LEN + 1];*/
|
||||
UNSIGNED8 pucIndexName[MAX_STR_LEN + 1];
|
||||
UNSIGNED8 pucIndexExpr[MAX_STR_LEN + 1];
|
||||
UNSIGNED8 pucIndexCond[MAX_STR_LEN + 1];
|
||||
UNSIGNED8 pucFormat[ 16 ];
|
||||
UNSIGNED8 pucFilter[ 1025 ];
|
||||
/* UNSIGNED8 aucBuffer[ MAX_STR_LEN + 1 ]; */
|
||||
UNSIGNED8 pucIndexName[ MAX_STR_LEN + 1 ];
|
||||
UNSIGNED8 pucIndexExpr[ MAX_STR_LEN + 1 ];
|
||||
UNSIGNED8 pucIndexCond[ MAX_STR_LEN + 1 ];
|
||||
|
||||
if( pArea )
|
||||
{
|
||||
@@ -225,13 +225,12 @@ static void DumpArea( ADSAREAP pArea ) /* For debugging: call this to dump ads
|
||||
AdsGetIndexExpr( pArea->hOrdCurrent, pucIndexExpr, &pusLen );
|
||||
|
||||
pusLen = 1024; /*ADS top/bottom are 1,2 instead of 0,1*/
|
||||
ulRetVal = AdsGetScope( pArea->hOrdCurrent, 1, pucTemp, &pusLen );
|
||||
ulRetVal = AdsGetScope( pArea->hOrdCurrent, ADS_TOP, pucTemp, &pusLen );
|
||||
pusLen = 1024;
|
||||
ulRetFilt = AdsGetScope( pArea->hOrdCurrent, 2, pucFilter, &pusLen );
|
||||
ulRetFilt = AdsGetScope( pArea->hOrdCurrent, ADS_BOTTOM, pucFilter, &pusLen );
|
||||
|
||||
HB_TRACE(HB_TR_ALWAYS, ("DumpArea Index: %s Expr: %s Cond: %s\n Scope: (RetVal %lu) %s Bottom: (RetVal %lu) %s",
|
||||
pucIndexName, pucIndexExpr, pucIndexCond, ulRetVal, pucTemp, ulRetFilt, pucFilter));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -241,8 +240,8 @@ static BOOL adsIndexKeyCmp( ADSHANDLE hIndex, UNSIGNED8 * pszKey, UNSIGNED16 u16
|
||||
{
|
||||
UNSIGNED32 u32RetVal;
|
||||
UNSIGNED16 u16Found = FALSE;
|
||||
UNSIGNED8 pucCurKey[ ADS_MAX_KEY_LENGTH + 1 ];
|
||||
UNSIGNED16 u16CurKeyLen = ADS_MAX_KEY_LENGTH;
|
||||
UNSIGNED8 pucCurKey[ADS_MAX_KEY_LENGTH + 1];
|
||||
|
||||
/*
|
||||
* test if current record has fields that match the given key expression.
|
||||
@@ -462,7 +461,7 @@ static void adsGetKeyItem( ADSAREAP pArea, PHB_ITEM pItem, int iKeyType,
|
||||
{
|
||||
hb_itemPutDS( pItem, pKeyBuf );
|
||||
}
|
||||
else /* ADS_CDX, ADS_ADT */
|
||||
else /* ADS_CDX, ADS_ADT, ADS_VFP */
|
||||
{
|
||||
HB_ORD2DBL( pKeyBuf, &dValue );
|
||||
hb_itemPutDL( pItem, ( LONG ) dValue );
|
||||
@@ -481,7 +480,7 @@ static void adsGetKeyItem( ADSAREAP pArea, PHB_ITEM pItem, int iKeyType,
|
||||
|
||||
static void adsScopeGet( ADSAREAP pArea, ADSHANDLE hOrder, USHORT nScope, PHB_ITEM pItem )
|
||||
{
|
||||
UNSIGNED8 pucScope[ ADS_MAX_KEY_LENGTH+1 ];
|
||||
UNSIGNED8 pucScope[ ADS_MAX_KEY_LENGTH + 1 ];
|
||||
UNSIGNED16 u16Len = ADS_MAX_KEY_LENGTH;
|
||||
UNSIGNED32 u32RetVal;
|
||||
UNSIGNED16 u16KeyType = 0;
|
||||
@@ -2818,8 +2817,8 @@ static ERRCODE adsInfo( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
|
||||
|
||||
case DBI_FULLPATH :
|
||||
{
|
||||
UNSIGNED8 aucBuffer[MAX_STR_LEN + 1];
|
||||
UNSIGNED16 pusLen = MAX_STR_LEN;
|
||||
UNSIGNED8 aucBuffer[ MAX_STR_LEN + 1 ];
|
||||
UNSIGNED16 pusLen = MAX_STR_LEN;
|
||||
AdsGetTableFilename( pArea->hTable, ADS_FULLPATHNAME, aucBuffer, &pusLen );
|
||||
hb_itemPutCL( pItem, (char*)aucBuffer, pusLen );
|
||||
break;
|
||||
@@ -2863,9 +2862,9 @@ static ERRCODE adsInfo( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
|
||||
UNSIGNED32 ulMajor;
|
||||
UNSIGNED32 ulMinor;
|
||||
UNSIGNED8 ucLetter;
|
||||
UNSIGNED8 ucDesc[128];
|
||||
UNSIGNED8 ucDesc[ 128 ];
|
||||
UNSIGNED16 usDescLen = sizeof( ucDesc ) - 1;
|
||||
UNSIGNED8 ucVersion[256];
|
||||
UNSIGNED8 ucVersion[ 256 ];
|
||||
|
||||
AdsGetVersion( &ulMajor, &ulMinor, &ucLetter, ucDesc, &usDescLen);
|
||||
|
||||
@@ -2954,11 +2953,13 @@ static ERRCODE adsOpen( ADSAREAP pArea, LPDBOPENINFO pOpenInfo )
|
||||
u32RetVal = AdsGetHandleType( hConnection, &pusType);
|
||||
if( u32RetVal == AE_SUCCESS )
|
||||
{
|
||||
#ifdef ADS_SYS_ADMIN_CONNECTION /* Defined below 9.00 */
|
||||
#if ADS_LIB_VERSION >= 600 /* ADS_*_CONNECTION was added in >= 6.00 */
|
||||
#if ADS_LIB_VERSION < 900 /* ADS_SYS_ADMIN_CONNECTION was removed in >= 9.00 */
|
||||
fDictionary = ( pusType == ADS_DATABASE_CONNECTION
|
||||
|| pusType == ADS_SYS_ADMIN_CONNECTION );
|
||||
#else
|
||||
fDictionary = ( pusType == ADS_DATABASE_CONNECTION );
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
szFile = ( char * ) pOpenInfo->abName;
|
||||
@@ -3077,7 +3078,7 @@ static ERRCODE adsOpen( ADSAREAP pArea, LPDBOPENINFO pOpenInfo )
|
||||
dbFieldInfo.uiFlags = 0;
|
||||
if( u32Length > pArea->maxFieldLen )
|
||||
{
|
||||
pArea->maxFieldLen = u32Length;
|
||||
pArea->maxFieldLen = u32Length;
|
||||
}
|
||||
|
||||
dbFieldInfo.uiTypeExtended = pusType;
|
||||
@@ -3093,9 +3094,11 @@ static ERRCODE adsOpen( ADSAREAP pArea, LPDBOPENINFO pOpenInfo )
|
||||
dbFieldInfo.uiFlags = HB_FF_BINARY;
|
||||
break;
|
||||
|
||||
#ifdef ADS_CISTRING /* Not defined below 7.10 */
|
||||
case ADS_CISTRING:
|
||||
dbFieldInfo.uiType = HB_FT_STRING;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ADS_NUMERIC:
|
||||
dbFieldInfo.uiTypeExtended = 0;
|
||||
@@ -3418,7 +3421,7 @@ static ERRCODE adsSetRel( ADSAREAP pArea, LPDBRELINFO lpdbRelations )
|
||||
|
||||
static ERRCODE adsOrderListAdd( ADSAREAP pArea, LPDBORDERINFO pOrderInfo )
|
||||
{
|
||||
ADSHANDLE ahIndex[50];
|
||||
ADSHANDLE ahIndex[ 50 ];
|
||||
UNSIGNED16 u16ArrayLen = 50;
|
||||
UNSIGNED32 u32RetVal;
|
||||
|
||||
@@ -3695,7 +3698,7 @@ static ERRCODE adsOrderCreate( ADSAREAP pArea, LPDBORDERCREATEINFO pOrderInfo )
|
||||
|
||||
if( fClose )
|
||||
{
|
||||
ADSHANDLE ahIndex[50];
|
||||
ADSHANDLE ahIndex[ 50 ];
|
||||
UNSIGNED16 pusArrayLen = 50;
|
||||
|
||||
u32RetVal = AdsOpenIndex( pArea->hTable,
|
||||
@@ -3750,7 +3753,7 @@ static ERRCODE adsOrderDestroy( ADSAREAP pArea, LPDBORDERINFO pOrderInfo )
|
||||
static ERRCODE adsOrderInfo( ADSAREAP pArea, USHORT uiIndex, LPDBORDERINFO pOrderInfo )
|
||||
{
|
||||
ADSHANDLE hIndex;
|
||||
UNSIGNED8 aucBuffer[MAX_STR_LEN + 1];
|
||||
UNSIGNED8 aucBuffer[ MAX_STR_LEN + 1 ];
|
||||
UNSIGNED16 u16len = MAX_STR_LEN;
|
||||
UNSIGNED16 u16 = 0;
|
||||
UNSIGNED32 u32 = 0;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,9 +4,9 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Advantage Database Server RDD ( Management functions )
|
||||
* Advantage Database Server RDD (Management functions)
|
||||
*
|
||||
* Copyright 2001 Brian Hays <bhays@abacuslaw.com>
|
||||
* Copyright 2001 Brian Hays <bhays@abacuslaw.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -67,14 +67,10 @@ ADSHANDLE ads_g_hMgmtHandle = 0;
|
||||
|
||||
HB_FUNC( ADSMGCONNECT )
|
||||
{
|
||||
/* ulRetVal = AdsMgConnect( "\\\\server\\volume:", NULL, NULL, &ads_g_hMgmtHandle );
|
||||
// UNSIGNED32 ENTRYPOINT AdsMgConnect( UNSIGNED8 *pucServerName,
|
||||
// UNSIGNED8 *pucUserName,
|
||||
// UNSIGNED8 *pucPassword,
|
||||
// ADSHANDLE *pads_g_hMgmtHandle );
|
||||
*/
|
||||
|
||||
hb_retnl( AdsMgConnect( (UNSIGNED8 *) hb_parcx(1), (UNSIGNED8 *) hb_parcx(2), (UNSIGNED8 *) hb_parcx(3), &ads_g_hMgmtHandle ) );
|
||||
hb_retnl( AdsMgConnect( (UNSIGNED8 *) hb_parcx( 1 ) /* pucServerName */,
|
||||
(UNSIGNED8 *) hb_parcx( 2 ) /* pucUserName */,
|
||||
(UNSIGNED8 *) hb_parcx( 3 ) /* pucPassword */,
|
||||
&ads_g_hMgmtHandle ) );
|
||||
}
|
||||
|
||||
HB_FUNC( ADSMGDISCONNECT )
|
||||
@@ -86,60 +82,63 @@ HB_FUNC( ADSMGDISCONNECT )
|
||||
HB_FUNC( ADSMGGETINSTALLINFO )
|
||||
{
|
||||
UNSIGNED32 ulRetVal;
|
||||
UNSIGNED16 usStructSize;
|
||||
ADS_MGMT_INSTALL_INFO stInstallInfo;
|
||||
UNSIGNED16 usStructSize = sizeof( ADS_MGMT_INSTALL_INFO );
|
||||
|
||||
usStructSize = sizeof( ADS_MGMT_INSTALL_INFO );
|
||||
ulRetVal = AdsMgGetInstallInfo( ads_g_hMgmtHandle, &stInstallInfo, &usStructSize );
|
||||
|
||||
/*
|
||||
//if( sizeof( ADS_MGMT_INSTALL_INFO ) < usStructSize )
|
||||
// printf( "\nInstallation Information structure on server is larger." );
|
||||
// printf( "\nMore possible info available." );
|
||||
if( sizeof( ADS_MGMT_INSTALL_INFO ) < usStructSize )
|
||||
{
|
||||
HB_TRACE(HB_TR_INFO, ("AdsMgGetInstallInfo() structure on the server is larger.\n"
|
||||
"More info is available with newer client lib." ));
|
||||
}
|
||||
*/
|
||||
|
||||
if( ulRetVal == AE_SUCCESS )
|
||||
{
|
||||
hb_reta( 8 );
|
||||
hb_stornl( stInstallInfo.ulUserOption , -1, 1 ); /* User option purchased*/
|
||||
hb_storc ( (char *) stInstallInfo.aucRegisteredOwner, -1, 2 ); /* Registered owner */
|
||||
hb_storc ( (char *) stInstallInfo.aucVersionStr , -1, 3 ); /* Advantage version */
|
||||
hb_storc ( (char *) stInstallInfo.aucInstallDate , -1, 4 ); /* Install date string */
|
||||
hb_storc ( (char *) stInstallInfo.aucOemCharName , -1, 5 ); /* OEM char language */
|
||||
hb_storc ( (char *) stInstallInfo.aucAnsiCharName , -1, 6 ); /* ANSI char language */
|
||||
hb_storc ( (char *) stInstallInfo.aucEvalExpireDate , -1, 7 ); /* Eval expiration date */
|
||||
hb_storc ( (char *) stInstallInfo.aucSerialNumber , -1, 8 ); /* Serial number string */
|
||||
hb_stornl( stInstallInfo.ulUserOption , -1, 1 ); /* User option purchased */
|
||||
hb_storc ( (char *) stInstallInfo.aucRegisteredOwner, -1, 2 ); /* Registered owner */
|
||||
hb_storc ( (char *) stInstallInfo.aucVersionStr , -1, 3 ); /* Advantage version */
|
||||
hb_storc ( (char *) stInstallInfo.aucInstallDate , -1, 4 ); /* Install date string */
|
||||
hb_storc ( (char *) stInstallInfo.aucOemCharName , -1, 5 ); /* OEM char language */
|
||||
hb_storc ( (char *) stInstallInfo.aucAnsiCharName , -1, 6 ); /* ANSI char language */
|
||||
hb_storc ( (char *) stInstallInfo.aucEvalExpireDate , -1, 7 ); /* Eval expiration date */
|
||||
hb_storc ( (char *) stInstallInfo.aucSerialNumber , -1, 8 ); /* Serial number string */
|
||||
}
|
||||
}
|
||||
|
||||
HB_FUNC( ADSMGGETACTIVITYINFO )
|
||||
{
|
||||
UNSIGNED32 ulRetVal;
|
||||
UNSIGNED16 usStructSize;
|
||||
ADS_MGMT_ACTIVITY_INFO stActivityInfo;
|
||||
UNSIGNED16 usStructSize = sizeof( ADS_MGMT_ACTIVITY_INFO );
|
||||
unsigned int iOption = hb_parni( 1 );
|
||||
|
||||
usStructSize = sizeof( ADS_MGMT_ACTIVITY_INFO );
|
||||
ulRetVal = AdsMgGetActivityInfo( ads_g_hMgmtHandle, &stActivityInfo, &usStructSize );
|
||||
/*
|
||||
// if( sizeof( ADS_MGMT_ACTIVITY_INFO ) < usStructSize )
|
||||
// printf( "\nActivity Information structure on server is larger." );
|
||||
// printf( "\nMore possible info available." );
|
||||
*/
|
||||
|
||||
/*
|
||||
if( sizeof( ADS_MGMT_ACTIVITY_INFO ) < usStructSize )
|
||||
{
|
||||
HB_TRACE(HB_TR_INFO, ("AdsMgGetActivityInfo() structure on the server is larger.\n"
|
||||
"More info is available with newer client lib." ));
|
||||
}
|
||||
*/
|
||||
|
||||
if( iOption && ulRetVal == AE_SUCCESS )
|
||||
{
|
||||
switch( iOption )
|
||||
{
|
||||
case 1 :
|
||||
case 1:
|
||||
hb_retnl( stActivityInfo.ulOperations ); /* Number operations since started */
|
||||
break;
|
||||
|
||||
case 2 :
|
||||
case 2:
|
||||
hb_retnl( stActivityInfo.ulLoggedErrors ); /* Number logged errors */
|
||||
break;
|
||||
|
||||
|
||||
case 3 :
|
||||
case 3:
|
||||
hb_reta( 4 ); /* Length of time ADS has been up */
|
||||
hb_stornl( stActivityInfo.stUpTime.usDays, -1, 1 );
|
||||
hb_stornl( stActivityInfo.stUpTime.usHours, -1, 2 );
|
||||
@@ -147,86 +146,75 @@ HB_FUNC( ADSMGGETACTIVITYINFO )
|
||||
hb_stornl( stActivityInfo.stUpTime.usSeconds, -1, 4 );
|
||||
break;
|
||||
|
||||
|
||||
case 4 :
|
||||
case 4:
|
||||
hb_reta( 3 ); /* Users in use, max, rejected */
|
||||
hb_stornl( stActivityInfo.stUsers.ulInUse, -1, 1 );
|
||||
hb_stornl( stActivityInfo.stUsers.ulMaxUsed, -1, 2 );
|
||||
hb_stornl( stActivityInfo.stUsers.ulRejected, -1, 3 );
|
||||
break;
|
||||
|
||||
|
||||
case 5 :
|
||||
case 5:
|
||||
hb_reta( 3 ); /* Conns in use, max, rejected */
|
||||
hb_stornl( stActivityInfo.stConnections.ulInUse, -1, 1 );
|
||||
hb_stornl( stActivityInfo.stConnections.ulMaxUsed, -1, 2 );
|
||||
hb_stornl( stActivityInfo.stConnections.ulRejected, -1, 3 );
|
||||
break;
|
||||
|
||||
|
||||
case 6 :
|
||||
case 6:
|
||||
hb_reta( 3 ); /* WAs in use, max, rejected */
|
||||
hb_stornl( stActivityInfo.stWorkAreas.ulInUse, -1, 1 );
|
||||
hb_stornl( stActivityInfo.stWorkAreas.ulMaxUsed, -1, 2 );
|
||||
hb_stornl( stActivityInfo.stWorkAreas.ulRejected, -1, 3 );
|
||||
break;
|
||||
|
||||
|
||||
case 7 :
|
||||
case 7:
|
||||
hb_reta( 3 ); /* Tables in use, max, rejected */
|
||||
hb_stornl( stActivityInfo.stTables.ulInUse, -1, 1 );
|
||||
hb_stornl( stActivityInfo.stTables.ulMaxUsed, -1, 2 );
|
||||
hb_stornl( stActivityInfo.stTables.ulRejected, -1, 3 );
|
||||
break;
|
||||
|
||||
|
||||
case 8 :
|
||||
case 8:
|
||||
hb_reta( 3 ); /* Indexes in use, max, rejected */
|
||||
hb_stornl( stActivityInfo.stIndexes.ulInUse, -1, 1 );
|
||||
hb_stornl( stActivityInfo.stIndexes.ulMaxUsed, -1, 2 );
|
||||
hb_stornl( stActivityInfo.stIndexes.ulRejected, -1, 3 );
|
||||
break;
|
||||
|
||||
|
||||
case 9 :
|
||||
case 9:
|
||||
hb_reta( 3 ); /* Locks in use, max, rejected */
|
||||
hb_stornl( stActivityInfo.stLocks.ulInUse, -1, 1 );
|
||||
hb_stornl( stActivityInfo.stLocks.ulMaxUsed, -1, 2 );
|
||||
hb_stornl( stActivityInfo.stLocks.ulRejected, -1, 3 );
|
||||
break;
|
||||
|
||||
|
||||
case 10 :
|
||||
case 10:
|
||||
hb_reta( 3 ); /* TPS header elems in use, max */
|
||||
hb_stornl( stActivityInfo.stTpsHeaderElems.ulInUse, -1, 1 );
|
||||
hb_stornl( stActivityInfo.stTpsHeaderElems.ulMaxUsed, -1, 2 );
|
||||
hb_stornl( stActivityInfo.stTpsHeaderElems.ulRejected, -1, 3 );
|
||||
break;
|
||||
|
||||
|
||||
case 11 :
|
||||
case 11:
|
||||
hb_reta( 3 ); /* TPS vis elems in use, max */
|
||||
hb_stornl( stActivityInfo.stTpsVisElems.ulInUse, -1, 1 );
|
||||
hb_stornl( stActivityInfo.stTpsVisElems.ulMaxUsed, -1, 2 );
|
||||
hb_stornl( stActivityInfo.stTpsVisElems.ulRejected, -1, 3 );
|
||||
break;
|
||||
|
||||
|
||||
case 12 :
|
||||
case 12:
|
||||
hb_reta( 3 ); /* TPS memo elems in use, max */
|
||||
hb_stornl( stActivityInfo.stTpsMemoElems.ulInUse, -1, 1 );
|
||||
hb_stornl( stActivityInfo.stTpsMemoElems.ulMaxUsed, -1, 2 );
|
||||
hb_stornl( stActivityInfo.stTpsMemoElems.ulRejected, -1, 3 );
|
||||
break;
|
||||
|
||||
|
||||
case 13 :
|
||||
case 13:
|
||||
hb_reta( 3 ); /* Worker threads in use, max */
|
||||
hb_stornl( stActivityInfo.stWorkerThreads.ulInUse, -1, 1 );
|
||||
hb_stornl( stActivityInfo.stWorkerThreads.ulMaxUsed, -1, 2 );
|
||||
hb_stornl( stActivityInfo.stWorkerThreads.ulRejected, -1, 3 );
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -234,32 +222,33 @@ HB_FUNC( ADSMGGETACTIVITYINFO )
|
||||
HB_FUNC( ADSMGGETCOMMSTATS )
|
||||
{
|
||||
UNSIGNED32 ulRetVal;
|
||||
UNSIGNED16 usStructSize;
|
||||
ADS_MGMT_COMM_STATS stCommStats;
|
||||
UNSIGNED16 usStructSize = sizeof( ADS_MGMT_COMM_STATS );
|
||||
|
||||
usStructSize = sizeof( ADS_MGMT_COMM_STATS );
|
||||
ulRetVal = AdsMgGetCommStats( ads_g_hMgmtHandle, &stCommStats, &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( sizeof( ADS_MGMT_COMM_STATS ) < usStructSize )
|
||||
{
|
||||
HB_TRACE(HB_TR_INFO, ("AdsMgGetCommStats() structure on the server is larger.\n"
|
||||
"More info is available with newer client lib." ));
|
||||
}
|
||||
*/
|
||||
|
||||
if( ulRetVal == AE_SUCCESS )
|
||||
{
|
||||
hb_reta( 11 );
|
||||
hb_stornd( stCommStats.dPercentCheckSums, -1, 1 ); /* % of pkts with checksum failures */
|
||||
hb_stornl( stCommStats.ulTotalPackets, -1, 2 ); /* Total packets received */
|
||||
hb_stornl( stCommStats.ulRcvPktOutOfSeq , -1, 3 ); /* Receive packets out of sequence */
|
||||
hb_stornl( stCommStats.ulNotLoggedIn , -1, 4 ); /* Packet owner not logged in */
|
||||
hb_stornl( stCommStats.ulRcvReqOutOfSeq , -1, 5 ); /* Receive requests out of sequence */
|
||||
hb_stornl( stCommStats.ulCheckSumFailures, -1, 6 ); /* Checksum failures */
|
||||
hb_stornl( stCommStats.ulDisconnectedUsers,-1, 7 ); /* Server initiated disconnects */
|
||||
hb_stornl( stCommStats.ulPartialConnects , -1, 8 ); /* Removed partial connections */
|
||||
hb_stornl( stCommStats.ulInvalidPackets , -1, 9 ); /* Rcvd invalid packets (NT only) */
|
||||
hb_stornl( stCommStats.ulRecvFromErrors , -1, 10); /* RecvFrom failed (NT only) */
|
||||
hb_stornl( stCommStats.ulSendToErrors , -1, 11); /* SendTo failed (NT only) */
|
||||
hb_stornd( stCommStats.dPercentCheckSums , -1, 1 ); /* % of pkts with checksum failures */
|
||||
hb_stornl( stCommStats.ulTotalPackets , -1, 2 ); /* Total packets received */
|
||||
hb_stornl( stCommStats.ulRcvPktOutOfSeq , -1, 3 ); /* Receive packets out of sequence */
|
||||
hb_stornl( stCommStats.ulNotLoggedIn , -1, 4 ); /* Packet owner not logged in */
|
||||
hb_stornl( stCommStats.ulRcvReqOutOfSeq , -1, 5 ); /* Receive requests out of sequence */
|
||||
hb_stornl( stCommStats.ulCheckSumFailures , -1, 6 ); /* Checksum failures */
|
||||
hb_stornl( stCommStats.ulDisconnectedUsers, -1, 7 ); /* Server initiated disconnects */
|
||||
hb_stornl( stCommStats.ulPartialConnects , -1, 8 ); /* Removed partial connections */
|
||||
hb_stornl( stCommStats.ulInvalidPackets , -1, 9 ); /* Rcvd invalid packets (NT only) */
|
||||
hb_stornl( stCommStats.ulRecvFromErrors , -1, 10); /* RecvFrom failed (NT only) */
|
||||
hb_stornl( stCommStats.ulSendToErrors , -1, 11); /* SendTo failed (NT only) */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,29 +266,33 @@ HB_FUNC( ADSMGRESETCOMMSTATS )
|
||||
|
||||
HB_FUNC( ADSMGGETCONFIGINFO )
|
||||
{
|
||||
UNSIGNED32 ulRetVal ;
|
||||
ADS_MGMT_CONFIG_PARAMS stConfigValues;
|
||||
ADS_MGMT_CONFIG_MEMORY stConfigMemory;
|
||||
UNSIGNED16 usConfigValuesStructSize;
|
||||
UNSIGNED16 usConfigMemoryStructSize;
|
||||
int iOption = ISNUM(1) ? hb_parni(1) : 1 ; /* Pass 0 for Values, 1 for memory */
|
||||
UNSIGNED32 ulRetVal;
|
||||
ADS_MGMT_CONFIG_PARAMS stConfigValues;
|
||||
ADS_MGMT_CONFIG_MEMORY stConfigMemory;
|
||||
UNSIGNED16 usConfigValuesStructSize = sizeof( ADS_MGMT_CONFIG_PARAMS );
|
||||
UNSIGNED16 usConfigMemoryStructSize = sizeof( ADS_MGMT_CONFIG_MEMORY );
|
||||
int iOption = ISNUM( 1 ) ? hb_parni( 1 ) : 1; /* Pass 0 for Values, 1 for memory */
|
||||
|
||||
usConfigValuesStructSize = sizeof( ADS_MGMT_CONFIG_PARAMS );
|
||||
usConfigMemoryStructSize = sizeof( ADS_MGMT_CONFIG_MEMORY );
|
||||
ulRetVal = AdsMgGetConfigInfo( ads_g_hMgmtHandle,
|
||||
&stConfigValues,
|
||||
&usConfigValuesStructSize,
|
||||
&stConfigMemory,
|
||||
&usConfigMemoryStructSize );
|
||||
|
||||
usConfigValuesStructSize = sizeof( ADS_MGMT_CONFIG_PARAMS );
|
||||
usConfigMemoryStructSize = sizeof( ADS_MGMT_CONFIG_MEMORY );
|
||||
/*
|
||||
if( sizeof( ADS_MGMT_CONFIG_PARAMS ) < usConfigValuesStructSize )
|
||||
{
|
||||
HB_TRACE(HB_TR_INFO, ("AdsMgGetConfigInfo() values structure on the server is larger.\n"
|
||||
"More info is available with newer client lib." ));
|
||||
}
|
||||
|
||||
ulRetVal = AdsMgGetConfigInfo( ads_g_hMgmtHandle, &stConfigValues,
|
||||
&usConfigValuesStructSize,
|
||||
&stConfigMemory, &usConfigMemoryStructSize );
|
||||
if( sizeof( ADS_MGMT_CONFIG_MEMORY ) < usConfigMemoryStructSize )
|
||||
{
|
||||
HB_TRACE(HB_TR_INFO, ("AdsMgGetConfigInfo() memory structure on the server is larger.\n"
|
||||
"More info is available with newer client lib." ));
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// if( sizeof( ADS_MGMT_CONFIG_PARAMS ) < usConfigValuesStructSize )
|
||||
// printf( "\nConfiguration Values structure on server is larger." );
|
||||
// if( sizeof( ADS_MGMT_CONFIG_MEMORY ) < usConfigMemoryStructSize )
|
||||
// printf( "\nConfiguration Memory structure on server is larger." );
|
||||
*/
|
||||
if( ulRetVal == AE_SUCCESS )
|
||||
{
|
||||
if( iOption == 0 )
|
||||
@@ -366,41 +359,33 @@ HB_FUNC( ADSMGGETCONFIGINFO )
|
||||
|
||||
HB_FUNC( ADSMGGETUSERNAMES ) /* Return array of connected users */
|
||||
{
|
||||
|
||||
UNSIGNED32 ulRetVal;
|
||||
UNSIGNED16 ulMaxUsers = 2000; /* needed for array memory allocation; caller can set with 2nd arg */
|
||||
UNSIGNED16 ulCount;
|
||||
UNSIGNED16 usStructSize = sizeof( ADS_MGMT_USER_INFO );
|
||||
ADS_MGMT_USER_INFO * pastUserInfo;
|
||||
|
||||
/*
|
||||
ADS_MGMT_USER_INFO astUserInfo[MAX_NUM_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 ) )
|
||||
{
|
||||
ulMaxUsers = (UNSIGNED16) hb_parnl( 2 );
|
||||
}
|
||||
|
||||
UNSIGNED32 ulRetVal;
|
||||
UNSIGNED16 ulMaxUsers = ISNUM( 2 ) ? (UNSIGNED16) hb_parnl( 2 ) : 2000; /* needed for array memory allocation; caller can set with 2nd arg */
|
||||
UNSIGNED16 ulCount;
|
||||
ADS_MGMT_USER_INFO * pastUserInfo;
|
||||
UNSIGNED16 usStructSize = sizeof( ADS_MGMT_USER_INFO );
|
||||
|
||||
pastUserInfo = (ADS_MGMT_USER_INFO *) hb_xgrab( sizeof( ADS_MGMT_USER_INFO ) * ulMaxUsers );
|
||||
/*
|
||||
AdsMgGetUserNames ( ADSHANDLE hMgmtConnect,
|
||||
UNSIGNED8 *pucFileName,
|
||||
ADS_MGMT_USER_INFO astUserInfo[],
|
||||
UNSIGNED16 *pusArrayLen,
|
||||
UNSIGNED16 *pusStructSize );
|
||||
*/
|
||||
ulRetVal = AdsMgGetUserNames( ads_g_hMgmtHandle, ISCHAR( 1 ) ? (UNSIGNED8 *) hb_parcx( 1 ) : NULL,
|
||||
|
||||
ulRetVal = AdsMgGetUserNames( ads_g_hMgmtHandle,
|
||||
(UNSIGNED8 *) hb_parc( 1 ) /* pucFileName */,
|
||||
pastUserInfo,
|
||||
&ulMaxUsers,
|
||||
&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( sizeof( ADS_MGMT_USER_INFO ) < usStructSize )
|
||||
{
|
||||
HB_TRACE(HB_TR_INFO, ("AdsMgGetUserNames() structure on the server is larger.\n"
|
||||
"More info is available with newer client lib." ));
|
||||
}
|
||||
*/
|
||||
|
||||
if( ulRetVal == AE_SUCCESS )
|
||||
{
|
||||
PHB_ITEM pArray = hb_itemArrayNew( ulMaxUsers ), pArrayItm;
|
||||
@@ -408,28 +393,32 @@ HB_FUNC( ADSMGGETUSERNAMES ) /* Return array of connected users */
|
||||
for( ulCount = 1; ulCount <= ulMaxUsers; ulCount++ )
|
||||
{
|
||||
pArrayItm = hb_arrayGetItemPtr( pArray, ulCount );
|
||||
#if ADS_LIB_VERSION >= 810
|
||||
hb_arrayNew( pArrayItm, 6 );
|
||||
#elif ADS_LIB_VERSION >= 800
|
||||
hb_arrayNew( pArrayItm, 5 );
|
||||
#else
|
||||
hb_arrayNew( pArrayItm, 3 );
|
||||
#endif
|
||||
|
||||
hb_itemPutC( hb_arrayGetItemPtr( pArrayItm, 1 ),
|
||||
( char * ) pastUserInfo[ulCount].aucUserName );
|
||||
hb_itemPutNL( hb_arrayGetItemPtr( pArrayItm, 2 ),
|
||||
pastUserInfo[ulCount].usConnNumber );
|
||||
#if ADS_LIB_VERSION >= 600
|
||||
hb_itemPutC( hb_arrayGetItemPtr( pArrayItm, 3 ),
|
||||
( char * ) pastUserInfo[ulCount].aucAddress );
|
||||
#else
|
||||
hb_itemPutC( hb_arrayGetItemPtr( pArrayItm, 3 ), NULL );
|
||||
#endif
|
||||
#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 );
|
||||
#else
|
||||
hb_itemPutC( hb_arrayGetItemPtr( pArrayItm, 4 ), NULL );
|
||||
hb_itemPutC( hb_arrayGetItemPtr( pArrayItm, 5 ), NULL );
|
||||
#endif
|
||||
#if ADS_LIB_VERSION >= 810
|
||||
hb_itemPutC( hb_arrayGetItemPtr( pArrayItm, 6 ),
|
||||
( char * ) pastUserInfo[ulCount].aucTSAddress );
|
||||
#else
|
||||
hb_itemPutC( hb_arrayGetItemPtr( pArrayItm, 6 ), NULL );
|
||||
#endif
|
||||
}
|
||||
hb_itemReturnRelease( pArray );
|
||||
@@ -440,19 +429,11 @@ HB_FUNC( ADSMGGETUSERNAMES ) /* Return array of connected users */
|
||||
}
|
||||
|
||||
hb_xfree( pastUserInfo );
|
||||
|
||||
}
|
||||
|
||||
HB_FUNC( ADSMGGETLOCKOWNER )
|
||||
{
|
||||
/*
|
||||
// UNSIGNED32 AdsMgGetLockOwner (ADSHANDLE hMgmtConnect,
|
||||
// UNSIGNED8 *pucTableName,
|
||||
// UNSIGNED32 ulRecordNumber,
|
||||
// ADS_MGMT_USER_INFO *pstUserInfo,
|
||||
// UNSIGNED16 *pusStructSize,
|
||||
// UNSIGNED16 *pusLockType);
|
||||
//
|
||||
// returns an array of 5 elements if successful
|
||||
// [1] Client machine name when server runs on NT/2000
|
||||
// Client Username when server runs on Netware
|
||||
@@ -465,25 +446,30 @@ HB_FUNC( ADSMGGETLOCKOWNER )
|
||||
//
|
||||
*/
|
||||
UNSIGNED32 ulRetVal;
|
||||
UNSIGNED16 usStructSize = sizeof( ADS_MGMT_USER_INFO );
|
||||
UNSIGNED16 pusLockType;
|
||||
ADS_MGMT_USER_INFO * pstUserInfo;
|
||||
UNSIGNED16 usStructSize = sizeof( ADS_MGMT_USER_INFO );
|
||||
pstUserInfo = (ADS_MGMT_USER_INFO *) hb_xgrab( sizeof( ADS_MGMT_USER_INFO ) );
|
||||
|
||||
ulRetVal = AdsMgGetLockOwner( ads_g_hMgmtHandle,
|
||||
(UNSIGNED8 *) hb_parcx( 1 ),
|
||||
(UNSIGNED32) hb_parnl(2),
|
||||
(UNSIGNED8 *) hb_parcx( 1 ) /* pucTableName */,
|
||||
(UNSIGNED32) hb_parnl( 2 ) /* ulRecordNumber */,
|
||||
pstUserInfo,
|
||||
&usStructSize,
|
||||
&pusLockType);
|
||||
if( ulRetVal== AE_SUCCESS )
|
||||
&pusLockType );
|
||||
if( ulRetVal == AE_SUCCESS )
|
||||
{
|
||||
hb_reta(5);
|
||||
hb_storc ( (char *) pstUserInfo->aucUserName , -1, 1); /* Machine name under NT */
|
||||
hb_stornl( (UNSIGNED16) pstUserInfo->usConnNumber, -1, 2); /* NetWare conn # (NLM only) */
|
||||
hb_storc ( (char *) pstUserInfo->aucAuthUserName, -1, 3); /* logon name with Data Dictionary */
|
||||
hb_storc ( (char *) pstUserInfo->aucAddress, -1, 4); /* IP adddress */
|
||||
hb_stornl( pusLockType, -1, 5); /* type of lock */
|
||||
hb_reta( 5 );
|
||||
hb_storc( ( char * ) pstUserInfo->aucUserName , -1, 1 ); /* Machine name under NT */
|
||||
hb_stornl( (UNSIGNED16) pstUserInfo->usConnNumber, -1, 2 ); /* NetWare conn # (NLM only) */
|
||||
#if ADS_LIB_VERSION >= 600
|
||||
hb_storc( ( char * ) pstUserInfo->aucAuthUserName, -1, 3 ); /* logon name with Data Dictionary */
|
||||
hb_storc( ( char * ) pstUserInfo->aucAddress, -1, 4 ); /* IP adddress */
|
||||
#else
|
||||
hb_storc( NULL, -1, 3 ); /* logon name with Data Dictionary */
|
||||
hb_storc( NULL, -1, 4 ); /* IP adddress */
|
||||
#endif
|
||||
hb_stornl( pusLockType, -1, 5 ); /* type of lock */
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -494,8 +480,8 @@ HB_FUNC( ADSMGGETLOCKOWNER )
|
||||
|
||||
HB_FUNC( ADSMGGETSERVERTYPE ) /* Determine OS ADS is running on; see ADS_MGMT_* constants */
|
||||
{
|
||||
UNSIGNED32 ulRetVal;
|
||||
UNSIGNED16 usServerType;
|
||||
UNSIGNED32 ulRetVal;
|
||||
UNSIGNED16 usServerType = 0;
|
||||
|
||||
ulRetVal = AdsMgGetServerType( ads_g_hMgmtHandle, &usServerType );
|
||||
if( ulRetVal == AE_SUCCESS )
|
||||
@@ -530,7 +516,7 @@ HB_FUNC( ADSMGGETOPENTABLES ) /* nMaxNumberOfFilesToReturn, cUserName,
|
||||
|
||||
if( !pucUserName || ( strlen( pucUserName ) == 0 ) )
|
||||
{
|
||||
pucUserName = NULL;
|
||||
pucUserName = NULL;
|
||||
}
|
||||
|
||||
if( ISNUM( 3 ) )
|
||||
@@ -588,12 +574,12 @@ HB_FUNC( ADSMGGETOPENINDEXES ) /* nMaxNumberOfFilesToReturn, cTableName, cU
|
||||
|
||||
if( !pucTableName || ( strlen( pucTableName ) == 0 ) )
|
||||
{
|
||||
pucTableName = NULL;
|
||||
pucTableName = NULL;
|
||||
}
|
||||
|
||||
if( !pucUserName || ( strlen( pucUserName ) == 0 ) )
|
||||
{
|
||||
pucUserName = NULL;
|
||||
pucUserName = NULL;
|
||||
}
|
||||
|
||||
if( ISNUM( 4 ) )
|
||||
@@ -646,20 +632,16 @@ HB_FUNC( ADSMGGETWORKERTHREADACTIVITY )
|
||||
AdsMgGetWorkerThreadActivity();
|
||||
}
|
||||
|
||||
HB_FUNC( ADSMGKILLUSER )
|
||||
{
|
||||
UNSIGNED32 ulRetVal = AE_SUCCESS;
|
||||
AdsMgKillUser();
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
HB_FUNC( ADSMGKILLUSER )
|
||||
{
|
||||
hb_retnl( (UNSIGNED16) AdsMgKillUser( ads_g_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) ads_g_hMgmtHandle );
|
||||
hb_retnl( ( LONG ) ads_g_hMgmtHandle );
|
||||
}
|
||||
|
||||
@@ -6,12 +6,9 @@ rem
|
||||
if not "%ADS_DIR%" == "" goto DIR_OK
|
||||
|
||||
echo ---------------------------------------------------------------
|
||||
echo IMPORTANT: You'll need Advantage Client Engine installed and
|
||||
echo these envvars set to successfully build this library:
|
||||
echo set ADS_VER=8
|
||||
echo IMPORTANT: You'll need Advantage Client Engine (5.0 or upper)
|
||||
echo and this envvar to be set to successfully build this library:
|
||||
echo set ADS_DIR=C:\ads\acesdk
|
||||
echo NOTE: The lowest tested version is ACE 6.x, it
|
||||
echo may also work with 5.x.
|
||||
echo ---------------------------------------------------------------
|
||||
goto POST_EXIT
|
||||
|
||||
@@ -19,7 +16,6 @@ goto POST_EXIT
|
||||
|
||||
set CFLAGS=-I%ADS_DIR%
|
||||
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
|
||||
if exist "%ADS_DIR%\%HB_DLL_NAME%.dll" set HB_DLL_DIR=%ADS_DIR%
|
||||
if exist "%ADS_DIR%\32bit\%HB_DLL_NAME%.dll" set HB_DLL_DIR=%ADS_DIR%\32bit
|
||||
|
||||
@@ -7,9 +7,10 @@
|
||||
if [ "${ADS_INC}" == "" ]
|
||||
then
|
||||
echo "---------------------------------------------------------------"
|
||||
echo "IMPORTANT: You will need Advantage package installed and this"
|
||||
echo " envvar to be set to successfully build this library:"
|
||||
echo " export ADS_INC=C:/Ads/acesdk"
|
||||
echo "IMPORTANT: You will need Advantage Client Engine (5.0 or upper)"
|
||||
echo " installed and this envvar to be set to successfully"
|
||||
echo " build this library:"
|
||||
echo " export ADS_INC=C:/ads/acesdk"
|
||||
echo " or"
|
||||
echo " export ADS_INC=/usr/include/ads"
|
||||
echo "---------------------------------------------------------------"
|
||||
|
||||
@@ -6,12 +6,9 @@ rem
|
||||
if not "%ADS_DIR%" == "" goto DIR_OK
|
||||
|
||||
echo ---------------------------------------------------------------
|
||||
echo IMPORTANT: You'll need Advantage Client Engine installed and
|
||||
echo these envvars set to successfully build this library:
|
||||
echo set ADS_VER=8
|
||||
echo IMPORTANT: You'll need Advantage Client Engine (5.0 or upper)
|
||||
echo and this envvar to be set to successfully build this library:
|
||||
echo set ADS_DIR=C:\ads\acesdk
|
||||
echo NOTE: The lowest tested version is ACE 6.x, it
|
||||
echo may also work with 5.x.
|
||||
echo ---------------------------------------------------------------
|
||||
goto POST_EXIT
|
||||
|
||||
@@ -19,7 +16,6 @@ goto POST_EXIT
|
||||
|
||||
set CFLAGS=-I%ADS_DIR%
|
||||
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
|
||||
if exist "%ADS_DIR%\%HB_DLL_NAME%.dll" set HB_DLL_DIR=%ADS_DIR%
|
||||
if exist "%ADS_DIR%\32bit\%HB_DLL_NAME%.dll" set HB_DLL_DIR=%ADS_DIR%\32bit
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
*/
|
||||
|
||||
#include "hbapirdd.h"
|
||||
|
||||
#if defined( HB_OS_WIN_32 ) && !defined( WIN32 )
|
||||
#define WIN32
|
||||
#endif
|
||||
@@ -111,7 +112,8 @@
|
||||
|
||||
HB_EXTERN_BEGIN
|
||||
|
||||
|
||||
/* Function is not documented, but exists in ace32.dll version 6.x, 7.x */
|
||||
UNSIGNED32 ENTRYPOINT AdsDeleteFile( ADSHANDLE hConnection, UNSIGNED8* pucFileName );
|
||||
|
||||
/*
|
||||
* ADS WORKAREA
|
||||
@@ -233,5 +235,4 @@ extern ADSAREAP hb_rddGetADSWorkAreaPointer( void );
|
||||
# define hb_adsOemAnsiFree( s )
|
||||
#endif
|
||||
|
||||
|
||||
HB_EXTERN_END
|
||||
|
||||
@@ -61,8 +61,10 @@
|
||||
#xtranslate hb_gtInfo([<x,...>]) => gtInfo(<x>)
|
||||
#xtranslate hb_gtVersion([<x>]) => hb_gt_Version(<x>)
|
||||
|
||||
#xtranslate hb_ScrMaxRow() => MaxRow(.T.)
|
||||
#xtranslate hb_ScrMaxCol() => MaxCol(.T.)
|
||||
#xtranslate hb_ScrMaxRow() => hb_gtInfo( HB_GTI_SCREENHEIGHT )
|
||||
#xtranslate hb_ScrMaxCol() => hb_gtInfo( HB_GTI_SCREENWIDTH )
|
||||
#xtranslate MaxRow(.T.) => hb_gtInfo( HB_GTI_SCREENHEIGHT )
|
||||
#xtranslate MaxCol(.T.) => hb_gtInfo( HB_GTI_SCREENWIDTH )
|
||||
|
||||
#xtranslate hb_isregex([<x>]) => hb_isregexstring(<x>)
|
||||
#xtranslate hb_pvalue([<x,...>]) => pvalue(<x>)
|
||||
@@ -124,8 +126,8 @@
|
||||
#xtranslate gtProcessMessages() => NextKey()
|
||||
#xtranslate gfxPrimitive([<x,...>]) => hb_gfxPrimitive(<x>)
|
||||
#xtranslate gfxText([<x,...>]) => hb_gfxText(<x>)
|
||||
#xtranslate MaxRow(.T.) => hb_ScrMaxRow()
|
||||
#xtranslate MaxCol(.T.) => hb_ScrMaxCol()
|
||||
#xtranslate MaxRow(.T.) => hb_gtInfo( HB_GTI_VIEWPORTHEIGHT )
|
||||
#xtranslate MaxCol(.T.) => hb_gtInfo( HB_GTI_VIEWPORTWIDTH )
|
||||
|
||||
#xtranslate hb_isregexstring([<x>]) => hb_isregex(<x>)
|
||||
#xtranslate pvalue([<x,...>]) => hb_pvalue(<x>)
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
#define HB_GTI_ISGRAPHIC 0 /* 1 if GT has graphic support / pixel oriented */
|
||||
#define HB_GTI_SCREENWIDTH 1 /* Get/set width of application window in pixels */
|
||||
#define HB_GTI_SCREENHEIGHT 2 /* Get/set height of appl. window in pixels */
|
||||
#define HB_GTI_SCREENHEIGHT 2 /* Get/set height of application window in pixels */
|
||||
#define HB_GTI_SCREENDEPTH 3 /* Amount of bits used for colors in the application */
|
||||
#define HB_GTI_FONTSIZE 4 /* Get/set height of application font in pixels */
|
||||
#define HB_GTI_FONTWIDTH 5 /* Get/set width of application font characters */
|
||||
|
||||
@@ -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_compOutErr( HB_COMP_PARAM, buffer );
|
||||
hb_compOutStd( 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_compOutErr( HB_COMP_PARAM, buffer );
|
||||
hb_compOutStd( 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_compOutErr( HB_COMP_PARAM, "\nNo code generated.\n" );
|
||||
hb_compOutStd( 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_compOutErr( HB_COMP_PARAM, buffer );
|
||||
hb_compOutStd( HB_COMP_PARAM, buffer );
|
||||
}
|
||||
|
||||
hb_compGenOutput( HB_COMP_PARAM, HB_COMP_PARAM->iLanguage );
|
||||
|
||||
@@ -53,12 +53,54 @@
|
||||
#include "hbapi.h"
|
||||
#include "hbapigt.h"
|
||||
|
||||
HB_FUNC( MAXROW ) /* Return the maximum screen/"viewport" row number (zero origin) */
|
||||
/* NOTE: This is a hack to emulate the overloaded MaxRow()/MaxCol()
|
||||
functions provided by CT3 library for CA-Cl*pper.
|
||||
Application code is encouraged to rather use the
|
||||
hbct_MaxRow(.T.)/hbct_MaxCol(.T.) functions provided by
|
||||
Harbour CT library, or hb_ScrMaxRow()/hb_ScrMaxCol()
|
||||
provided by Harbour RTL, since this extension may
|
||||
collide in the future with extensions of other overloaded
|
||||
versions (like the one of FlagShip), and it's currently
|
||||
(2008 May) the only known non-standard extension slipped
|
||||
into Harbour core. [vszakats] */
|
||||
#define HB_COMPAT_CT3
|
||||
|
||||
HB_FUNC( MAXROW ) /* Return the maximum screen/window row number (zero origin) */
|
||||
{
|
||||
hb_retni( hb_gtMaxRow() );
|
||||
#ifdef HB_COMPAT_CT3
|
||||
/*
|
||||
* 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
|
||||
#endif
|
||||
hb_retni( hb_gtMaxRow() );
|
||||
}
|
||||
|
||||
HB_FUNC( MAXCOL ) /* Return the maximum screen/"viewport" column number (zero origin) */
|
||||
HB_FUNC( MAXCOL ) /* Return the maximum screen/window column number (zero origin) */
|
||||
{
|
||||
hb_retni( hb_gtMaxCol() );
|
||||
#ifdef HB_COMPAT_CT3
|
||||
/* See notes about MaxRow(.T.) above */
|
||||
if( ISLOG( 1 ) && hb_parl( 1 ) )
|
||||
{
|
||||
USHORT uiRows, uiCols;
|
||||
hb_gtScrDim( &uiRows, &uiCols );
|
||||
hb_retni( uiCols - 1 );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
hb_retni( hb_gtMaxCol() );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user