2007-08-23 18:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/source/rtl/gttrm/gttrm.c
    * enable automatic LF->CR+LF translation on TTY device

  * harbour/utils/hbdot/hbdot.prg
    * do not clear screen when hbdot executed with -h or --help switch

  * harbour/utils/hbtest/hbtest.prg
    * use stdout(<cMsg>) instead of fwrite(1,<cMsg>) - now GT driver
      can catch and redirect output if necessary
This commit is contained in:
Przemyslaw Czerpak
2007-08-23 16:25:27 +00:00
parent 39970a9215
commit 6aafea89bd
4 changed files with 39 additions and 15 deletions

View File

@@ -8,6 +8,17 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-08-23 18:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rtl/gttrm/gttrm.c
* enable automatic LF->CR+LF translation on TTY device
* harbour/utils/hbdot/hbdot.prg
* do not clear screen when hbdot executed with -h or --help switch
* harbour/utils/hbtest/hbtest.prg
* use stdout(<cMsg>) instead of fwrite(1,<cMsg>) - now GT driver
can catch and redirect output if necessary
2007-08-23 17:15 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rtl/gttrm/gttrm.c
* set cursor position at beginning of new line on application exit

View File

@@ -2831,7 +2831,9 @@ static void hb_gt_trm_Init( FHANDLE hFilenoStdin, FHANDLE hFilenoStdout, FHANDLE
s_termState.curr_TIO.c_cflag |= CS8 | CREAD;
s_termState.curr_TIO.c_iflag &= ~( IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON );
s_termState.curr_TIO.c_oflag &= ~OPOST;
/* s_termState.curr_TIO.c_oflag |= ONLCR | OPOST; */
/* Enable LF->CR+LF translation */
s_termState.curr_TIO.c_oflag |= ONLCR | OPOST;
memset( s_termState.curr_TIO.c_cc, 0, NCCS );
/* s_termState.curr_TIO.c_cc[ VMIN ] = 0; */
/* s_termState.curr_TIO.c_cc[ VTIME ] = 0; */
@@ -3085,8 +3087,9 @@ static void hb_gt_trm_Scroll( int iTop, int iLeft, int iBottom, int iRight,
HB_GTSUPER_SCROLLUP( iRows, bColor, bChar );
/* update our internal row position */
do
hb_gt_trm_termOut( ( BYTE * ) "\n", 1 );
hb_gt_trm_termOut( ( BYTE * ) "\n\r", 2 );
while( --iRows > 0 );
s_termState.iCol = 0;
return;
}
}

View File

@@ -82,8 +82,6 @@ PROCEDURE _APPMAIN( cFile, ... )
AADD( s_aIncDir, "-I/usr/local/include/harbour" )
#endif
CLEAR SCREEN
IF PCount() > 0
SWITCH cFile
CASE "-?"
@@ -104,6 +102,7 @@ PROCEDURE _APPMAIN( cFile, ... )
END
ELSE
CLEAR SCREEN
SET SCOREBOARD OFF
GetList := {}
cCommand := ""

View File

