2006-09-29 21:05 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/rdd_ads/ads1.c
* harbour/contrib/rdd_ads/adsfunc.c
* synced with Brian fixes in xHarbour
* harbour/source/rdd/workarea.c
* minor modification
* harbour/source/rdd/dbfcdx/dbfcdx1.c
* minor Clipper compatibility update
This commit is contained in:
@@ -8,6 +8,17 @@
|
||||
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
you will notice some problems with current rules please inform me.
|
||||
|
||||
2006-09-29 22:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/source/vm/classes.c
|
||||
* allow to access object variables using assign messages without
|
||||
parameter. I do not want to add symmetric behavior for access messages
|
||||
though it's technically possible but such things should be controlled
|
||||
by programmer because access messages can have less restricted scoping
|
||||
then assign ones (READONLY) so I'll add new rule for it in hbclass.ch
|
||||
|
||||
* harbour/source/vm/hvm.c
|
||||
* fixed warning message when object variable reference is
|
||||
generated using macro compiler without '_' as prefix.
|
||||
|
||||
|
||||
@@ -2508,7 +2508,7 @@ static ERRCODE adsCreate( ADSAREAP pArea, LPDBOPENINFO pCreateInfo )
|
||||
|
||||
if( uiFldLen == 0 )
|
||||
{
|
||||
uiFldLen = strlen( ( char * ) ucBuffer ); // should have been set by sprintf above.
|
||||
uiFldLen = strlen( (const char *) ucBuffer ); // should have been set by sprintf above.
|
||||
}
|
||||
if( uiFldLen >= uiLen )
|
||||
{
|
||||
@@ -2550,7 +2550,7 @@ static ERRCODE adsCreate( ADSAREAP pArea, LPDBOPENINFO pCreateInfo )
|
||||
}
|
||||
|
||||
AdsGetRecordLength( pArea->hTable, &u32Length );
|
||||
pArea->uiRecordLen = u32Length;
|
||||
pArea->uiRecordLen = (USHORT) u32Length;
|
||||
/* Alloc record buffer - because it's also used for some extended types
|
||||
conversion it has to be at least 25 bytes size */
|
||||
pArea->pRecord = ( BYTE * ) hb_xgrab( HB_MAX( pArea->uiRecordLen, 25 ) );
|
||||
@@ -2938,7 +2938,7 @@ static ERRCODE adsOpen( ADSAREAP pArea, LPDBOPENINFO pOpenInfo )
|
||||
pArea->maxFieldLen = 24;
|
||||
}
|
||||
AdsGetRecordLength( pArea->hTable, &u32Length );
|
||||
pArea->uiRecordLen = u32Length;
|
||||
pArea->uiRecordLen = (USHORT) u32Length;
|
||||
/* Alloc record buffer - because it's also used for some extended types
|
||||
conversion it has to be at least 25 bytes size */
|
||||
pArea->pRecord = ( BYTE * ) hb_xgrab( HB_MAX( pArea->uiRecordLen, 25 ) );
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
|
||||
#define HARBOUR_MAX_RDD_FILTER_LENGTH 256
|
||||
#define MAX_STR_LEN 255
|
||||
#define ADS_MAX_PARAMDEF_LEN 2048
|
||||
|
||||
int adsFileType = ADS_CDX;
|
||||
int adsLockType = ADS_PROPRIETARY_LOCKING;
|
||||
@@ -2073,15 +2074,8 @@ HB_FUNC( ADSCONNECT60 )
|
||||
{
|
||||
// determine if is a DataDict
|
||||
UNSIGNED16 usType;
|
||||
BOOL fDictionary = FALSE;
|
||||
PHB_ITEM piByRefHandle = hb_param( 6, HB_IT_BYREF );
|
||||
|
||||
ulRetVal = AdsGetHandleType( hConnect, &usType);
|
||||
if( ulRetVal == AE_SUCCESS )
|
||||
{
|
||||
fDictionary = ( usType == ADS_DATABASE_CONNECTION
|
||||
|| usType == ADS_SYS_ADMIN_CONNECTION );
|
||||
}
|
||||
adsConnectHandle = hConnect; // set new default
|
||||
|
||||
if ( piByRefHandle )
|
||||
@@ -2101,7 +2095,7 @@ HB_FUNC( ADSDDCREATE )
|
||||
{
|
||||
UNSIGNED32 ulRetVal;
|
||||
UNSIGNED8 *pucDictionaryPath = (UNSIGNED8 *) hb_parcx( 1 );
|
||||
UNSIGNED16 usEncrypt = (UNSIGNED16) ISNUM( 2 ) ? hb_parnl( 0 ) : 0;
|
||||
UNSIGNED16 usEncrypt = (UNSIGNED16) ISNUM( 2 ) ? hb_parnl( 2 ) : (ISLOG( 2 ) ? hb_parl( 2 ) : 0 ) ;
|
||||
UNSIGNED8 *pucDescription = ISCHAR( 3 ) ? (UNSIGNED8 *) hb_parcx( 3 ) : NULL;
|
||||
ADSHANDLE hConnect = 0;
|
||||
|
||||
@@ -2139,11 +2133,11 @@ HB_FUNC( ADSDDCREATEUSER )
|
||||
|
||||
HB_FUNC( ADSDDGETDATABASEPROPERTY )
|
||||
{
|
||||
#define ADS_MAX_PARAMDEF_LEN 2048
|
||||
UNSIGNED16 ulProperty = ( UNSIGNED16 ) hb_parni( 1 );
|
||||
char sBuffer[ ADS_MAX_PARAMDEF_LEN ];
|
||||
UNSIGNED16 ulLength;
|
||||
UNSIGNED16 ulBuffer;
|
||||
UNSIGNED32 ulRetVal;
|
||||
BOOL bChar = FALSE;
|
||||
ADSHANDLE hConnect = HB_ADS_PARCONNECTION( 2 );
|
||||
|
||||
@@ -2153,11 +2147,20 @@ HB_FUNC( ADSDDGETDATABASEPROPERTY )
|
||||
case ADS_DD_DEFAULT_TABLE_PATH:
|
||||
case ADS_DD_USER_DEFINED_PROP:
|
||||
case ADS_DD_TEMP_TABLE_PATH:
|
||||
/*case ADS_DD_ADMIN_PASSWORD: not valid to retrieve */
|
||||
case ADS_DD_VERSION:
|
||||
{
|
||||
ulLength = ADS_MAX_PARAMDEF_LEN ;
|
||||
AdsDDGetDatabaseProperty( hConnect, ulProperty, &sBuffer, &ulLength );
|
||||
bChar = TRUE ;
|
||||
ulRetVal = AdsDDGetDatabaseProperty( hConnect, ulProperty, &sBuffer, &ulLength );
|
||||
if( ulRetVal != AE_SUCCESS )
|
||||
{
|
||||
sBuffer[0] = 0;
|
||||
ulLength = 0; /* Current structure of this func doesn't give a good way to handle errors */
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ADS_DD_LOG_IN_REQUIRED:
|
||||
@@ -2195,7 +2198,7 @@ HB_FUNC( ADSDDSETDATABASEPROPERTY )
|
||||
UNSIGNED16 ulBuffer;
|
||||
UNSIGNED16 ulProperty = ( UNSIGNED16 ) hb_parni( 1 );
|
||||
PHB_ITEM pParam = hb_param( 2, HB_IT_ANY ) ;
|
||||
ADSHANDLE hConnect = HB_ADS_PARCONNECTION( 2 );
|
||||
ADSHANDLE hConnect = HB_ADS_PARCONNECTION( 3 );
|
||||
|
||||
switch( ulProperty )
|
||||
{
|
||||
@@ -2206,7 +2209,7 @@ HB_FUNC( ADSDDSETDATABASEPROPERTY )
|
||||
case ADS_DD_ADMIN_PASSWORD:
|
||||
case ADS_DD_ENCRYPT_TABLE_PASSWORD:
|
||||
{
|
||||
ulRetVal = AdsDDSetDatabaseProperty( hConnect, ulProperty, hb_itemGetCPtr( pParam ), ( UNSIGNED16 ) hb_itemGetCLen( pParam ) );
|
||||
ulRetVal = AdsDDSetDatabaseProperty( hConnect, ulProperty, hb_itemGetCPtr( pParam ), ( UNSIGNED16 ) hb_itemGetCLen( pParam )+1 );
|
||||
break;
|
||||
}
|
||||
case ADS_DD_MAX_FAILED_ATTEMPTS:
|
||||
@@ -2245,17 +2248,36 @@ UNSIGNED32 ENTRYPOINT AdsDDGetUserProperty( ADSHANDLE hObject,
|
||||
*/
|
||||
HB_FUNC( ADSDDGETUSERPROPERTY )
|
||||
{
|
||||
|
||||
UNSIGNED32 ulRetVal;
|
||||
UNSIGNED8 *pucUserName = (UNSIGNED8 *) hb_parcx( 1 );
|
||||
UNSIGNED16 usPropertyID = hb_parni( 2 );
|
||||
UNSIGNED8 *pvProperty = (UNSIGNED8 *) hb_parcx( 3 );
|
||||
UNSIGNED16 usPropertyLen = hb_parni( 4 );
|
||||
ADSHANDLE hConnect = HB_ADS_PARCONNECTION( 5 );
|
||||
UNSIGNED8 *pucUserName = (UNSIGNED8 *) hb_parcx( 1 );
|
||||
UNSIGNED16 usPropertyID = hb_parni( 2 );
|
||||
PHB_ITEM pPropertyByRef = hb_param( 3 , HB_IT_BYREF );
|
||||
ADSHANDLE hConnect = HB_ADS_PARCONNECTION( 4 );
|
||||
UNSIGNED16 usPropertyLen = ADS_MAX_PARAMDEF_LEN ;
|
||||
UNSIGNED8 pvProperty[ ADS_MAX_PARAMDEF_LEN ] = { 0 };
|
||||
|
||||
if (! pPropertyByRef )
|
||||
{
|
||||
hb_errRT_DBCMD( EG_ARG, 1014, NULL, "ADSDDGETUSERPROPERTY" );
|
||||
return;
|
||||
}
|
||||
|
||||
ulRetVal = AdsDDGetUserProperty( hConnect, pucUserName, usPropertyID,
|
||||
pvProperty, &usPropertyLen );
|
||||
|
||||
if (ulRetVal == AE_SUCCESS )
|
||||
{
|
||||
hb_storc(pvProperty, 3 );
|
||||
}
|
||||
else
|
||||
{
|
||||
hb_storc( "", 3 );
|
||||
}
|
||||
hb_retl( ulRetVal == AE_SUCCESS );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Verify if a username/password combination is valid for this database
|
||||
Call : ADSTESTLOGIN(serverpath,servertypes,username,password,options,
|
||||
|
||||
@@ -5789,8 +5789,9 @@ static LONG hb_cdxDBOIKeyNo( CDXAREAP pArea, LPCDXTAG pTag, BOOL fFilters )
|
||||
if ( hb_cdxBottomScope( pTag ) && hb_cdxTopScope( pTag ) &&
|
||||
( !fCheckFilter || hb_cdxCheckRecordFilter( pArea, ulRecNo ) ) )
|
||||
{
|
||||
|
||||
LPCDXKEY pCurKey = hb_cdxKeyCopy( NULL, pTag->CurKey );
|
||||
if ( !hb_cdxCheckRecordScope( pArea, pTag->CurKey->rec ) )
|
||||
hb_cdxTagSkipPrev( pTag );
|
||||
while ( !pTag->TagBOF )
|
||||
{
|
||||
if ( !fCheckFilter || hb_cdxCheckRecordFilter( pArea, pTag->CurKey->rec ) )
|
||||
|
||||
@@ -125,7 +125,7 @@ ERRCODE hb_waSkip( AREAP pArea, LONG lToSkip )
|
||||
lSkip = -1;
|
||||
lToSkip *= -1;
|
||||
}
|
||||
while( lToSkip-- > 0 )
|
||||
while( --lToSkip >= 0 )
|
||||
{
|
||||
if( SELF_SKIPRAW( pArea, lSkip ) != SUCCESS )
|
||||
return FAILURE;
|
||||
|
||||
Reference in New Issue
Block a user