See ChangeLog entry 19990610-23:35 EDT David G. Holm <dholm@jsd-llc.com>

This commit is contained in:
David G. Holm
1999-06-11 04:39:46 +00:00
parent bc9cbd58c8
commit 952bafe557
3 changed files with 88 additions and 63 deletions

View File

@@ -1,3 +1,16 @@
19990610-23:35 EDT David G. Holm <dholm@jsd-llc.com>
* makefile.icc
- Added some missing source files
* source/rtl/files.c
- Put back '#include <direct.h>' for __WATCOM__, '#include <dir.h>'
for __BORLANDC__, and '#include <direct.h>' for __IBMCPP__, after
removing them earlier while removing '#include <dirent.h>', which
isn't needed, because the DIRECTORY() function is in a separate
source file. The reason that I thought it was safe to remove them
was that I *thought* that I had recompiled with IBMCPP after I
recompiled with DJGPP, but it turned out I hadn't. I'm hoping that
I caught it before anybody extracted the bad version from CVS.
19990610-22:35 EDT David G. Holm <dholm@jsd-llc.com>
+ include/fileio.ch
- File API related flags

View File

@@ -15,19 +15,22 @@ c_opt = /DUSE_GTAPI /W2 /Se /Sd+ /I.\include /Ti+
all: $(path_exe)\harbour.exe $(path_lib)\harbour.lib $(path_lib)\hbtools.lib $(path_lib)\terminal.lib
$(path_lib)\harbour.lib : $(path_obj)\arrays.obj \
$(path_lib)\harbour.lib : \
$(path_obj)\arrays.obj \
$(path_obj)\asort.obj \
$(path_obj)\classes.obj \
$(path_obj)\codebloc.obj \
$(path_obj)\console.obj \
$(path_obj)\descend.obj \
$(path_obj)\dates.obj \
$(path_obj)\dir.obj \
$(path_obj)\dynsym.obj \
$(path_obj)\environ.obj \
$(path_obj)\error.obj \
$(path_obj)\errorapi.obj \
$(path_obj)\errorsys.obj \
$(path_obj)\extend.obj \
$(path_obj)\files.obj \
$(path_obj)\gtapi.obj \
$(path_obj)\hardcr.obj \
$(path_obj)\initsymb.obj \
@@ -37,17 +40,13 @@ $(path_lib)\harbour.lib : $(path_obj)\arrays.obj \
$(path_obj)\mtran.obj \
$(path_obj)\objfunc.obj \
$(path_obj)\set.obj \
$(path_obj)\strings.obj \
$(path_obj)\strcmp.obj \
$(path_obj)\strings.obj \
$(path_obj)\tclass.obj \
$(path_obj)\transfrm.obj
@echo Harbour.lib
$(path_lib)\hbtools.lib: \
$(path_obj)\debug.obj \
$(path_obj)\genobj.obj \
$(path_obj)\mathx.obj \
$(path_obj)\stringsx.obj \
$(path_obj)\asciisum.obj \
$(path_obj)\ascpos.obj \
$(path_obj)\atdiff.obj \
@@ -57,12 +56,18 @@ $(path_lib)\hbtools.lib: \
$(path_obj)\chrcount.obj \
$(path_obj)\chrfirst.obj \
$(path_obj)\chrtotal.obj \
$(path_obj)\debug.obj \
$(path_obj)\genobj.obj \
$(path_obj)\hb_f.obj \
$(path_obj)\io.obj \
$(path_obj)\mathx.obj \
$(path_obj)\strasint.obj \
$(path_obj)\strcount.obj \
$(path_obj)\strcspn.obj \
$(path_obj)\strdiff.obj \
$(path_obj)\strexpan.obj \
$(path_obj)\stringp.obj \
$(path_obj)\stringsx.obj \
$(path_obj)\strleft.obj \
$(path_obj)\strpbrk.obj \
$(path_obj)\strright.obj
@@ -86,12 +91,15 @@ $(path_obj)\codebloc.obj : {$(path_c)}codebloc.c $(path_h)\extend.h $(path_h)\ty
$(path_obj)\dates.obj : {$(path_c)}dates.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\dates.h $(path_h)\set.h
$(path_obj)\debug.obj : {$(path_c)}debug.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\ctoharb.h $(path_h)\itemapi.h
$(path_obj)\descend.obj : {$(path_c)}descend.c $(path_h)\extend.h $(path_h)\types.h
$(path_obj)\dir.obj : {$(path_c)}dir.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\ctoharb.h $(path_h)\itemapi.h
$(path_obj)\environ.obj : {$(path_c)}environ.c $(path_h)\extend.h $(path_h)\types.h
$(path_obj)\errorapi.obj : {$(path_c)}errorapi.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\ctoharb.h
$(path_obj)\extend.obj : {$(path_c)}extend.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\set.h
$(path_obj)\files.obj : {$(path_c)}files.c $(path_h)\extend.h $(path_h)\types.h
$(path_obj)\gtapi.obj : {$(path_c)}gtapi.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\gtapi.h
$(path_obj)\hardcr.obj : {$(path_c)}hardcr.c $(path_h)\extend.h $(path_h)\types.h
$(path_obj)\hb_f.obj : {$(path_c)}hb_f.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\filesys.h
$(path_obj)\io.obj : {$(path_c)}io.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\filesys.h
$(path_obj)\initsymb.obj : {$(path_c)}initsymb.c $(path_h)\extend.h $(path_h)\types.h
$(path_obj)\itemapi.obj : {$(path_c)}itemapi.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\ctoharb.h $(path_h)\itemapi.h $(path_h)\set.h
$(path_obj)\math.obj : {$(path_c)}math.c $(path_h)\extend.h $(path_h)\types.h
@@ -143,7 +151,7 @@ $(path_obj)\error.obj : {$(path_prg)}\error.prg $(path_h)\pcode.h $(path_h)\i
$(path_obj)\errorsys.obj : {$(path_prg)}\errorsys.prg $(path_h)\pcode.h $(path_h)\init.h $(path_h)\extend.h $(path_h)\types.h {$(path_exe)}harbour.exe
$(path_exe)\harbour source\rtl\errorsys /n /osource\rtl
icc /C+ $(c_opt) /Fo$@ /Tp$source\rtl\errorsys.c
icc /C+ $(c_opt) /Fo$@ /Tpsource\rtl\errorsys.c
ilib .\libs\icc\harbour.lib -+$@,,
$(path_obj)\objfunc.obj : {$(path_prg)}\objfunc.prg $(path_h)\pcode.h $(path_h)\init.h $(path_h)\extend.h $(path_h)\types.h {$(path_exe)}harbour.exe

