2013-05-15 19:54 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/pp/hbpp.c
! fixed ChangeLog file name detection broken after adding .txt
extension.
* src/rtl/hbproces.c
+ added support merged stdout and stderr output in hb_fsProcessRun()
* src/rtl/hbprocfn.c
+ added support merged stdout and stderr output in hb_processRun()
PRG function. To extract merged stdin and stdout application output
it's enough to pass by reference in 3-rd and 4-th parameters the same
variable, i.e.:
nResult := hb_processRun( cCommand,, @cOutErr, @cOutErr )
* utils/hbmk2/hbmk2.prg
! use hb_processRun() intead of hb_processOpen() to extract merged
stdout and stderr output. It fixes all builds in which hb_processOpen()
does not exists due to some system limitations like missing pipes,
i.e. DOS builds.
* src/vm/fm.c
! fixed typo in DOS builds
* src/rtl/gtwin/gtwin.c
! ignore mouse position reported in mouse wheel events which use
screen based coordinates instead of console window ones.
This commit is contained in:
@@ -10,6 +10,34 @@
|
||||
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
|
||||
*/
|
||||
|
||||
2013-05-15 19:54 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
|
||||
* src/pp/hbpp.c
|
||||
! fixed ChangeLog file name detection broken after adding .txt
|
||||
extension.
|
||||
|
||||
* src/rtl/hbproces.c
|
||||
+ added support merged stdout and stderr output in hb_fsProcessRun()
|
||||
|
||||
* src/rtl/hbprocfn.c
|
||||
+ added support merged stdout and stderr output in hb_processRun()
|
||||
PRG function. To extract merged stdin and stdout application output
|
||||
it's enough to pass by reference in 3-rd and 4-th parameters the same
|
||||
variable, i.e.:
|
||||
nResult := hb_processRun( cCommand,, @cOutErr, @cOutErr )
|
||||
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
! use hb_processRun() intead of hb_processOpen() to extract merged
|
||||
stdout and stderr output. It fixes all builds in which hb_processOpen()
|
||||
does not exists due to some system limitations like missing pipes,
|
||||
i.e. DOS builds.
|
||||
|
||||
* src/vm/fm.c
|
||||
! fixed typo in DOS builds
|
||||
|
||||
* src/rtl/gtwin/gtwin.c
|
||||
! ignore mouse position reported in mouse wheel events which use
|
||||
screen based coordinates instead of console window ones.
|
||||
|
||||
2013-05-13 13:24 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
|
||||
* contrib/hbct/ctwin.c
|
||||
! fixed typo in recent commit
|
||||
|
||||
@@ -427,6 +427,7 @@ static char * hb_fsFileFind( const char * pszFileMask )
|
||||
char pszFileName[ HB_PATH_MAX ];
|
||||
PHB_FNAME pFileName = hb_fsFNameSplit( pszFileMask );
|
||||
pFileName->szName = ffind->szName;
|
||||
pFileName->szExtension = NULL;
|
||||
hb_fsFNameMerge( pszFileName, pFileName );
|
||||
hb_fsFindClose( ffind );
|
||||
hb_xfree( pFileName );
|
||||
|
||||
@@ -1671,9 +1671,12 @@ static int hb_gt_win_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
s_irInBuf[ s_cNumIndex ].EventType == MOUSE_EVENT &&
|
||||
iEventMask & ~( INKEY_KEYBOARD | HB_INKEY_RAW ) )
|
||||
{
|
||||
|
||||
s_mouse_iCol = s_irInBuf[ s_cNumIndex ].Event.MouseEvent.dwMousePosition.X;
|
||||
s_mouse_iRow = s_irInBuf[ s_cNumIndex ].Event.MouseEvent.dwMousePosition.Y;
|
||||
/* mouse wheel events use screen based mouse possition */
|
||||
if( s_irInBuf[ s_cNumIndex ].Event.MouseEvent.dwEventFlags != MOUSE_WHEELED )
|
||||
{
|
||||
s_mouse_iCol = s_irInBuf[ s_cNumIndex ].Event.MouseEvent.dwMousePosition.X;
|
||||
s_mouse_iRow = s_irInBuf[ s_cNumIndex ].Event.MouseEvent.dwMousePosition.Y;
|
||||
}
|
||||
|
||||
if( iEventMask & INKEY_MOVE &&
|
||||
s_irInBuf[ s_cNumIndex ].Event.MouseEvent.dwEventFlags == MOUSE_MOVED )
|
||||
|
||||
@@ -877,7 +877,8 @@ int hb_fsProcessRun( const char * pszFilename,
|
||||
hStdin = hStdout = hStderr = FS_ERROR;
|
||||
phStdin = pStdInBuf ? &hStdin : NULL;
|
||||
phStdout = pStdOutPtr && pulStdOut ? &hStdout : NULL;
|
||||
phStderr = pStdErrPtr && pulStdErr ? &hStderr : NULL;
|
||||
phStderr = pStdErrPtr && pulStdErr ?
|
||||
( pStdOutPtr == pStdErrPtr ? phStdout : &hStderr ) : NULL;
|
||||
|
||||
#if defined( HB_OS_DOS ) || defined( HB_OS_OS2 ) || defined( HB_OS_WIN_CE )
|
||||
{
|
||||
@@ -916,7 +917,12 @@ int hb_fsProcessRun( const char * pszFilename,
|
||||
hStdout = _HB_NULLHANDLE();
|
||||
|
||||
if( pStdErrPtr && pulStdErr )
|
||||
hStderr = hb_fsCreateTempEx( sTmpErr, NULL, NULL, NULL, FC_NORMAL );
|
||||
{
|
||||
if( phStdout == phStderr )
|
||||
hStderr = hStdout;
|
||||
else
|
||||
hStderr = hb_fsCreateTempEx( sTmpErr, NULL, NULL, NULL, FC_NORMAL );
|
||||
}
|
||||
else if( fDetach )
|
||||
hStderr = _HB_NULLHANDLE();
|
||||
|
||||
@@ -944,7 +950,7 @@ int hb_fsProcessRun( const char * pszFilename,
|
||||
if( sTmpOut[ 0 ] )
|
||||
hb_fsDelete( sTmpOut );
|
||||
}
|
||||
if( hStderr != FS_ERROR )
|
||||
if( hStderr != FS_ERROR && hStderr != hStdout )
|
||||
{
|
||||
if( pStdErrPtr && pulStdErr )
|
||||
{
|
||||
@@ -1030,7 +1036,8 @@ int hb_fsProcessRun( const char * pszFilename,
|
||||
else
|
||||
nOutBuf += ul;
|
||||
}
|
||||
else if( hStderr != FS_ERROR && lpHandles[ dwResult ] == ( HANDLE ) hb_fsGetOsHandle( hStderr ) )
|
||||
else if( hStderr != FS_ERROR &&
|
||||
lpHandles[ dwResult ] == ( HANDLE ) hb_fsGetOsHandle( hStderr ) )
|
||||
{
|
||||
if( nErrBuf == nErrSize )
|
||||
{
|
||||
@@ -1205,7 +1212,7 @@ int hb_fsProcessRun( const char * pszFilename,
|
||||
*pStdOutPtr = pOutBuf;
|
||||
*pulStdOut = nOutBuf;
|
||||
}
|
||||
if( phStderr )
|
||||
if( phStderr && phStdout != phStderr )
|
||||
{
|
||||
*pStdErrPtr = pErrBuf;
|
||||
*pulStdErr = nErrBuf;
|
||||
|
||||
@@ -138,7 +138,7 @@ HB_FUNC( HB_PROCESSRUN )
|
||||
nStdOut = nStdErr = 0;
|
||||
pStdOutBuf = pStdErrBuf = NULL;
|
||||
pStdOutPtr = pStdOut ? &pStdOutBuf : NULL;
|
||||
pStdErrPtr = pStdErr ? &pStdErrBuf : NULL;
|
||||
pStdErrPtr = pStdErr ? ( pStdOut == pStdErr ? pStdOutPtr : &pStdErrBuf ) : NULL;
|
||||
|
||||
iResult = hb_fsProcessRun( szName, szStdIn, hb_parclen( 2 ),
|
||||
pStdOutPtr, &nStdOut, pStdErrPtr, &nStdErr,
|
||||
@@ -157,7 +157,7 @@ HB_FUNC( HB_PROCESSRUN )
|
||||
if( ! hb_storclen_buffer( pStdErrBuf, nStdErr, 4 ) )
|
||||
hb_xfree( pStdErrBuf );
|
||||
}
|
||||
else if( pStdErr )
|
||||
else if( pStdErr && pStdOut != pStdErr )
|
||||
hb_storc( NULL, 4 );
|
||||
|
||||
hb_retni( iResult );
|
||||
|
||||
@@ -1353,7 +1353,7 @@ HB_SIZE hb_xquery( int iMode )
|
||||
union REGS regs;
|
||||
regs.HB_XREGS.ax = 0;
|
||||
HB_DOS_INT86( 0x12, ®s, ®s );
|
||||
iMode = regs.h.al;
|
||||
nResult = regs.w.ax;
|
||||
}
|
||||
#else
|
||||
nResult = 9999;
|
||||
|
||||
@@ -13158,34 +13158,16 @@ STATIC FUNCTION Apple_App_Template_Info_plist()
|
||||
|
||||
STATIC FUNCTION hbmk_hb_processRunCatch( cCommand, /* @ */ cStdOutErr )
|
||||
|
||||
LOCAL hProc
|
||||
LOCAL hOutErr
|
||||
|
||||
LOCAL cData
|
||||
LOCAL nLen
|
||||
|
||||
LOCAL nExitCode
|
||||
|
||||
cStdOutErr := ""
|
||||
|
||||
IF ( hProc := hb_processOpen( cCommand,, @hOutErr, @hOutErr ) ) != F_ERROR
|
||||
nExitCode := hb_processRun( cCommand,, @cStdOutErr, @cStdOutErr )
|
||||
|
||||
cData := Space( 1024 )
|
||||
DO WHILE ( nLen := FRead( hOutErr, @cData, hb_BLen( cData ) ) ) > 0
|
||||
cStdOutErr += hb_BLeft( cData, nLen )
|
||||
ENDDO
|
||||
|
||||
nExitCode := hb_processValue( hProc )
|
||||
|
||||
FClose( hOutErr )
|
||||
|
||||
IF nExitCode != 0
|
||||
OutErr( cStdOutErr )
|
||||
ELSE
|
||||
OutStd( cStdOutErr )
|
||||
ENDIF
|
||||
IF nExitCode != 0
|
||||
OutErr( cStdOutErr )
|
||||
ELSE
|
||||
nExitCode := -999
|
||||
OutStd( cStdOutErr )
|
||||
ENDIF
|
||||
|
||||
RETURN nExitCode
|
||||
|
||||
Reference in New Issue
Block a user