2010-02-20 11:50 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* include/hbextern.ch
  * src/rtl/browdb.prg
  * src/rdd/dbcmd.c
  * contrib/xpp/dbcmdx.c
  * contrib/xpp/browdbx.prg
    + Cleaned the way TBrowseDB() "skipper" function is defined.
      This means that from now on by default the faster, .c
      implementation will be used (now called __DBSKIPPER()).
      The same will be used by xpp lib (via compatibility stub
      called DBSKIPPER()). The .prg implementation (now moved
      in core) will be used when HB_CLP_STRICT is enabled.

  * include/hbextern.ch
    + Added missing HB_DYNCALL().

  * contrib/xpp/xpp.ch
    * Do not #define HB_COMPAT_XPP.
This commit is contained in:
Viktor Szakats
2010-02-20 10:51:51 +00:00
parent 7733350767
commit f70ea27f20
7 changed files with 99 additions and 99 deletions

View File

@@ -17,6 +17,25 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-02-20 11:50 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* include/hbextern.ch
* src/rtl/browdb.prg
* src/rdd/dbcmd.c
* contrib/xpp/dbcmdx.c
* contrib/xpp/browdbx.prg
+ Cleaned the way TBrowseDB() "skipper" function is defined.
This means that from now on by default the faster, .c
implementation will be used (now called __DBSKIPPER()).
The same will be used by xpp lib (via compatibility stub
called DBSKIPPER()). The .prg implementation (now moved
in core) will be used when HB_CLP_STRICT is enabled.
* include/hbextern.ch
+ Added missing HB_DYNCALL().
* contrib/xpp/xpp.ch
* Do not #define HB_COMPAT_XPP.
2010-02-20 05:12 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
+ contrib/hbziparc/doc
+ contrib/hbziparc/doc/en-EN

View File

@@ -64,36 +64,3 @@ FUNCTION xpp_TBrowseDB( nTop, nLeft, nBottom, nRight )
oBrowse:GoBottomBlock := { || dbGoBottom() }
RETURN oBrowse
#ifdef HB_PRG_DBSKIPPER
FUNCTION dbSkipper( nRecs )
LOCAL nSkipped := 0
IF LastRec() != 0
IF nRecs == 0
dbSkip( 0 )
ELSEIF nRecs > 0 .AND. RecNo() != LastRec() + 1
DO WHILE nSkipped < nRecs
dbSkip( 1 )
IF Eof()
dbSkip( -1 )
EXIT
ENDIF
nSkipped++
ENDDO
ELSEIF nRecs < 0
DO WHILE nSkipped > nRecs
dbSkip( -1 )
IF Bof()
EXIT
ENDIF
nSkipped--
ENDDO
ENDIF
ENDIF
RETURN nSkipped
#endif

View File

@@ -70,6 +70,13 @@ HB_FUNC( DBZAP )
HB_FUNC_EXEC( HB_DBZAP );
}
HB_FUNC_EXTERN( __DBSKIPPER );
HB_FUNC( DBSKIPPER )
{
HB_FUNC_EXEC( __DBSKIPPER );
}
HB_FUNC( ORDWILDSEEK )
{
AREAP pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer();
@@ -122,60 +129,3 @@ HB_FUNC( ORDWILDSEEK )
else
hb_errRT_DBCMD( EG_NOTABLE, EDBCMD_NOTABLE, NULL, HB_ERR_FUNCNAME );
}
HB_FUNC( DBSKIPPER )
{
AREAP pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer();
if( pArea )
{
HB_LONG lSkipped = 0;
HB_LONG lRecs = 1;
HB_BOOL fBEof;
HB_ULONG ulRecords = 0;
if( SELF_RECCOUNT( pArea, &ulRecords ) == HB_SUCCESS && ulRecords > 0 )
{
if( HB_ISNUM( 1 ) )
lRecs = hb_parnl( 1 );
if( lRecs == 0 )
SELF_SKIP( pArea, 0 );
else if( lRecs > 0 )
{
if( SELF_EOF( pArea, &fBEof ) == HB_SUCCESS )
{
while( lSkipped < lRecs )
{
if( SELF_SKIP( pArea, 1 ) != HB_SUCCESS )
break;
if( SELF_EOF( pArea, &fBEof ) != HB_SUCCESS )
break;
if( fBEof )
{
SELF_SKIP( pArea, -1 );
break;
}
lSkipped++;
}
}
}
else /* if( lRecs < 0 ) */
{
while( lSkipped > lRecs )
{
if( SELF_SKIP( pArea, -1 ) != HB_SUCCESS )
break;
if( SELF_BOF( pArea, &fBEof ) != HB_SUCCESS )
break;
if( fBEof )
break;
lSkipped--;
}
}
}
hb_retnl( lSkipped );
}
else
hb_errRT_DBCMD( EG_NOTABLE, EDBCMD_NOTABLE, NULL, HB_ERR_FUNCNAME );
}

