See changelog 2002-03-03 16:20 UTC -0300

This commit is contained in:
Luiz Rafael Culik
2002-03-03 19:56:18 +00:00
parent 99e4b88dd5
commit a5677ca99f
6 changed files with 137 additions and 48 deletions

View File

@@ -7,6 +7,18 @@
For example:
2002-12-01 23:12 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2002-03-05 11:24 UTC+0300 Alexander Kresin <alex@belacy.belgorod.su>
2002-03-04 22:33 UTC+0100 Antonio Linares <alinares@fivetech.com>
* source/rtl/set.c
* some minor fixes on hb_setFreeSetPath()
reported by Mike Romberg from sourceforge bugs report
2002-03-04 12:35 UTC+0300 Alexander Kresin <alex@belacy.belgorod.su>
* source/rdd/dbfntx/dbfntx1.c
! Bug fixed, reported by Mike Romberg
2002-03-03 17:17 UTC-0800 Brian Hays <bhays@abacuslaw.com>
* source/rtl/persist.prg
* added 254 as linelength to MLCount call in LoadFromText so
it matches later call to MemoLine

View File

@@ -131,6 +131,7 @@ extern void hb_fsSetDevMode ( FHANDLE hFileHandle, USHORT uiDevMode ); /* ch
extern void hb_fsSetError ( USHORT uiError ); /* set the file system error number */
extern USHORT hb_fsWrite ( FHANDLE hFileHandle, BYTE * pBuff, USHORT ulCount ); /* write to an open file from a buffer (<=64K) */
extern ULONG hb_fsWriteLarge ( FHANDLE hFileHandle, BYTE * pBuff, ULONG ulCount ); /* write to an open file from a buffer (>64K) */
extern FHANDLE hb_fsPOpen( BYTE * pFilename, BYTE * pMode );
#define hb_fsFLock( h, s, l ) hb_fsLock( h, s, l, FL_LOCK )
#define hb_fsFUnlock( h, s, l ) hb_fsLock( h, s, l, FL_UNLOCK )

View File