@@ -238,19 +238,19 @@ STATIC FUNCTION TEST_BEGIN( cParam )
/* Feedback */
FWrite( s_nFhnd, "---------------------------------------------------------------------------" + HB_OSNewLine() +;
OutMsg( s_nFhnd, "---------------------------------------------------------------------------" + HB_OSNewLine() +;
" Version: " + Version() + HB_OSNewLine() )
#ifdef __HARBOUR__
FWrite( s_nFhnd, " Compiler: " + HB_Compiler() + HB_OSNewLine() )
OutMsg( s_nFhnd, " Compiler: " + HB_Compiler() + HB_OSNewLine() )
#endif
FWrite( s_nFhnd, " OS: " + OS() + HB_OSNewLine() +;
OutMsg( s_nFhnd, " OS: " + OS() + HB_OSNewLine() +;
" Date, Time: " + DToC( Date() ) + " " + Time() + HB_OSNewLine() +;
" Output: " + s_cFileName + HB_OSNewLine() +;
"Shortcut opt.: " + iif( s_lShortcut, "ON", "OFF" ) + HB_OSNewLine() +;
" Switches: " + cParam + HB_OSNewLine() +;
"===========================================================================" + HB_OSNewLine() )
FWrite( s_nFhnd, PadR( "R", TEST_RESULT_COL1_WIDTH ) + " " +;
OutMsg( s_nFhnd, PadR( "R", TEST_RESULT_COL1_WIDTH ) + " " +;
PadR( "No. Line", TEST_RESULT_COL2_WIDTH ) + " " +;
PadR( "TestCall()", TEST_RESULT_COL3_WIDTH ) + " -> " +;
PadR( "Result", TEST_RESULT_COL4_WIDTH ) + " | " +;
@@ -371,7 +371,7 @@ FUNCTION TEST_CALL( cBlock, bBlock, xResultExpected )
IF lFailed
FWrite( s_nFhnd, PadR( iif( lFailed, "!", iif( lSkipped, "S", " " ) ), TEST_RESULT_COL1_WIDTH ) + " " +;
OutMsg( s_nFhnd, PadR( iif( lFailed, "!", iif( lSkipped, "S", " " ) ), TEST_RESULT_COL1_WIDTH ) + " " +;
PadR( Str( s_nCount, 4 ) + " " + ProcName( 1 ) + "(" + LTrim( Str( ProcLine( 1 ), 5 ) ) + ")", TEST_RESULT_COL2_WIDTH ) + " " +;
PadR( cBlock, TEST_RESULT_COL3_WIDTH ) +;
HB_OSNewLine() +;
@@ -382,7 +382,7 @@ FUNCTION TEST_CALL( cBlock, bBlock, xResultExpected )
ELSE
FWrite( s_nFhnd, PadR( iif( lFailed, "!", iif( lSkipped, "S", " " ) ), TEST_RESULT_COL1_WIDTH ) + " " +;
OutMsg( s_nFhnd, PadR( iif( lFailed, "!", iif( lSkipped, "S", " " ) ), TEST_RESULT_COL1_WIDTH ) + " " +;
PadR( Str( s_nCount, 4 ) + " " + ProcName( 1 ) + "(" + LTrim( Str( ProcLine( 1 ), 5 ) ) + ")", TEST_RESULT_COL2_WIDTH ) + " " +;
PadR( cBlock, TEST_RESULT_COL3_WIDTH ) + " -> " +;
PadR( XToStr( xResult ), TEST_RESULT_COL4_WIDTH ) + " | " +;
@@ -412,7 +412,7 @@ STATIC FUNCTION TEST_END()
s_nEndTime := Seconds()
FWrite( s_nFhnd, "===========================================================================" + HB_OSNewLine() +;
OutMsg( s_nFhnd, "===========================================================================" + HB_OSNewLine() +;
"Test calls passed: " + Str( s_nPass ) + " ( " + LTrim( Str( ( 1 - ( s_nFail / s_nPass ) ) * 100, 6, 2 ) ) + " % )" + HB_OSNewLine() +;
"Test calls failed: " + Str( s_nFail ) + " ( " + LTrim( Str( ( s_nFail / s_nPass ) * 100, 6, 2 ) ) + " % )" + HB_OSNewLine() +;
" ----------" + HB_OSNewLine() +;
@@ -422,10 +422,10 @@ STATIC FUNCTION TEST_END()
IF s_nFail != 0
IF "CLIPPER (R)" $ Upper( Version() )
FWrite( s_nFhnd, "WARNING ! Failures detected using CA-Clipper." + HB_OSNewLine() +;
OutMsg( s_nFhnd, "WARNING ! Failures detected using CA-Clipper." + HB_OSNewLine() +;
"Please fix those expected results which are not bugs in CA-Clipper itself." + HB_OSNewLine() )
ELSE
FWrite( s_nFhnd, "WARNING ! Failures detected" + HB_OSNewLine() )
OutMsg( s_nFhnd, "WARNING ! Failures detected" + HB_OSNewLine() )
ENDIF
ENDIF
@@ -606,11 +606,22 @@ FUNCTION HB_SToD( cDate )
STATIC FUNCTION BADFNAME()
#ifdef __PLATFORM__UNIX
return "*BADNAM/*.MEM"
RETURN "*BADNAM/*.MEM"
#else
return "*BADNAM*.MEM"
RETURN "*BADNAM*.MEM"
#endif
STATIC FUNCTION OutMsg( hFile, cMsg )
IF hFile == 1
OutStd( cMsg )
ELSEIF hFile == 2
OutErr( cMsg )
ELSE
FWrite( hFile, cMsg )
ENDIF
RETURN NIL
/* Don't change the position of this #include. */
#include "rt_init.ch"