View File

@@ -28,6 +28,7 @@
#include <share.h>
#include <fcntl.h>
#include <io.h>
#include <direct.h>
#include <errno.h>
#if !defined(HAVE_POSIX_IO)
@@ -44,6 +45,9 @@
#include <share.h>
#if defined(__IBMCPP__)
#define SH_COMPAT SH_DENYRW
#include <direct.h>
#else
#include <dir.h>
#endif
#if !defined(HAVE_POSIX_IO)
@@ -142,7 +146,7 @@ static int convert_create_flags( int flags )
{
/* by default FC_NORMAL is set */
int result_flags=S_IWUSR;
result_flags |= O_BINARY | O_CREAT | O_TRUNC | O_RDWR;
if( flags & FC_READONLY )
@@ -166,30 +170,30 @@ static int convert_create_flags( int flags )
FHANDLE hb_fsOpen ( BYTEP name, USHORT flags )
{
FHANDLE handle;
FHANDLE handle;
#if defined(HAVE_POSIX_IO)
errno = 0;
errno = 0;
handle = open(name,convert_open_flags(flags));
last_error = errno;
#else
handle = FS_ERROR;
last_error = FS_ERROR;
#endif
return handle;
return handle;
}
FHANDLE hb_fsCreate ( BYTEP name, USHORT flags )
{
FHANDLE handle;
FHANDLE handle;
#if defined(HAVE_POSIX_IO)
errno = 0;
errno = 0;
handle = open(name,convert_create_flags(flags));
last_error = errno;
#else
handle = FS_ERROR;
last_error = FS_ERROR;
#endif
return handle;
return handle;
}
void hb_fsClose ( FHANDLE handle )
@@ -202,44 +206,44 @@ void hb_fsClose ( FHANDLE handle )
USHORT hb_fsRead ( FHANDLE handle, BYTEP buff, USHORT count )
{
USHORT bytes;
USHORT bytes;
#if defined(HAVE_POSIX_IO)
errno = 0;
errno = 0;
bytes = read(handle,buff,count);
last_error = errno;
#else
bytes = 0;
last_error = FS_ERROR;
#endif
return bytes;
return bytes;
}
USHORT hb_fsWrite ( FHANDLE handle, BYTEP buff, USHORT count )
{
USHORT bytes;
USHORT bytes;
#if defined(HAVE_POSIX_IO)
errno = 0;
errno = 0;
bytes = write(handle,buff,count);
last_error = errno;
#else
bytes = 0;
last_error = FS_ERROR;
#endif
return bytes;
return bytes;
}
ULONG hb_fsSeek ( FHANDLE handle, LONG offset, USHORT flags )
{
ULONG position;
ULONG position;
#if defined(HAVE_POSIX_IO)
errno = 0;
errno = 0;
position = lseek(handle,offset,convert_seek_flags(flags));
last_error = errno;
#else
position = 0;
last_error = FS_ERROR;
#endif
return position;
return position;
}
USHORT hb_fsError ( void )
@@ -250,7 +254,7 @@ USHORT hb_fsError ( void )
void hb_fsDelete ( BYTEP name )
{
#if defined(HAVE_POSIX_IO)
errno = 0;
errno = 0;
unlink(name);
last_error = errno;
return;
@@ -260,7 +264,7 @@ void hb_fsDelete ( BYTEP name )
void hb_fsRename ( BYTEP older, BYTEP newer )
{
#if defined(HAVE_POSIX_IO)
errno = 0;
errno = 0;
rename(older,newer);
last_error = errno;
return;
@@ -273,7 +277,7 @@ BOOL hb_fsLock ( FHANDLE handle, ULONG start,
int result=0;
#if defined(HAVE_POSIX_IO) && !defined(__GNUC__) && !defined(__IBMCPP__)
errno = 0;
errno = 0;
switch( mode )
{
case FL_LOCK:
@@ -285,7 +289,7 @@ BOOL hb_fsLock ( FHANDLE handle, ULONG start,
}
last_error = errno;
#else
result = 1;
result = 1;
last_error = FS_ERROR;
#endif
@@ -312,107 +316,107 @@ void hb_fsCommit ( FHANDLE handle )
BOOL hb_fsMkDir ( BYTEP name )
{
int result;
int result;
#if defined(HAVE_POSIX_IO)
errno = 0;
errno = 0;
#if !defined(__WATCOMC__) && !defined(__BORLANDC__) && !defined(__IBMCPP__)
result = mkdir(name,S_IWUSR|S_IRUSR);
#else
result = mkdir( name );
result = mkdir( name );
#endif
last_error = errno;
last_error = errno;
#else
result = 1;
last_error = FS_ERROR;
result = 1;
last_error = FS_ERROR;
#endif
return (result ? FALSE : TRUE );
return (result ? FALSE : TRUE );
}
BOOL hb_fsChDir ( BYTEP name )
{
int result;
int result;
#if defined(HAVE_POSIX_IO)
errno = 0;
errno = 0;
result = chdir(name);
last_error = errno;
#else
result = 1;
last_error = FS_ERROR;
result = 1;
last_error = FS_ERROR;
#endif
return (result ? FALSE : TRUE );
return (result ? FALSE : TRUE );
}
BOOL hb_fsRmDir ( BYTEP name )
{
int result;
int result;
#if defined(HAVE_POSIX_IO)
errno = 0;
errno = 0;
result = rmdir(name);
last_error = errno;
#else
result = 1;
last_error = FS_ERROR;
result = 1;
last_error = FS_ERROR;
#endif
return (result ? FALSE : TRUE );
return (result ? FALSE : TRUE );
}
BYTEP hb_fsCurDir ( USHORT uiDrive )
{
static char cwd_buff[PATH_MAX+1];
#if defined(HAVE_POSIX_IO)
errno = 0;
errno = 0;
getcwd(cwd_buff,PATH_MAX);
last_error = errno;
#else
cwd_buff[0] = 0;
last_error = FS_ERROR;
cwd_buff[0] = 0;
last_error = FS_ERROR;
#endif
return cwd_buff;
}
USHORT hb_fsChDrv ( BYTEP nDrive )
{
USHORT result;
USHORT result;
#if defined(HAVE_POSIX_IO)
errno = 0;
errno = 0;
result = 0;
last_error = errno;
last_error = FS_ERROR; /* TODO: Remove when function implemented */
#else
result = 0;
last_error = FS_ERROR;
result = 0;
last_error = FS_ERROR;
#endif
return result;
return result;
}
BYTE hb_fsCurDrv ( void )
{
USHORT result;
USHORT result;
#if defined(HAVE_POSIX_IO)
errno = 0;
errno = 0;
result = 0;
last_error = errno;
last_error = FS_ERROR; /* TODO: Remove when function implemented */
#else
result = 0;
last_error = FS_ERROR;
result = 0;
last_error = FS_ERROR;
#endif
return result;
return result;
}
USHORT hb_fsIsDrv ( BYTE nDrive )
{
USHORT result;
USHORT result;
#if defined(HAVE_POSIX_IO)
errno = 0;
errno = 0;
result = 0;
last_error = errno;
last_error = FS_ERROR; /* TODO: Remove when function implemented */
#else
result = 0;
last_error = FS_ERROR;
result = 0;
last_error = FS_ERROR;
#endif
return result;
return result;
}
/* TODO: Implement hb_fsExtOpen */
@@ -548,7 +552,7 @@ HARBOUR FCLOSE( void )
{
PHB_ITEM arg1_it = _param(1,IT_NUMBER);
last_error = 0;
last_error = 0;
if( arg1_it )
{
hb_fsClose(_parni(1));