View File

@@ -59,10 +59,6 @@
#else
#ifdef __HARBOUR__
#ifndef HB_COMPAT_XPP
#define HB_COMPAT_XPP
#endif
/* Translations for Xbase++ programs compiled with Harbour compiler */
#include "hbclass.ch"
@@ -75,6 +71,9 @@
#xtranslate TBrowse() => xpp_TBrowse()
#xtranslate Get() => xpp_Get()
/* NOTE: Several other Xbase++ functions are currently implemented using
original Xbase++ names. */
/* box.ch extensions */
#define B_THIN ( Chr( 219 ) + Chr( 223 ) + Chr( 219 ) + Chr( 219 ) + ;
@@ -83,8 +82,5 @@
#define B_FAT ( Chr( 219 ) + Chr( 219 ) + Chr( 219 ) + Chr( 219 ) + ;
Chr( 219 ) + Chr( 219 ) + Chr( 219 ) + Chr( 219 ) )
/* NOTE: Several other Xbase++ function are currently implemented using
original Xbase++ names. */
#endif
#endif

View File

@@ -450,6 +450,8 @@ EXTERNAL __XSAVESCREEN
/* Harbour internal functions */
EXTERNAL __DBSKIPPER
EXTERNAL __NATISAFFIRM
EXTERNAL __NATISNEGATIVE
EXTERNAL __NATMSG
@@ -780,6 +782,7 @@ EXTERNAL SHOWMSG
/* Harbour extensions */
EXTERNAL HB_DYNCALL
EXTERNAL HB_PROGNAME
EXTERNAL HB_DIRBASE
EXTERNAL HB_DIRTEMP

View File

@@ -2245,3 +2245,64 @@ HB_FUNC( HB_WAEVAL )
else
hb_errRT_DBCMD( EG_ARG, EDBCMD_USE_BADPARAMETER, NULL, HB_ERR_FUNCNAME );
}
#ifndef HB_CLP_STRICT
HB_FUNC( __DBSKIPPER )
{
AREAP pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer();
if( pArea )
{
HB_LONG lSkipped = 0;
HB_LONG lRecs = 1;
HB_BOOL fBEof;
HB_ULONG ulRecords = 0;
if( SELF_RECCOUNT( pArea, &ulRecords ) == HB_SUCCESS && ulRecords > 0 )
{
if( HB_ISNUM( 1 ) )
lRecs = hb_parnl( 1 );
if( lRecs == 0 )
SELF_SKIP( pArea, 0 );
else if( lRecs > 0 )
{
if( SELF_EOF( pArea, &fBEof ) == HB_SUCCESS )
{
while( lSkipped < lRecs )
{
if( SELF_SKIP( pArea, 1 ) != HB_SUCCESS )
break;
if( SELF_EOF( pArea, &fBEof ) != HB_SUCCESS )
break;
if( fBEof )
{
SELF_SKIP( pArea, -1 );
break;
}
lSkipped++;
}
}
}
else /* if( lRecs < 0 ) */
{
while( lSkipped > lRecs )
{
if( SELF_SKIP( pArea, -1 ) != HB_SUCCESS )
break;
if( SELF_BOF( pArea, &fBEof ) != HB_SUCCESS )
break;
if( fBEof )
break;
lSkipped--;
}
}
}
hb_retnl( lSkipped );
}
else
hb_errRT_DBCMD( EG_NOTABLE, EDBCMD_NOTABLE, NULL, HB_ERR_FUNCNAME );
}
#endif

View File

@@ -54,13 +54,15 @@ FUNCTION TBrowseDB( nTop, nLeft, nBottom, nRight )
LOCAL oBrowse := TBrowseNew( nTop, nLeft, nBottom, nRight )
oBrowse:SkipBlock := { | nRecs | Skipped( nRecs ) }
oBrowse:SkipBlock := { | nRecs | __dbSkipper( nRecs ) }
oBrowse:GoTopBlock := { || dbGoTop() }
oBrowse:GoBottomBlock := { || dbGoBottom() }
RETURN oBrowse
STATIC FUNCTION Skipped( nRecs )
#ifdef HB_CLP_STRICT
FUNCTION __dbSkipper( nRecs )
LOCAL nSkipped := 0
@@ -88,3 +90,5 @@ STATIC FUNCTION Skipped( nRecs )
ENDIF
RETURN nSkipped
#endif