From 169048432dd723230e552ca16582a7f49a0fbd0e Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Tue, 11 Aug 2009 09:14:53 +0000 Subject: [PATCH] 2009-08-11 11:14 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/hbtpathy/telepath.prg ! fixed tp_inkey() to not freeze when called without parameter * harbour/source/rdd/dbfntx/dbfntx1.c * harbour/source/rdd/dbfnsx/dbfnsx1.c * added OS/FS error codes to RTEs generated during indexing * replaced few numeric error codes with EDBF_* macros --- harbour/ChangeLog | 9 +++++++++ harbour/contrib/hbtpathy/telepath.prg | 4 ++-- harbour/source/rdd/dbfnsx/dbfnsx1.c | 12 ++++++------ harbour/source/rdd/dbfntx/dbfntx1.c | 16 ++++++++-------- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9001e37bcc..4ee24e90f7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,15 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-08-11 11:14 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/contrib/hbtpathy/telepath.prg + ! fixed tp_inkey() to not freeze when called without parameter + + * harbour/source/rdd/dbfntx/dbfntx1.c + * harbour/source/rdd/dbfnsx/dbfnsx1.c + * added OS/FS error codes to RTEs generated during indexing + * replaced few numeric error codes with EDBF_* macros + 2009-08-11 09:55 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/bsd/gcc.cf * config/wce/msvcarm.cf diff --git a/harbour/contrib/hbtpathy/telepath.prg b/harbour/contrib/hbtpathy/telepath.prg index d4a8a07e24..6b22b40724 100644 --- a/harbour/contrib/hbtpathy/telepath.prg +++ b/harbour/contrib/hbtpathy/telepath.prg @@ -106,8 +106,8 @@ FUNCTION tp_baud( nPort, nNewBaud ) RETURN t_aPorts[ nPort, TPFP_BAUD ] -FUNCTION tp_inkey( nSecs ) - RETURN inkey( nSecs ) +FUNCTION tp_inkey( ... ) + RETURN inkey( ... ) FUNCTION tp_idle( lNewval ) IF lNewval == .T. diff --git a/harbour/source/rdd/dbfnsx/dbfnsx1.c b/harbour/source/rdd/dbfnsx/dbfnsx1.c index 67edd09117..8d8a0c093b 100644 --- a/harbour/source/rdd/dbfnsx/dbfnsx1.c +++ b/harbour/source/rdd/dbfnsx/dbfnsx1.c @@ -5205,7 +5205,7 @@ static void hb_nsxSortWritePage( LPNSXSORTINFO pSort ) pSort->hTempFile = hb_fsCreateTemp( NULL, NULL, FC_NORMAL, szName ); if( pSort->hTempFile == FS_ERROR ) hb_nsxErrorRT( pSort->pTag->pIndex->pArea, EG_CREATE, EDBF_CREATE_TEMP, - szName, 0, 0, NULL ); + szName, hb_fsError(), 0, NULL ); else pSort->szTempFileName = hb_strdup( szName ); } @@ -5216,7 +5216,7 @@ static void hb_nsxSortWritePage( LPNSXSORTINFO pSort ) pSort->pSwapPage[ pSort->ulCurPage ].nOffset = hb_fsSeekLarge( pSort->hTempFile, 0, FS_END ); if( hb_fsWriteLarge( pSort->hTempFile, pSort->pStartKey, ulSize ) != ulSize ) hb_nsxErrorRT( pSort->pTag->pIndex->pArea, EG_WRITE, EDBF_WRITE_TEMP, - pSort->szTempFileName, 0, 0, NULL ); + pSort->szTempFileName, hb_fsError(), 0, NULL ); } else pSort->pSwapPage[ pSort->ulCurPage ].nOffset = 0; @@ -5239,7 +5239,7 @@ static void hb_nsxSortGetPageKey( LPNSXSORTINFO pSort, ULONG ulPage, hb_fsReadLarge( pSort->hTempFile, pSort->pSwapPage[ ulPage ].pKeyPool, ulSize ) != ulSize ) ) { hb_nsxErrorRT( pSort->pTag->pIndex->pArea, EG_READ, EDBF_READ_TEMP, - pSort->szTempFileName, 0, 0, NULL ); + pSort->szTempFileName, hb_fsError(), 0, NULL ); } pSort->pSwapPage[ ulPage ].nOffset += ulSize; pSort->pSwapPage[ ulPage ].ulKeyBuf = ulKeys; @@ -6692,7 +6692,7 @@ static HB_ERRCODE hb_nsxOrderCreate( NSXAREAP pArea, LPDBORDERCREATEINFO pOrderI hb_vmDestroyBlockOrMacro( pKeyExp ); SELF_GOTO( ( AREAP ) pArea, ulRecNo ); hb_nsxErrorRT( pArea, bType == 'U' ? EG_DATATYPE : EG_DATAWIDTH, - 1026, NULL, 0, 0, NULL ); + EDBF_INVALIDKEY, NULL, 0, 0, NULL ); return HB_FAILURE; } @@ -7445,7 +7445,7 @@ static HB_ERRCODE hb_nsxOrderInfo( NSXAREAP pArea, USHORT uiIndex, LPDBORDERINFO } else { - hb_nsxErrorRT( pArea, 0, 1052, NULL, 0, 0, NULL ); + hb_nsxErrorRT( pArea, 0, EDBF_NOTCUSTOM, NULL, 0, 0, NULL ); return HB_FAILURE; } break; @@ -7462,7 +7462,7 @@ static HB_ERRCODE hb_nsxOrderInfo( NSXAREAP pArea, USHORT uiIndex, LPDBORDERINFO } else { - hb_nsxErrorRT( pArea, 0, 1052, NULL, 0, 0, NULL ); + hb_nsxErrorRT( pArea, 0, EDBF_NOTCUSTOM, NULL, 0, 0, NULL ); return HB_FAILURE; } break; diff --git a/harbour/source/rdd/dbfntx/dbfntx1.c b/harbour/source/rdd/dbfntx/dbfntx1.c index bb965cc324..10b5f6757b 100644 --- a/harbour/source/rdd/dbfntx/dbfntx1.c +++ b/harbour/source/rdd/dbfntx/dbfntx1.c @@ -1936,7 +1936,7 @@ static HB_ERRCODE hb_ntxIndexHeaderRead( LPNTXINDEX pIndex ) { #if defined( HB_NTX_NOMULTITAG ) hb_ntxErrorRT( pIndex->Owner, EG_CORRUPTION, EDBF_CORRUPT, - pIndex->IndexName, hb_fsError(), 0, NULL ); + pIndex->IndexName, 0, 0, NULL ); return HB_FAILURE; #else LPCTXHEADER lpCTX = ( LPCTXHEADER ) pIndex->HeaderBuff; @@ -1974,7 +1974,7 @@ static HB_ERRCODE hb_ntxIndexHeaderRead( LPNTXINDEX pIndex ) if( pIndex->Compound ) { hb_ntxErrorRT( pIndex->Owner, EG_CORRUPTION, EDBF_CORRUPT, - pIndex->IndexName, hb_fsError(), 0, NULL ); + pIndex->IndexName, 0, 0, NULL ); return HB_FAILURE; } pTag = pIndex->iTags ? pIndex->lpTags[0] : NULL; @@ -4794,7 +4794,7 @@ static void hb_ntxSortWritePage( LPNTXSORTINFO pSort ) pSort->hTempFile = hb_fsCreateTemp( NULL, NULL, FC_NORMAL, szName ); if( pSort->hTempFile == FS_ERROR ) hb_ntxErrorRT( pSort->pTag->Owner->Owner, EG_CREATE, EDBF_CREATE_TEMP, - szName, 0, 0, NULL ); + szName, hb_fsError(), 0, NULL ); else pSort->szTempFileName = hb_strdup( szName ); } @@ -4805,7 +4805,7 @@ static void hb_ntxSortWritePage( LPNTXSORTINFO pSort ) pSort->pSwapPage[ pSort->ulCurPage ].nOffset = hb_fsSeekLarge( pSort->hTempFile, 0, FS_END ); if( hb_fsWriteLarge( pSort->hTempFile, pSort->pStartKey, ulSize ) != ulSize ) hb_ntxErrorRT( pSort->pTag->Owner->Owner, EG_WRITE, EDBF_WRITE_TEMP, - pSort->szTempFileName, 0, 0, NULL ); + pSort->szTempFileName, hb_fsError(), 0, NULL ); } else pSort->pSwapPage[ pSort->ulCurPage ].nOffset = 0; @@ -4828,7 +4828,7 @@ static void hb_ntxSortGetPageKey( LPNTXSORTINFO pSort, ULONG ulPage, hb_fsReadLarge( pSort->hTempFile, pSort->pSwapPage[ ulPage ].pKeyPool, ulSize ) != ulSize ) ) { hb_ntxErrorRT( pSort->pTag->Owner->Owner, EG_READ, EDBF_READ_TEMP, - pSort->szTempFileName, 0, 0, NULL ); + pSort->szTempFileName, hb_fsError(), 0, NULL ); } pSort->pSwapPage[ ulPage ].nOffset += ulSize; pSort->pSwapPage[ ulPage ].ulKeyBuf = ulKeys; @@ -6223,7 +6223,7 @@ static HB_ERRCODE ntxOrderCreate( NTXAREAP pArea, LPDBORDERCREATEINFO pOrderInfo hb_vmDestroyBlockOrMacro( pKeyExp ); SELF_GOTO( ( AREAP ) pArea, ulRecNo ); hb_ntxErrorRT( pArea, bType == 'U' ? EG_DATATYPE : EG_DATAWIDTH, - 1026, NULL, 0, 0, NULL ); + EDBF_INVALIDKEY, NULL, 0, 0, NULL ); return HB_FAILURE; } @@ -7008,7 +7008,7 @@ static HB_ERRCODE ntxOrderInfo( NTXAREAP pArea, USHORT uiIndex, LPDBORDERINFO pI } else { - hb_ntxErrorRT( pArea, 0, 1052, NULL, 0, 0, NULL ); + hb_ntxErrorRT( pArea, 0, EDBF_NOTCUSTOM, NULL, 0, 0, NULL ); return HB_FAILURE; } break; @@ -7026,7 +7026,7 @@ static HB_ERRCODE ntxOrderInfo( NTXAREAP pArea, USHORT uiIndex, LPDBORDERINFO pI } else { - hb_ntxErrorRT( pArea, 0, 1052, NULL, 0, 0, NULL ); + hb_ntxErrorRT( pArea, 0, EDBF_NOTCUSTOM, NULL, 0, 0, NULL ); return HB_FAILURE; } break;