From 36a75f86b249ecd0df600a04748211c1463fcae6 Mon Sep 17 00:00:00 2001 From: "Alexander S.Kresin" Date: Mon, 20 Oct 2003 07:37:45 +0000 Subject: [PATCH] 2003-10-20 11:37 UTC+0300 Alexander Kresin --- harbour/ChangeLog | 6 ++++++ harbour/include/hbapi.h | 1 + harbour/source/rdd/dbfntx/dbfntx1.c | 12 ++++++------ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8e1655324b..a8cf64b36c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,12 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2003-10-20 11:37 UTC+0300 Alexander Kresin + * include/hbapi.h + * The declaration of hb_objSendMsg() added. + * source/rdd/dbfntx/dbfntx1.c + ! bug fixed in soft seeking. + 2003-10-17 18:08 UTC+0100 Ryszard Glab * include/hbapi.h diff --git a/harbour/include/hbapi.h b/harbour/include/hbapi.h index 44e0dfbcac..d1cd338d69 100644 --- a/harbour/include/hbapi.h +++ b/harbour/include/hbapi.h @@ -447,6 +447,7 @@ extern char * hb_objGetClsName( PHB_ITEM pObject ); /* retrieves an object cla extern char * hb_objGetRealClsName( PHB_ITEM pObject, char * szString ); /* retrieves an object class name for a specific message */ extern PHB_FUNC hb_objGetMethod( PHB_ITEM pObject, PHB_SYMB pSymMsg ); /* returns the method pointer of a object class */ extern ULONG hb_objHasMsg( PHB_ITEM pObject, char * szString ); /* returns TRUE/FALSE whether szString is an existing message for object */ +extern void hb_objSendMsg( PHB_ITEM pObj, char *sMsg, ULONG ulArg, ... ); /* dynamic symbol table management */ extern PHB_DYNS hb_dynsymGet( char * szName ); /* finds and creates a dynamic symbol if not found */ diff --git a/harbour/source/rdd/dbfntx/dbfntx1.c b/harbour/source/rdd/dbfntx/dbfntx1.c index 41c41d4224..028fac1a24 100644 --- a/harbour/source/rdd/dbfntx/dbfntx1.c +++ b/harbour/source/rdd/dbfntx/dbfntx1.c @@ -162,7 +162,7 @@ static RDDFUNCS ntxSuper = { 0 }; /* Internal functions */ static LPKEYINFO hb_ntxKeyNew( LPKEYINFO pKeyFrom, int keylen ); -static LONG hb_ntxTagKeyFind( LPTAGINFO pTag, LPKEYINFO pKey, int keylen, BOOL* result ); +static LONG hb_ntxTagKeyFind( LPTAGINFO pTag, LPKEYINFO pKey, int keylen, BOOL* result, BOOL bSoftSeek ); static BOOL hb_ntxIsRecBad( NTXAREAP pArea, LONG ulRecNo ); static int hb_ntxTagFindCurrentKey( LPTAGINFO pTag, LPPAGEINFO pPage, LPKEYINFO pKey, int keylen, BOOL bExact, BOOL lSeek ); static USHORT hb_ntxPageFindCurrentKey( LPPAGEINFO pPage, ULONG ulRecno ); @@ -632,13 +632,13 @@ static LPKEYINFO hb_ntxKeyNew( LPKEYINFO pKeyFrom, int keylen ) return pKey; } -static LONG hb_ntxTagKeyFind( LPTAGINFO pTag, LPKEYINFO pKey, int keylen, BOOL * result ) +static LONG hb_ntxTagKeyFind( LPTAGINFO pTag, LPKEYINFO pKey, int keylen, BOOL * result, BOOL bSoftSeek ) { int K; pTag->CurKeyInfo->Tag = pTag->CurKeyInfo->Xtra = 0; pTag->TagBOF = pTag->TagEOF = *result = FALSE; - K = hb_ntxTagFindCurrentKey( pTag, hb_ntxPageLoad( pTag,0 ), pKey, keylen, FALSE, TRUE ); + K = hb_ntxTagFindCurrentKey( pTag, hb_ntxPageLoad( pTag,0 ), pKey, keylen, FALSE, (bSoftSeek)? 2:1 ); if( K == 0 ) { *result = TRUE; @@ -723,7 +723,7 @@ static int hb_ntxTagFindCurrentKey( LPTAGINFO pTag, LPPAGEINFO pPage, LPKEYINFO { kChild = hb_ntxTagFindCurrentKey( pTag, hb_ntxPageLoad( pTag,p->page ), pKey, keylen, bExact, lSeek ); - if( kChild == 0 ) + if( kChild == 0 || ( lSeek==2 && kChild < 0 ) ) k = kChild; if( k <= 0 ) @@ -3111,14 +3111,14 @@ static ERRCODE ntxSeek( NTXAREAP pArea, BOOL bSoftSeek, PHB_ITEM pKey, BOOL bFin while( !hb_fsLock( pArea->lpCurTag->Owner->DiskFile, NTX_LOCK_OFFSET, 1, FL_LOCK ) ); pArea->lpCurTag->Owner->Locked = TRUE; } - lRecno = hb_ntxTagKeyFind( pTag, pKey2, keylen, &result ); + lRecno = hb_ntxTagKeyFind( pTag, pKey2, keylen, &result, bSoftSeek ); if( bFindLast && lRecno > 0 && result ) { LONG lRecnoLast; pArea->fEof = pArea->fBof = FALSE; hb_IncString( pArea, pKey2->key, keylen ); - lRecnoLast = hb_ntxTagKeyFind( pTag, pKey2, keylen, &result ); + lRecnoLast = hb_ntxTagKeyFind( pTag, pKey2, keylen, &result, 0 ); hb_ntxKeyFree( pKey2 ); if( lRecnoLast > 0 ) {