@@ -98,6 +98,10 @@
#include "hbapifs.h"
#include "hb_io.h"
#if defined(OS_UNIX_COMPATIBLE)
#include <unistd.h>
#endif
#if defined(__GNUC__) && !defined(__MINGW32__)
#include <sys/types.h>
#include <sys/stat.h>
@@ -238,7 +242,7 @@ static USHORT s_uiErrorLast = 0;
/* Convert HARBOUR flags to IO subsystem flags */
#if defined(HB_FS_FILE_IO)
extern char **environ;
static int convert_open_flags( USHORT uiFlags )
{
/* by default FO_READ + FO_COMPAT is set */
@@ -361,6 +365,63 @@ static void convert_create_flags( USHORT uiFlags, int * result_flags, unsigned *
* FILESYS.API FUNCTIONS --
*/
FHANDLE hb_fsPOpen( BYTE * pFilename, BYTE * pMode )
{
FHANDLE hFileHandle;
HB_TRACE(HB_TR_DEBUG, ("hb_fsPOpen(%p, %s)", pFilename, pMode));
#if defined(OS_UNIX_COMPATIBLE)
{
FHANDLE hPipeHandle[2];
pid_t pid;
BOOL bRead;
bRead = ( *pMode == 'r' );
errno = 0;
if( pipe( hPipeHandle ) == 0 ) {
if( ( pid = fork() ) != -1 ) {
if( pid != 0 ) {
if( bRead ) {
close( hPipeHandle[ 1 ] );
hFileHandle = hPipeHandle[ 0 ];
} else {
close( hPipeHandle[ 0 ] );
hFileHandle = hPipeHandle[ 1 ];
}
} else {
char *argv[4];
argv[0] = "sh";
argv[1] = "-c";
argv[2] = ( char * ) pFilename;
argv[3] = ( char * ) 0;
if( bRead ) {
close( hPipeHandle[ 0 ] );
dup2( hPipeHandle[ 1 ], 1 );
} else {
close( hPipeHandle[ 1 ] );
dup2( hPipeHandle[ 0 ], 0 );
}
execve("/bin/sh", argv, environ);
exit(1);
}
} else {
close( hPipeHandle[0] );
close( hPipeHandle[1] );
}
}
s_uiErrorLast = errno;
}
#else
hFileHandle = FS_ERROR;
s_uiErrorLast = FS_ERROR;
#endif
return hFileHandle;
}
FHANDLE hb_fsOpen( BYTE * pFilename, USHORT uiFlags )
{
FHANDLE hFileHandle;

View File

@@ -195,21 +195,31 @@ static FHANDLE open_handle( char * file_name, BOOL bAppend, char * def_ext, HB_s
FHANDLE handle;
PHB_FNAME pFilename;
char path[ _POSIX_PATH_MAX + 1 ];
BOOL bPipe = FALSE;
HB_TRACE(HB_TR_DEBUG, ("open_handle(%s, %d, %s, %d)", file_name, (int) bAppend, def_ext, (int) set_specifier));
user_ferror = hb_fsError(); /* Save the current user file error code */
/* Create full filename */
pFilename = hb_fsFNameSplit( file_name );
if( ! pFilename->szPath && hb_set.HB_SET_DEFAULT )
pFilename->szPath = hb_set.HB_SET_DEFAULT;
if( ! pFilename->szExtension && def_ext )
pFilename->szExtension = def_ext;
#if defined(OS_UNIX_COMPATIBLE)
if( ( bPipe = ( set_specifier == HB_SET_PRINTFILE && \
(char) *file_name == '|' ) ) ) {
file_name++;
bAppend = FALSE;
}
#endif
if( ! bPipe ) {
pFilename = hb_fsFNameSplit( file_name );
hb_fsFNameMerge( path, pFilename );
hb_xfree( pFilename );
if( ! pFilename->szPath && hb_set.HB_SET_DEFAULT )
pFilename->szPath = hb_set.HB_SET_DEFAULT;
if( ! pFilename->szExtension && def_ext )
pFilename->szExtension = def_ext;
hb_fsFNameMerge( path, pFilename );
hb_xfree( pFilename );
}
/* Open the file either in append (bAppend) or truncate mode (!bAppend), but
always use binary mode */
@@ -221,40 +231,45 @@ static FHANDLE open_handle( char * file_name, BOOL bAppend, char * def_ext, HB_s
{
BOOL bCreate = FALSE;
if( bAppend )
{ /* Append mode */
if( hb_fsFile( ( BYTE * ) path ) )
{ /* If the file already exists, open it (in read-write mode, in
case of non-Unix and text modes). */
handle = hb_fsOpen( ( BYTE * ) path, FO_READWRITE | FO_DENYWRITE );
if( handle != FS_ERROR )
{ /* Position to EOF */
#if ! defined(OS_UNIX_COMPATIBLE)
/* Non-Unix needs special binary vs. text file handling */
if( set_specifier == HB_SET_PRINTFILE )
{ /* PRINTFILE is binary and needs no special handling. */
#endif
hb_fsSeek( handle, 0, FS_END );
#if ! defined(OS_UNIX_COMPATIBLE)
}
else
{ /* All other files are text files and may have an EOF
('\x1A') character at the end (non-UNIX only). */
char cEOF = '\0';
hb_fsSeek( handle, -1, FS_END ); /* Position to last char. */
hb_fsRead( handle, ( BYTE * ) &cEOF, 1 ); /* Read the last char. */
if( cEOF == '\x1A' ) /* If it's an EOF, */
hb_fsSeek( handle, -1, FS_END ); /* Then write over it. */
}
#endif
}
}
else bCreate = TRUE; /* Otherwise create a new file. */
}
else bCreate = TRUE; /* Always create a new file for overwrite mode. */
if( bPipe )
handle = hb_fsPOpen( ( BYTE * ) file_name, ( BYTE * ) "w" );
else
{
if( bAppend )
{ /* Append mode */
if( hb_fsFile( ( BYTE * ) path ) )
{ /* If the file already exists, open it (in read-write mode, in
case of non-Unix and text modes). */
handle = hb_fsOpen( ( BYTE * ) path, FO_READWRITE | FO_DENYWRITE );
if( handle != FS_ERROR )
{ /* Position to EOF */
#if ! defined(OS_UNIX_COMPATIBLE)
/* Non-Unix needs special binary vs. text file handling */
if( set_specifier == HB_SET_PRINTFILE )
{ /* PRINTFILE is binary and needs no special handling. */
#endif
hb_fsSeek( handle, 0, FS_END );
#if ! defined(OS_UNIX_COMPATIBLE)
}
else
{ /* All other files are text files and may have an EOF
('\x1A') character at the end (non-UNIX only). */
char cEOF = '\0';
hb_fsSeek( handle, -1, FS_END ); /* Position to last char. */
hb_fsRead( handle, ( BYTE * ) &cEOF, 1 ); /* Read the last char. */
if( cEOF == '\x1A' ) /* If it's an EOF, */
hb_fsSeek( handle, -1, FS_END ); /* Then write over it. */
}
#endif
}
}
else bCreate = TRUE; /* Otherwise create a new file. */
}
else bCreate = TRUE; /* Always create a new file for overwrite mode. */
if( bCreate )
handle = hb_fsCreate( ( BYTE * ) path, FC_NORMAL );
if( bCreate )
handle = hb_fsCreate( ( BYTE * ) path, FC_NORMAL );
}
if( handle == FS_ERROR )
{

View File

@@ -1025,10 +1025,10 @@ cDefHarOpts+=" -v "
endif
if ldebug
cDefHarOpts+=" -b "
cDefBccLibs += " debug.lib"
cDefGccLibs += " -ldebug"
cgcclibsos2 += " -ldebug"
cDeflibGccLibs += " -ldebug"
cDefBccLibs += " debug.lib "
cDefGccLibs += " -ldebug "
cgcclibsos2 += " -ldebug "
cDeflibGccLibs += " -ldebug "
endif
if lSupressline
cDefHarOpts+=" -l "
@@ -2097,7 +2097,7 @@ For nPos := 1 To 7
If At( "$", amacro[ nCount ] ) > 0
if (amacro[ nCount ] = "$(PROJECT)") .and. lGcc
Findmacro(amacro[ nCount ], @cRead )
fwrite(nLinkHandle,"CREATE " + "lib"+cRead+CRLF)
fwrite(nLinkHandle,"CREATE " + " lib"+cRead+CRLF)
cLib:="lib"+cRead
elseif (amacro[ nCount ] =="$(ALLOBJ)")
findmacro( amacro[ nCount ], @cRead )

View File

@@ -121,7 +121,7 @@ Static Function GetDirs( cPattern )
Local aDir := {}
Local lLinux := At( 'linux', lower(Os()) ) > 0
Aeval( Directory( cPattern + "*.", "D" ), ;
Aeval( Directory( cPattern + if(lLinux,"*,"*."), "D" ), ;
{ | xItem | If( xItem[ 5 ] = "D" .and. ;
( xItem[ 1 ] != "." .and. xItem[ 1 ] != ".." ), ;
( Aadd( aDir, cPattern + xItem[ 1 ] + If( llinux, "/", '\' ) ), ;