See ChangeLog entry 19990921-12:25 EDT David G. Holm <dholm@jsd-llc.com>
This commit is contained in:
@@ -1,3 +1,23 @@
|
||||
19990921-12:25 EDT David G. Holm <dholm@jsd-llc.com>
|
||||
|
||||
* source/rtl/console.c
|
||||
- Removed special handling for Unix and Cygwin in HB___ACCEPT(),
|
||||
per Georg Lehner
|
||||
|
||||
* source/rtl/filesys.c
|
||||
! Corrected convert_open_flags() check for FO_READONLY to
|
||||
mask out the share-mode flags before doing the check
|
||||
! Switched OS/2 from open() to sopen() in hb_fsOpen()
|
||||
|
||||
* source/rtl/inkey.c
|
||||
% Made two changes to Unix support, per Georg Lehner:
|
||||
1) Added 'ta.c_iflag &= ~ICRNL;'
|
||||
2) Changed 'return;' in hb_inkeyPoll() to 'ch = 0;'
|
||||
|
||||
* source/rtl/gt/gtos2.c
|
||||
! Removed the unsigned to signed conversions for sVert and sHoriz,
|
||||
now that the conversions are no longer needed
|
||||
|
||||
19990921-15:33 GMT+3 Alexander Kresin
|
||||
* source/hbpp/hbpp.c
|
||||
* Yet another bug fixed with restrivted match markers consisting of more
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#if defined(OS_UNIX_COMPATIBLE) || defined(__CYGWIN__)
|
||||
#if defined(__CYGWIN__)
|
||||
#include <unistd.h>
|
||||
#include <termios.h>
|
||||
#endif
|
||||
@@ -1094,31 +1094,6 @@ HARBOUR HB___ACCEPT( void ) /* Internal Clipper function used in ACCEPT command
|
||||
if( hb_pcount() >= 1 ) /* cPrompt passed */
|
||||
HB_QOUT();
|
||||
|
||||
#if defined (OS_UNIX_COMPATIBLE) || defined(__CYGWIN__)
|
||||
/* Read the data using fgets(), because hb_inkeyPoll() doesn't support
|
||||
Unix compatible operating systems yet. */
|
||||
{
|
||||
/* Set up for echoed canonical input */
|
||||
struct termios ta;
|
||||
tcgetattr( STDIN_FILENO, &ta );
|
||||
ta.c_lflag |= ( ICANON | ECHO );
|
||||
tcsetattr( STDIN_FILENO, TCSAFLUSH, &ta );
|
||||
|
||||
/* Avoid an undefined variable warning */
|
||||
input = 0;
|
||||
|
||||
/* Get a line of user input */
|
||||
s_szAcceptResult[ 0 ] = '\0'; /* start with something defined */
|
||||
if( fgets( s_szAcceptResult, ACCEPT_BUFFER_LEN, stdin ) )
|
||||
strtok( s_szAcceptResult, "\n" ); /* strip off the trailing newline if it exists */
|
||||
|
||||
/* Restore unechoed non-canonical input */
|
||||
ta.c_lflag &= ~( ICANON | ECHO );
|
||||
tcsetattr( STDIN_FILENO, TCSAFLUSH, &ta );
|
||||
|
||||
ulLen = strlen( s_szAcceptResult );
|
||||
}
|
||||
#else
|
||||
ulLen = 0;
|
||||
input = 0;
|
||||
while( input != K_ENTER )
|
||||
@@ -1152,7 +1127,6 @@ HARBOUR HB___ACCEPT( void ) /* Internal Clipper function used in ACCEPT command
|
||||
}
|
||||
}
|
||||
s_szAcceptResult[ ulLen ] = '\0';
|
||||
#endif
|
||||
hb_retc( s_szAcceptResult );
|
||||
}
|
||||
|
||||
|
||||
@@ -206,21 +206,23 @@ static int convert_open_flags( USHORT uiFlags )
|
||||
/* by default FO_READ + FO_COMPAT is set */
|
||||
int result_flags = 0;
|
||||
|
||||
result_flags |= O_BINARY;
|
||||
/* DEBUG: printf("\nconvert_open_flags: O_BINARY"); */
|
||||
/* DEBUG: printf("\nHarbour open flags: 0x%04x", uiFlags); */
|
||||
|
||||
#if defined( _MSC_VER ) || defined(__MINGW32__)
|
||||
if( uiFlags == 0 )
|
||||
result_flags |= O_BINARY;
|
||||
/* DEBUG: printf(", O_BINARY"); */
|
||||
|
||||
#if defined( _MSC_VER ) || defined(__MINGW32__) || defined(__IBMCPP__)
|
||||
if( ( uiFlags & ( FO_WRITE | FO_READWRITE ) ) == FO_READ )
|
||||
{
|
||||
result_flags |= O_RDONLY;
|
||||
/* DEBUG: printf(" O_RDONLY"); */
|
||||
/* DEBUG: printf(", O_RDONLY"); */
|
||||
}
|
||||
#else
|
||||
|
||||
if( uiFlags == 0 )
|
||||
if( ( uiFlags & ( FO_WRITE | FO_READWRITE ) ) == FO_READ )
|
||||
{
|
||||
result_flags |= ( O_RDONLY | SH_COMPAT );
|
||||
/* DEBUG: printf(" O_RDONLY SH_COMPAT"); */
|
||||
/* DEBUG: printf(", O_RDONLY SH_COMPAT"); */
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -228,48 +230,48 @@ static int convert_open_flags( USHORT uiFlags )
|
||||
if( uiFlags & FO_WRITE )
|
||||
{
|
||||
result_flags |= O_WRONLY;
|
||||
/* DEBUG: printf(" O_WRONLY"); */
|
||||
/* DEBUG: printf(", O_WRONLY"); */
|
||||
}
|
||||
|
||||
if( uiFlags & FO_READWRITE )
|
||||
{
|
||||
result_flags |= O_RDWR;
|
||||
/* DEBUG: printf(" O_RDWR"); */
|
||||
/* DEBUG: printf(", O_RDWR"); */
|
||||
}
|
||||
|
||||
#if ! defined(_MSC_VER) && ! defined(__MINGW32__)
|
||||
#if ! defined(_MSC_VER) && ! defined(__MINGW32__) && ! defined(__IBMCPP__)
|
||||
/* shared flags */
|
||||
if( ( uiFlags & FO_DENYREAD ) == FO_DENYREAD )
|
||||
{
|
||||
result_flags |= SH_DENYRD;
|
||||
/* DEBUG: printf(" SH_DENYRD"); */
|
||||
/* DEBUG: printf(", SH_DENYRD"); */
|
||||
}
|
||||
|
||||
else if( uiFlags & FO_EXCLUSIVE )
|
||||
{
|
||||
result_flags |= SH_DENYRW;
|
||||
/* DEBUG: printf(" SH_DENYRW"); */
|
||||
/* DEBUG: printf(", SH_DENYRW"); */
|
||||
}
|
||||
|
||||
else if( uiFlags & FO_DENYWRITE )
|
||||
{
|
||||
result_flags |= SH_DENYWR;
|
||||
/* DEBUG: printf(" SH_DENYWR"); */
|
||||
/* DEBUG: printf(", SH_DENYWR"); */
|
||||
}
|
||||
|
||||
if( uiFlags & FO_DENYNONE )
|
||||
{
|
||||
result_flags |= SH_DENYNO;
|
||||
/* DEBUG: printf(" SH_DENYNO"); */
|
||||
/* DEBUG: printf(", SH_DENYNO"); */
|
||||
}
|
||||
|
||||
if( uiFlags & FO_SHARED )
|
||||
{
|
||||
result_flags |= SH_DENYNO;
|
||||
/* DEBUG: printf(" SH_DENYNO"); */
|
||||
/* DEBUG: printf(", SH_DENYNO"); */
|
||||
}
|
||||
/* DEBUG: printf(" 0x%04x\n", result_flags); */
|
||||
#endif
|
||||
/* DEBUG: printf(", C/C++ open flags: 0x%04x\n", result_flags); */
|
||||
|
||||
return result_flags;
|
||||
}
|
||||
@@ -322,7 +324,7 @@ FHANDLE hb_fsOpen( BYTE * pFilename, USHORT uiFlags )
|
||||
{
|
||||
FHANDLE hFileHandle;
|
||||
|
||||
#if defined(HAVE_POSIX_IO)
|
||||
#if defined(HAVE_POSIX_IO) && ! defined(__IBMCPP__)
|
||||
|
||||
errno = 0;
|
||||
hFileHandle = open( ( char * ) pFilename, convert_open_flags( uiFlags ) );
|
||||
@@ -348,7 +350,7 @@ FHANDLE hb_fsOpen( BYTE * pFilename, USHORT uiFlags )
|
||||
hFileHandle = _open( ( char * ) pFilename, convert_open_flags( uiFlags ) );
|
||||
s_uiErrorLast = errno;
|
||||
|
||||
#elif defined(__MINGW32__)
|
||||
#elif defined(__MINGW32__) || defined(__IBMCPP__)
|
||||
|
||||
int iShare = SH_DENYNO;
|
||||
|
||||
@@ -585,7 +587,7 @@ ULONG hb_fsWriteLarge( FHANDLE hFileHandle, BYTE * pBuff, ULONG ulCount )
|
||||
*/
|
||||
if( uiWritten == ( USHORT )-1 || uiWritten == 0 )
|
||||
break;
|
||||
|
||||
|
||||
ulWritten += ( ULONG ) uiWritten;
|
||||
pPtr += uiWritten;
|
||||
}
|
||||
|
||||
@@ -118,9 +118,6 @@ void hb_gt_Scroll( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT usRight,
|
||||
/* Chen Kedem <niki@actcom.co.il> */
|
||||
|
||||
BYTE bCell[ 2 ]; /* character/attribute pair */
|
||||
|
||||
if( sVert > 128 ) sVert = sVert - 256;
|
||||
if( sHoriz > 128 ) sHoriz = sHoriz - 256;
|
||||
bCell [ 0 ] = ' ';
|
||||
bCell [ 1 ] = attr;
|
||||
if( ( sVert | sHoriz ) == 0 ) /* both zero, clear region */
|
||||
|
||||
@@ -143,6 +143,7 @@ HB_CALL_ON_STARTUP_BEGIN( init_input_mode )
|
||||
|
||||
tcgetattr( STDIN_FILENO, &ta );
|
||||
ta.c_lflag &= ~( ICANON | ECHO );
|
||||
ta.c_iflag &= ~ICRNL;
|
||||
ta.c_cc[ VMIN ] = 0;
|
||||
ta.c_cc[ VTIME ] = 0;
|
||||
tcsetattr( STDIN_FILENO, TCSAFLUSH, &ta );
|
||||
@@ -428,7 +429,7 @@ void hb_inkeyPoll( void ) /* Poll the console keyboard to stuff the Harbour
|
||||
#elif defined(OS_UNIX_COMPATIBLE)
|
||||
/* TODO: */
|
||||
if( ! read( STDIN_FILENO, &ch, 1 ) )
|
||||
return;
|
||||
ch = 0;
|
||||
#elif defined(__CYGWIN__)
|
||||
/* TODO: */
|
||||
/* NOTE: Cygwin needs the Unix support, but for some reason it
|
||||
@@ -439,7 +440,7 @@ void hb_inkeyPoll( void ) /* Poll the console keyboard to stuff the Harbour
|
||||
/* Only read keyboard input here if not called
|
||||
from the HVM and the typeahead buffer is empty. */
|
||||
read( STDIN_FILENO, &ch, 1 ); /* Read a key */
|
||||
if( ch == '\n' ) ch = '\r'; /* Convert LF to CR */
|
||||
/// if( ch == '\n' ) ch = '\r'; /* Convert LF to CR */
|
||||
}
|
||||
#else
|
||||
/* TODO: Support for other platforms, such as Mac */
|
||||
|
||||
Reference in New Issue
Block a user