From 640875d2347b62d950003f3ccf2d1950bb109b4e Mon Sep 17 00:00:00 2001 From: "Alexander S.Kresin" Date: Wed, 9 Feb 2000 10:39:36 +0000 Subject: [PATCH] ADS RDD files updating --- harbour/ChangeLog | 9 +++++++++ harbour/contrib/rdd_ads/ads.ch | 8 +++++++- harbour/contrib/rdd_ads/ads1.c | 17 ++++++++--------- harbour/contrib/rdd_ads/adsfunc.c | 6 ++++++ 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b5ce956d2d..f88a7c07be 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,12 @@ +20000209-13:35 GMT+3 Alexander Kresin + * contrib/rdd_ads/adsfunc.c + + added new function: + HB_ADSETDELETED() + * contrib/rdd_ads/ads1.c + * some changes for deleted(), locate, continue right work + * contrib/rdd_ads/ads.ch + + added SET DELETED command + 20000209-08:15 GMT-3 Luiz Rafael Culik *utils/hbdoc/hbdoc.prg *Fixed /w1 warnign when hbdoc is compiled with this switch diff --git a/harbour/contrib/rdd_ads/ads.ch b/harbour/contrib/rdd_ads/ads.ch index f63c21cea5..789bac7548 100644 --- a/harbour/contrib/rdd_ads/ads.ch +++ b/harbour/contrib/rdd_ads/ads.ch @@ -54,4 +54,10 @@ #command SET DEFAULT TO <(path)> ; => Set( _SET_DEFAULT, <(path)> ); AdsSetDefault( <(path)> ) #command SET DEFAULT TO ; - => Set( _SET_DEFAULT, "" ); AdsSetDefault( "" ) \ No newline at end of file + => Set( _SET_DEFAULT, "" ); AdsSetDefault( "" ) + +#command SET DELETED ; + => Set( _SET_DELETED, <(x)> ) ; + ;AdsSetDeleted( if( upper( <(x)> ) == "ON", .t., .f. ) ) +#command SET DELETED () ; + => Set( _SET_DELETED, ); AdsSetDeleted( ) \ No newline at end of file diff --git a/harbour/contrib/rdd_ads/ads1.c b/harbour/contrib/rdd_ads/ads1.c index ea4a12349a..2ce7297119 100644 --- a/harbour/contrib/rdd_ads/ads1.c +++ b/harbour/contrib/rdd_ads/ads1.c @@ -207,14 +207,7 @@ static ERRCODE adsEof( ADSAREAP pArea, BOOL * pEof ) return SUCCESS; } -static ERRCODE adsFound( ADSAREAP pArea, BOOL * pFound ) -{ - HB_TRACE(HB_TR_DEBUG, ("adsFound(%p, %p)", pArea, pFound)); - - AdsIsFound( pArea->hTable, (UNSIGNED16 *)&(pArea->fFound) ); - * pFound = pArea->fFound; - return SUCCESS; -} +#define adsFound NULL static ERRCODE adsGoBottom( ADSAREAP pArea ) { @@ -289,6 +282,7 @@ static ERRCODE adsSeek( ADSAREAP pArea, BOOL bSoftSeek, PHB_ITEM pKey, BOOL bFin (UNSIGNED16) pKey->item.asString.length, ADS_STRINGKEY, usSeekType, (UNSIGNED16*) &(pArea->fFound) ); } + AdsIsFound( pArea->hTable, (UNSIGNED16 *)&(pArea->fFound) ); return SUCCESS; } @@ -340,9 +334,14 @@ static ERRCODE adsDeleteRec( ADSAREAP pArea ) static ERRCODE adsDeleted( ADSAREAP pArea, BOOL * pDeleted ) { + UNSIGNED16 bDeleted; + + HB_TRACE(HB_TR_DEBUG, ("adsDeleted(%p, %p)", pArea, pDeleted)); - AdsIsRecordDeleted ( pArea->hTable, (UNSIGNED16*) pDeleted); + AdsIsRecordDeleted ( pArea->hTable, &bDeleted); + *pDeleted = (BOOL) bDeleted; + return SUCCESS; } diff --git a/harbour/contrib/rdd_ads/adsfunc.c b/harbour/contrib/rdd_ads/adsfunc.c index 4ac15e67f8..b36543572c 100644 --- a/harbour/contrib/rdd_ads/adsfunc.c +++ b/harbour/contrib/rdd_ads/adsfunc.c @@ -114,6 +114,12 @@ HARBOUR HB_ADSSETDEFAULT( void ) AdsSetDefault ( (UNSIGNED8*) hb_parc( 1 ) ); } +HARBOUR HB_ADSSETDELETED( void ) +{ + UNSIGNED16 usShowDeleted = hb_parl( 1 ); + AdsShowDeleted( usShowDeleted ); +} + HARBOUR HB_ADSBLOB2FILE( void ) { char * szFileName, *szFieldName;