From d3abe7d275917e468d147ba52fca065969c214d4 Mon Sep 17 00:00:00 2001 From: Brian Hays Date: Tue, 23 Jan 2001 03:11:10 +0000 Subject: [PATCH] 2000-01-22 19:15 UTC-0800 Brian Hays --- harbour/ChangeLog | 7 +++++++ harbour/include/hbsetup.h | 5 ++++- harbour/source/rtl/console.c | 24 ++++++++++-------------- harbour/source/rtl/memoline.c | 8 +------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 52b191aede..beaf271416 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,10 @@ +2000-01-22 19:10 UTC-0800 Brian Hays + * harbour/include/hbsetup.h + + added #define OS_EOL_LEN /* # of bytes in End of Line marker */ + * source/rtl/console.c + * source/rtl/memoline.c + + implemented OS_EOL_LEN + 2000-01-22 18:00 UTC-0800 Brian Hays * contrib/rdd_ads/adsfunc.c + added ADSRegCallBack(cbBlock) and ADSClrCallBack() to register a callback function diff --git a/harbour/include/hbsetup.h b/harbour/include/hbsetup.h index ee226a80ee..068c94f87e 100644 --- a/harbour/include/hbsetup.h +++ b/harbour/include/hbsetup.h @@ -132,7 +132,7 @@ #ifndef HB_SYMBOL_NAME_LEN /* NOTE: For complete CA-Cl*pper compatibility you can set the maximum - symbol name to 10. Sometimes this can be useful for compiling legacy + symbol name to 10. Sometimes this can be useful for compiling legacy code. [vszakats] */ /* #ifdef HB_C52_STRICT @@ -163,12 +163,14 @@ #define OS_PATH_DELIMITER '\\' #define OS_PATH_DELIMITER_LIST "\\/:" #define OS_OPT_DELIMITER_LIST "/-" + #define OS_EOL_LEN 2 /* # of bytes in End of Line marker */ #else #define OS_UNIX_COMPATIBLE #define OS_PATH_LIST_SEPARATOR ':' #define OS_PATH_DELIMITER '/' #define OS_PATH_DELIMITER_LIST "/" #define OS_OPT_DELIMITER_LIST "-" + #define OS_EOL_LEN 1 #endif #else /* we are assuming here the DOS compatible OS */ @@ -177,6 +179,7 @@ #define OS_PATH_DELIMITER '\\' #define OS_PATH_DELIMITER_LIST "\\/:" #define OS_OPT_DELIMITER_LIST "/-" + #define OS_EOL_LEN 2 #endif #ifndef _POSIX_PATH_MAX diff --git a/harbour/source/rtl/console.c b/harbour/source/rtl/console.c index 43dd6ef5d6..a0c4d21e7e 100644 --- a/harbour/source/rtl/console.c +++ b/harbour/source/rtl/console.c @@ -66,11 +66,7 @@ #endif /* length of buffer for CR/LF characters */ -#if defined(OS_UNIX_COMPATIBLE) - #define CRLF_BUFFER_LEN 2 -#else - #define CRLF_BUFFER_LEN 3 -#endif +#define CRLF_BUFFER_LEN OS_EOL_LEN + 1 static BOOL s_bInit = FALSE; static USHORT s_uiPRow; @@ -446,9 +442,9 @@ HB_FUNC( DISPOUT ) /* writes a single value to the screen, but is not affected b hb_gtSetColorStr( hb_parc( 2 ) ); pszString = hb_itemString( hb_param( 1, HB_IT_ANY ), &ulLen, &bFreeReq ); - + hb_gtWrite( ( BYTE * ) pszString, ulLen ); - + if( bFreeReq ) hb_xfree( pszString ); @@ -457,9 +453,9 @@ HB_FUNC( DISPOUT ) /* writes a single value to the screen, but is not affected b else if( hb_pcount() >= 1 ) { pszString = hb_itemString( hb_param( 1, HB_IT_ANY ), &ulLen, &bFreeReq ); - + hb_gtWrite( ( BYTE * ) pszString, ulLen ); - + if( bFreeReq ) hb_xfree( pszString ); } @@ -481,11 +477,11 @@ HB_FUNC( DISPOUTAT ) /* writes a single value to the screen at speficic position hb_gtGetColorStr( szOldColor ); hb_gtSetColorStr( hb_parc( 4 ) ); - + pszString = hb_itemString( hb_param( 3, HB_IT_ANY ), &ulLen, &bFreeReq ); - + hb_gtWriteAt( hb_parni( 1 ), hb_parni( 2 ), ( BYTE * ) pszString, ulLen ); - + if( bFreeReq ) hb_xfree( pszString ); @@ -494,9 +490,9 @@ HB_FUNC( DISPOUTAT ) /* writes a single value to the screen at speficic position else if( hb_pcount() >= 3 ) { pszString = hb_itemString( hb_param( 3, HB_IT_ANY ), &ulLen, &bFreeReq ); - + hb_gtWriteAt( hb_parni( 1 ), hb_parni( 2 ), ( BYTE * ) pszString, ulLen ); - + if( bFreeReq ) hb_xfree( pszString ); } diff --git a/harbour/source/rtl/memoline.c b/harbour/source/rtl/memoline.c index 151f119e36..5871eaaf50 100644 --- a/harbour/source/rtl/memoline.c +++ b/harbour/source/rtl/memoline.c @@ -33,12 +33,6 @@ * */ -#if defined(OS_UNIX_COMPATIBLE) - #define CRLF_LEN 1 -#else - #define CRLF_LEN 2 -#endif - #include "hbapi.h" @@ -77,7 +71,7 @@ HB_FUNC( MEMOLINE ) case HB_CHAR_LF: ulCurLength = 0; ulLastSpace = 0; - ulLineEnd = ( ulPos >= CRLF_LEN ) ? ( ulPos - CRLF_LEN ) : ulLineBegin; + ulLineEnd = ( ulPos >= OS_EOL_LEN ) ? ( ulPos - OS_EOL_LEN ) : ulLineBegin; ulLines++; if( ulLines < ulLineNumber ) {