2009-11-17 04:26 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* contrib/xhb/xhbfunc.c
    + Ported CURDIRX() function from xhb.
      It's not exactly the same as xhb version uses hb_fsCurDirBuffEx() 
      internally, and I couldn't decipher the added feature above 
      hb_fsCurDirBuff().
This commit is contained in:
Viktor Szakats
2009-11-17 03:26:57 +00:00
parent 9ca0c7ed08
commit 8c48e9cf7c
2 changed files with 34 additions and 0 deletions

View File

@@ -17,6 +17,13 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-11-17 04:26 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/xhb/xhbfunc.c
+ Ported CURDIRX() function from xhb.
It's not exactly the same as xhb version uses hb_fsCurDirBuffEx()
internally, and I couldn't decipher the added feature above
hb_fsCurDirBuff().
2009-11-17 04:15 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* INSTALL
* Minor formatting.

View File

@@ -227,6 +227,33 @@ HB_FUNC( HB_F_EOF )
hb_fsSetFError( uiError );
}
HB_FUNC( CURDIRX )
{
HB_ERRCODE uiErrorOld = hb_fsError();
char * pbyBuffer = ( char * ) hb_xgrab( HB_PATH_MAX + 1 );
PHB_ITEM pDrv = hb_param( 1, HB_IT_STRING );
BYTE cCurDrv = hb_fsCurDrv();
BYTE cDrv;
if( pDrv && hb_parclen( 1 ) > 0 )
{
cDrv = ( BYTE ) ( HB_TOUPPER( *hb_itemGetCPtr( pDrv ) ) - 'A' );
if( cDrv != cCurDrv )
hb_fsChDrv( cDrv );
}
else
cDrv = cCurDrv;
/* NOTE: hb_fsCurDirBuffEx() in xhb, but I couldn't decipher the difference. [vszakats] */
hb_fsCurDirBuff( cDrv, pbyBuffer, HB_PATH_MAX );
hb_retc_buffer( pbyBuffer );
hb_fsChDrv( cCurDrv );
hb_fsSetError( uiErrorOld );
}
HB_FUNC_EXTERN( HB_CSTR );
HB_FUNC( CSTR )