From 06c4d78cb43a79e20eecb325120e38709b398460 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Fri, 9 Jan 2009 00:21:25 +0000 Subject: [PATCH] 2009-01-09 01:24 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/hbntos.c * harbour/source/rtl/hbrandom.c * removed dummy spaces * harbour/source/rtl/filesys.c * updated HB_TRACE messages * harbour/source/rdd/dbfntx/dbfntx1.c * harbour/source/rdd/dbfnsx/dbfnsx1.c * return pure index name without path and extension for DBOI_BAGNAME just like DBFCDX does. It's not Clipper compatible but looks that people expects ordBagName() behavior implemented in COMIX CDX driver (CL53). Full index name can be accessed by DBOI_FULLPATH. If you think it's wrong and we should keep CL52 DBFNTX behavior then I can revert it but I will want to also change DBFCDX to keep ordBagName() compatible core RDDs. Please let me know your preferences. * harbour/contrib/hbtpathy/telepath.prg ! replaced ThreadSleep() with hb_idleSleep() --- harbour/ChangeLog | 22 ++++++++++++++++++++++ harbour/contrib/hbtpathy/telepath.prg | 6 +++--- harbour/source/rdd/dbfnsx/dbfnsx1.c | 6 +++++- harbour/source/rdd/dbfntx/dbfntx1.c | 6 +++++- harbour/source/rtl/filesys.c | 14 ++++---------- harbour/source/rtl/hbntos.c | 2 +- harbour/source/rtl/hbrandom.c | 2 +- 7 files changed, 41 insertions(+), 17 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 436fb551b2..45cdcb9bc5 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,28 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-01-09 01:24 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/rtl/hbntos.c + * harbour/source/rtl/hbrandom.c + * removed dummy spaces + + * harbour/source/rtl/filesys.c + * updated HB_TRACE messages + + * harbour/source/rdd/dbfntx/dbfntx1.c + * harbour/source/rdd/dbfnsx/dbfnsx1.c + * return pure index name without path and extension for DBOI_BAGNAME just + like DBFCDX does. It's not Clipper compatible but looks that people + expects ordBagName() behavior implemented in COMIX CDX driver (CL53). + Full index name can be accessed by DBOI_FULLPATH. + If you think it's wrong and we should keep CL52 DBFNTX behavior then + I can revert it but I will want to also change DBFCDX to keep + ordBagName() compatible core RDDs. + Please let me know your preferences. + + * harbour/contrib/hbtpathy/telepath.prg + ! replaced ThreadSleep() with hb_idleSleep() + 2009-01-08 20:55 UTC+0100 Francesco Saverio Giudice (info/at/fsgiudice.com) * harbour/contrib/xhb/cstruct.prg * fixed assigned but unused variable diff --git a/harbour/contrib/hbtpathy/telepath.prg b/harbour/contrib/hbtpathy/telepath.prg index c1375a9494..a261f1eab8 100644 --- a/harbour/contrib/hbtpathy/telepath.prg +++ b/harbour/contrib/hbtpathy/telepath.prg @@ -129,7 +129,7 @@ function tp_delay( nTime ) endif - ThreadSleep( nTime * 1000 ) + hb_idleSleep( nTime ) return nil @@ -348,7 +348,7 @@ function tp_send( nPort, cString, nTimeout ) if nTotWritten < Len( cString ) if ! tp_idle() - ThreadSleep( 1000 ) + hb_idleSleep( 1 ) else exit endif @@ -705,7 +705,7 @@ function tp_flush( nPort, nTimeout ) // Sleep rest of timeout /* if nTimeout > 0 .AND. Seconds() - nStart < nTimeout - ThreadSleep( ( nTimeout - ( Seconds() - nStart ) ) * 1000 ) + hb_idleSleep( nTimeout - ( Seconds() - nStart ) ) endif */ diff --git a/harbour/source/rdd/dbfnsx/dbfnsx1.c b/harbour/source/rdd/dbfnsx/dbfnsx1.c index 7db964f588..24a4356e63 100644 --- a/harbour/source/rdd/dbfnsx/dbfnsx1.c +++ b/harbour/source/rdd/dbfnsx/dbfnsx1.c @@ -7142,8 +7142,12 @@ static ERRCODE hb_nsxOrderInfo( NSXAREAP pArea, USHORT uiIndex, LPDBORDERINFO pI pInfo->itmResult = hb_itemPutC( pInfo->itmResult, pTag->KeyExpr ); break; case DBOI_BAGNAME: - pInfo->itmResult = hb_itemPutC( pInfo->itmResult, pTag->pIndex->IndexName ); + { + PHB_FNAME pFileName = hb_fsFNameSplit( pTag->pIndex->IndexName ); + pInfo->itmResult = hb_itemPutC( pInfo->itmResult, pFileName->szName ); + hb_xfree( pFileName ); break; + } case DBOI_NAME: pInfo->itmResult = hb_itemPutC( pInfo->itmResult, pTag->TagName ); break; diff --git a/harbour/source/rdd/dbfntx/dbfntx1.c b/harbour/source/rdd/dbfntx/dbfntx1.c index bc36170367..0b21f83e44 100644 --- a/harbour/source/rdd/dbfntx/dbfntx1.c +++ b/harbour/source/rdd/dbfntx/dbfntx1.c @@ -6786,8 +6786,12 @@ static ERRCODE ntxOrderInfo( NTXAREAP pArea, USHORT uiIndex, LPDBORDERINFO pInfo hb_itemPutC( pInfo->itmResult, pTag->KeyExpr ); break; case DBOI_BAGNAME: - hb_itemPutC( pInfo->itmResult, pTag->Owner->IndexName ); + { + PHB_FNAME pFileName = hb_fsFNameSplit( pTag->Owner->IndexName ); + pInfo->itmResult = hb_itemPutC( pInfo->itmResult, pFileName->szName ); + hb_xfree( pFileName ); break; + } case DBOI_NAME: hb_itemPutC( pInfo->itmResult, pTag->TagName ); break; diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index f1fe715129..444e194954 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -124,12 +124,6 @@ #include #include #include - #if defined( HB_OS_DARWIN ) - #include - #define environ (*_NSGetEnviron()) - #elif !defined( __WATCOMC__ ) - extern char **environ; - #endif #endif #if ( defined(__DMC__) || defined(__BORLANDC__) || \ @@ -624,7 +618,7 @@ HB_FHANDLE hb_fsPOpen( BYTE * pFilename, BYTE * pMode ) close( hNullHandle ); setuid( getuid() ); setgid( getgid() ); - execve( "/bin/sh", argv, environ ); + execv( "/bin/sh", argv ); exit(1); } } @@ -657,7 +651,7 @@ HB_FHANDLE hb_fsOpen( BYTE * pFilename, USHORT uiFlags ) HB_FHANDLE hFileHandle; BOOL fFree; - HB_TRACE(HB_TR_DEBUG, ("hb_fsOpen(%p, %hu)", pFilename, uiFlags)); + HB_TRACE(HB_TR_DEBUG, ("hb_fsOpen(%s, %hu)", pFilename, uiFlags)); pFilename = hb_fsNameConv( pFilename, &fFree ); @@ -717,7 +711,7 @@ HB_FHANDLE hb_fsCreate( BYTE * pFilename, ULONG ulAttr ) HB_FHANDLE hFileHandle; BOOL fFree; - HB_TRACE(HB_TR_DEBUG, ("hb_fsCreate(%p, %lu)", pFilename, ulAttr)); + HB_TRACE(HB_TR_DEBUG, ("hb_fsCreate(%s, %lu)", pFilename, ulAttr)); pFilename = hb_fsNameConv( pFilename, &fFree ); @@ -777,7 +771,7 @@ HB_FHANDLE hb_fsCreateEx( BYTE * pFilename, ULONG ulAttr, USHORT uiFlags ) HB_FHANDLE hFileHandle; BOOL fFree; - HB_TRACE(HB_TR_DEBUG, ("hb_fsCreateEx(%p, %lu, %hu)", pFilename, ulAttr, uiFlags)); + HB_TRACE(HB_TR_DEBUG, ("hb_fsCreateEx(%s, %lu, %hu)", pFilename, ulAttr, uiFlags)); pFilename = hb_fsNameConv( pFilename, &fFree ); diff --git a/harbour/source/rtl/hbntos.c b/harbour/source/rtl/hbntos.c index 89d1f2e815..c004de2f00 100644 --- a/harbour/source/rtl/hbntos.c +++ b/harbour/source/rtl/hbntos.c @@ -70,7 +70,7 @@ HB_FUNC( HB_NTOS ) if( nToTrim ) memmove( szResult, szResult + nToTrim, strlen( szResult + nToTrim ) + 1 ); - + hb_retc_buffer( szResult ); return; } diff --git a/harbour/source/rtl/hbrandom.c b/harbour/source/rtl/hbrandom.c index f7139d3cf7..f6ee8f9c74 100644 --- a/harbour/source/rtl/hbrandom.c +++ b/harbour/source/rtl/hbrandom.c @@ -126,7 +126,7 @@ HB_FUNC( HB_RANDOMSEED ) srand( ISNUM( 1 ) ? ( unsigned ) hb_parni( 1 ) : ( unsigned ) hb_dateMilliSeconds() ); s_fInit = TRUE; } - + /* Returns a double value between 0 and 1 */ double hb_random_num() {