From 3609cf9c0b3f5fb51b750608750a3ff4dd53613d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 22 Jul 2008 08:01:32 +0000 Subject: [PATCH] 2008-07-22 09:50 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * include/hbapifs.h * source/rtl/filesys.c + Added skeletons for hb_fsGetAttr() and hb_fsGetFileTime() TODO: Implementation. * contrib/hbclipsm/common.mak * contrib/hbclipsm/Makefile - contrib/hbclipsm/dbf.c ! Removed duplicate implementation of DBF() from hbclipsm.lib ; TOFIX: I'm getting these new warnings under BCC55: Warning W8080 source\rtl\filesys.c 2718: '_fstat(int,_stat *)' is declared but never used Warning W8080 source\rtl\filesys.c 2718: '_disable()' is declared but never used Warning W8080 source\rtl\filesys.c 2718: '_enable()' is declared but never used Warning W8080 source\rtl\fssize.c 142: '_fstat(int,_stat *)' is declared but never used --- harbour/ChangeLog | 18 ++++++ harbour/contrib/hbclipsm/Makefile | 1 - harbour/contrib/hbclipsm/common.mak | 1 - harbour/contrib/hbclipsm/dbf.c | 61 ------------------ harbour/include/hbapifs.h | 96 +++++++++++++++-------------- harbour/source/rtl/filesys.c | 25 ++++++++ 6 files changed, 92 insertions(+), 110 deletions(-) delete mode 100644 harbour/contrib/hbclipsm/dbf.c diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 01be94ebee..d235fc66c9 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,24 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-07-22 09:50 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * include/hbapifs.h + * source/rtl/filesys.c + + Added skeletons for hb_fsGetAttr() and hb_fsGetFileTime() + TODO: Implementation. + + * contrib/hbclipsm/common.mak + * contrib/hbclipsm/Makefile + - contrib/hbclipsm/dbf.c + ! Removed duplicate implementation of DBF() from hbclipsm.lib + + ; TOFIX: + I'm getting these new warnings under BCC55: + Warning W8080 source\rtl\filesys.c 2718: '_fstat(int,_stat *)' is declared but never used + Warning W8080 source\rtl\filesys.c 2718: '_disable()' is declared but never used + Warning W8080 source\rtl\filesys.c 2718: '_enable()' is declared but never used + Warning W8080 source\rtl\fssize.c 142: '_fstat(int,_stat *)' is declared but never used + 2008-07-21 21:54 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/gtwvt/gtwvt.h * added some definitions which seems to be missing in some MSVC-WinCE diff --git a/harbour/contrib/hbclipsm/Makefile b/harbour/contrib/hbclipsm/Makefile index f98e444ae0..54dc613e64 100644 --- a/harbour/contrib/hbclipsm/Makefile +++ b/harbour/contrib/hbclipsm/Makefile @@ -6,7 +6,6 @@ ROOT = ../../ C_SOURCES=\ date.c \ - dbf.c \ environ.c \ gauge.c \ num.c \ diff --git a/harbour/contrib/hbclipsm/common.mak b/harbour/contrib/hbclipsm/common.mak index 4134d8ce82..d9887d3f04 100644 --- a/harbour/contrib/hbclipsm/common.mak +++ b/harbour/contrib/hbclipsm/common.mak @@ -12,7 +12,6 @@ PRG_HEADERS = \ LIB_OBJS = \ $(OBJ_DIR)environ$(OBJEXT) \ $(OBJ_DIR)date$(OBJEXT) \ - $(OBJ_DIR)dbf$(OBJEXT) \ $(OBJ_DIR)gauge$(OBJEXT) \ $(OBJ_DIR)num$(OBJEXT) \ $(OBJ_DIR)stack$(OBJEXT) \ diff --git a/harbour/contrib/hbclipsm/dbf.c b/harbour/contrib/hbclipsm/dbf.c deleted file mode 100644 index 8f589fbdfd..0000000000 --- a/harbour/contrib/hbclipsm/dbf.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * $Id$ - */ - -/* - * Harbour Project source code: - * DBF() function (compatible with Summer'87) - * - * Copyright 2000 Jose Lalin - * www - http://www.harbour-project.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). - * - * As a special exception, the Harbour Project gives permission for - * additional uses of the text contained in its release of Harbour. - * - * The exception is that, if you link the Harbour libraries with other - * files to produce an executable, this does not by itself cause the - * resulting executable to be covered by the GNU General Public License. - * Your use of that executable is in no way restricted on account of - * linking the Harbour library code into it. - * - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - * - * This exception applies only to the code released by the Harbour - * Project under the name Harbour. If you copy code from other - * Harbour Project or Free Software Foundation releases into a copy of - * Harbour, as the General Public License permits, the exception does - * not apply to the code that you add in this way. To avoid misleading - * anyone as to the status of such modified files, you must delete - * this exception notice from them. - * - * If you write modifications of your own for Harbour, it is your choice - * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. - * - */ - -#include "hbapi.h" -#include "hbapiitm.h" - -HB_FUNC_EXTERN( ALIAS ); - -HB_FUNC( DBF ) -{ - HB_FUNC_EXEC( ALIAS ); -} diff --git a/harbour/include/hbapifs.h b/harbour/include/hbapifs.h index 4dcae8c221..7b2540c819 100644 --- a/harbour/include/hbapifs.h +++ b/harbour/include/hbapifs.h @@ -147,52 +147,54 @@ HB_EXTERN_BEGIN HB_FA_POSIX_SID(a) ) -extern HB_EXPORT BOOL hb_fsChDir ( BYTE * pszDirName ); /* change working directory */ -extern HB_EXPORT USHORT hb_fsChDrv ( BYTE nDrive ); /* change working drive */ -extern HB_EXPORT void hb_fsClose ( FHANDLE hFileHandle ); /* close a file */ -extern HB_EXPORT void hb_fsCommit ( FHANDLE hFileHandle ); /* commit updates of a file */ -extern HB_EXPORT FHANDLE hb_fsCreate ( BYTE * pszFileName, ULONG ulAttr ); /* create a file */ -extern HB_EXPORT FHANDLE hb_fsCreateEx ( BYTE * pszFilename, ULONG ulAttr, USHORT uiFlags ); /* create a file, with specific open mode */ -extern HB_EXPORT FHANDLE hb_fsCreateTemp ( const BYTE * pszDir, const BYTE * pszPrefix, ULONG ulAttr, BYTE * pszName ); /* create a temporary file from components */ -extern HB_EXPORT BYTE * hb_fsCurDir ( USHORT uiDrive ); /* retrieve a static pointer containing current directory for specified drive */ -extern HB_EXPORT USHORT hb_fsCurDirBuff ( USHORT uiDrive, BYTE * pbyBuffer, ULONG ulLen ); /* copy current directory for given drive into a buffer */ -extern HB_EXPORT BYTE hb_fsCurDrv ( void ); /* retrieve current drive number */ -extern HB_EXPORT BOOL hb_fsDelete ( BYTE * pszFileName ); /* delete a file */ -extern HB_EXPORT BOOL hb_fsEof ( FHANDLE hFileHandle ); /* determine if an open file is position at end-of-file */ -extern HB_EXPORT USHORT hb_fsError ( void ); /* retrieve file system error */ -extern HB_EXPORT USHORT hb_fsOsError ( void ); /* retrieve system dependant file system error */ -extern HB_EXPORT BOOL hb_fsFile ( BYTE * pszFileName ); /* determine if a file exists */ -extern HB_EXPORT BOOL hb_fsIsDirectory( BYTE * pFilename ); -extern HB_EXPORT HB_FOFFSET hb_fsFSize ( BYTE * pszFileName, BOOL bUseDirEntry ); /* determine the size of a file */ -extern HB_EXPORT FHANDLE hb_fsExtOpen ( BYTE * pszFileName, BYTE * pDefExt, - USHORT uiFlags, BYTE * pPaths, PHB_ITEM pError ); /* open a file using default extension and a list of paths */ -extern HB_EXPORT USHORT hb_fsIsDrv ( BYTE nDrive ); /* determine if a drive number is a valid drive */ -extern HB_EXPORT BOOL hb_fsIsDevice ( FHANDLE hFileHandle ); /* determine if a file is attached to a device (console?) */ -extern HB_EXPORT BOOL hb_fsLock ( FHANDLE hFileHandle, ULONG ulStart, ULONG ulLength, USHORT uiMode ); /* request a lock on a portion of a file */ -extern HB_EXPORT BOOL hb_fsLockLarge ( FHANDLE hFileHandle, HB_FOFFSET ulStart, - HB_FOFFSET ulLength, USHORT uiMode ); /* request a lock on a portion of a file using 64bit API */ -extern HB_EXPORT BOOL hb_fsMkDir ( BYTE * pszDirName ); /* create a directory */ -extern HB_EXPORT FHANDLE hb_fsOpen ( BYTE * pszFileName, USHORT uiFlags ); /* open a file */ -extern HB_EXPORT USHORT hb_fsRead ( FHANDLE hFileHandle, BYTE * pBuff, USHORT ulCount ); /* read contents of a file into a buffer (<=64K) */ -extern HB_EXPORT ULONG hb_fsReadLarge ( FHANDLE hFileHandle, BYTE * pBuff, ULONG ulCount ); /* read contents of a file into a buffer (>64K) */ -extern HB_EXPORT BOOL hb_fsRmDir ( BYTE * pszDirName ); /* remove a directory */ -extern HB_EXPORT BOOL hb_fsRename ( BYTE * pszOldName, BYTE * pszNewName ); /* rename a file */ -extern HB_EXPORT ULONG hb_fsSeek ( FHANDLE hFileHandle, LONG lOffset, USHORT uiMode ); /* reposition an open file */ -extern HB_EXPORT HB_FOFFSET hb_fsSeekLarge( FHANDLE hFileHandle, HB_FOFFSET llOffset, USHORT uiFlags ); /* reposition an open file using 64bit API */ -extern HB_EXPORT ULONG hb_fsTell ( FHANDLE hFileHandle ); /* retrieve the current position of a file */ -extern HB_EXPORT BOOL hb_fsSetDevMode ( FHANDLE hFileHandle, USHORT uiDevMode ); /* change the device mode of a file (text/binary) */ -extern HB_EXPORT BOOL hb_fsSetFileTime( BYTE * pszFileName, LONG lJulian, LONG lMillisec ); -extern HB_EXPORT BOOL hb_fsSetAttr ( BYTE * pszFileName, ULONG ulAttr ); -extern HB_EXPORT void hb_fsSetError ( USHORT uiError ); /* set the file system DOS error number */ -extern HB_EXPORT void hb_fsSetIOError ( BOOL fResult, USHORT uiOperation ); /* set the file system error number after IO operation */ -extern HB_EXPORT USHORT hb_fsWrite ( FHANDLE hFileHandle, const BYTE * pBuff, USHORT ulCount ); /* write to an open file from a buffer (<=64K) */ -extern HB_EXPORT ULONG hb_fsWriteLarge ( FHANDLE hFileHandle, const BYTE * pBuff, ULONG ulCount ); /* write to an open file from a buffer (>64K) */ -extern HB_EXPORT FHANDLE hb_fsPOpen ( BYTE * pFilename, BYTE * pMode ); -extern HB_EXPORT FHANDLE hb_fsGetOsHandle( FHANDLE hFileHandle ); -extern HB_EXPORT USHORT hb_fsGetFError ( void ); /* get FERROR() flag */ -extern HB_EXPORT void hb_fsSetFError ( USHORT uiError ); /* set FERROR() flag */ -extern HB_EXPORT BOOL hb_fsFileExists ( const char * pszFileName ); /* check if a file exists (wildcard chars not accepted). */ -extern HB_EXPORT BOOL hb_fsDirExists ( const char * pszDirName ); /* check if a directory exists (wildcard chars not accepted). */ +extern HB_EXPORT BOOL hb_fsChDir ( BYTE * pszDirName ); /* change working directory */ +extern HB_EXPORT USHORT hb_fsChDrv ( BYTE nDrive ); /* change working drive */ +extern HB_EXPORT void hb_fsClose ( FHANDLE hFileHandle ); /* close a file */ +extern HB_EXPORT void hb_fsCommit ( FHANDLE hFileHandle ); /* commit updates of a file */ +extern HB_EXPORT FHANDLE hb_fsCreate ( BYTE * pszFileName, ULONG ulAttr ); /* create a file */ +extern HB_EXPORT FHANDLE hb_fsCreateEx ( BYTE * pszFilename, ULONG ulAttr, USHORT uiFlags ); /* create a file, with specific open mode */ +extern HB_EXPORT FHANDLE hb_fsCreateTemp ( const BYTE * pszDir, const BYTE * pszPrefix, ULONG ulAttr, BYTE * pszName ); /* create a temporary file from components */ +extern HB_EXPORT BYTE * hb_fsCurDir ( USHORT uiDrive ); /* retrieve a static pointer containing current directory for specified drive */ +extern HB_EXPORT USHORT hb_fsCurDirBuff ( USHORT uiDrive, BYTE * pbyBuffer, ULONG ulLen ); /* copy current directory for given drive into a buffer */ +extern HB_EXPORT BYTE hb_fsCurDrv ( void ); /* retrieve current drive number */ +extern HB_EXPORT BOOL hb_fsDelete ( BYTE * pszFileName ); /* delete a file */ +extern HB_EXPORT BOOL hb_fsEof ( FHANDLE hFileHandle ); /* determine if an open file is position at end-of-file */ +extern HB_EXPORT USHORT hb_fsError ( void ); /* retrieve file system error */ +extern HB_EXPORT USHORT hb_fsOsError ( void ); /* retrieve system dependant file system error */ +extern HB_EXPORT BOOL hb_fsFile ( BYTE * pszFileName ); /* determine if a file exists */ +extern HB_EXPORT BOOL hb_fsIsDirectory( BYTE * pFilename ); +extern HB_EXPORT HB_FOFFSET hb_fsFSize ( BYTE * pszFileName, BOOL bUseDirEntry ); /* determine the size of a file */ +extern HB_EXPORT FHANDLE hb_fsExtOpen ( BYTE * pszFileName, BYTE * pDefExt, + USHORT uiFlags, BYTE * pPaths, PHB_ITEM pError ); /* open a file using default extension and a list of paths */ +extern HB_EXPORT USHORT hb_fsIsDrv ( BYTE nDrive ); /* determine if a drive number is a valid drive */ +extern HB_EXPORT BOOL hb_fsIsDevice ( FHANDLE hFileHandle ); /* determine if a file is attached to a device (console?) */ +extern HB_EXPORT BOOL hb_fsLock ( FHANDLE hFileHandle, ULONG ulStart, ULONG ulLength, USHORT uiMode ); /* request a lock on a portion of a file */ +extern HB_EXPORT BOOL hb_fsLockLarge ( FHANDLE hFileHandle, HB_FOFFSET ulStart, + HB_FOFFSET ulLength, USHORT uiMode ); /* request a lock on a portion of a file using 64bit API */ +extern HB_EXPORT BOOL hb_fsMkDir ( BYTE * pszDirName ); /* create a directory */ +extern HB_EXPORT FHANDLE hb_fsOpen ( BYTE * pszFileName, USHORT uiFlags ); /* open a file */ +extern HB_EXPORT USHORT hb_fsRead ( FHANDLE hFileHandle, BYTE * pBuff, USHORT ulCount ); /* read contents of a file into a buffer (<=64K) */ +extern HB_EXPORT ULONG hb_fsReadLarge ( FHANDLE hFileHandle, BYTE * pBuff, ULONG ulCount ); /* read contents of a file into a buffer (>64K) */ +extern HB_EXPORT BOOL hb_fsRmDir ( BYTE * pszDirName ); /* remove a directory */ +extern HB_EXPORT BOOL hb_fsRename ( BYTE * pszOldName, BYTE * pszNewName ); /* rename a file */ +extern HB_EXPORT ULONG hb_fsSeek ( FHANDLE hFileHandle, LONG lOffset, USHORT uiMode ); /* reposition an open file */ +extern HB_EXPORT HB_FOFFSET hb_fsSeekLarge ( FHANDLE hFileHandle, HB_FOFFSET llOffset, USHORT uiFlags ); /* reposition an open file using 64bit API */ +extern HB_EXPORT ULONG hb_fsTell ( FHANDLE hFileHandle ); /* retrieve the current position of a file */ +extern HB_EXPORT BOOL hb_fsSetDevMode ( FHANDLE hFileHandle, USHORT uiDevMode ); /* change the device mode of a file (text/binary) */ +extern HB_EXPORT BOOL hb_fsGetFileTime( BYTE * pszFileName, LONG * plJulian, LONG * plMillisec ); /* TODO */ +extern HB_EXPORT BOOL hb_fsSetFileTime( BYTE * pszFileName, LONG lJulian, LONG lMillisec ); +extern HB_EXPORT BOOL hb_fsGetAttr ( BYTE * pszFileName, ULONG * pulAttr ); /* TODO */ +extern HB_EXPORT BOOL hb_fsSetAttr ( BYTE * pszFileName, ULONG ulAttr ); +extern HB_EXPORT void hb_fsSetError ( USHORT uiError ); /* set the file system DOS error number */ +extern HB_EXPORT void hb_fsSetIOError ( BOOL fResult, USHORT uiOperation ); /* set the file system error number after IO operation */ +extern HB_EXPORT USHORT hb_fsWrite ( FHANDLE hFileHandle, const BYTE * pBuff, USHORT ulCount ); /* write to an open file from a buffer (<=64K) */ +extern HB_EXPORT ULONG hb_fsWriteLarge ( FHANDLE hFileHandle, const BYTE * pBuff, ULONG ulCount ); /* write to an open file from a buffer (>64K) */ +extern HB_EXPORT FHANDLE hb_fsPOpen ( BYTE * pFilename, BYTE * pMode ); +extern HB_EXPORT FHANDLE hb_fsGetOsHandle( FHANDLE hFileHandle ); +extern HB_EXPORT USHORT hb_fsGetFError ( void ); /* get FERROR() flag */ +extern HB_EXPORT void hb_fsSetFError ( USHORT uiError ); /* set FERROR() flag */ +extern HB_EXPORT BOOL hb_fsFileExists ( const char * pszFileName ); /* check if a file exists (wildcard chars not accepted). */ +extern HB_EXPORT BOOL hb_fsDirExists ( const char * pszDirName ); /* check if a directory exists (wildcard chars not accepted). */ #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 ) @@ -280,7 +282,7 @@ extern ULONG hb_fsAttrEncode( const char * szAttr ); extern char * hb_fsAttrDecode( ULONG ulAttr, char * szAttr ); extern HB_EXPORT BYTE * hb_fsNameConv( BYTE * szFileName, BOOL * pfFree ); extern HB_EXPORT BYTE * hb_fileNameConv( char *str ); -extern HB_EXPORT BOOL hb_fsMaxFilesError( void ); +extern HB_EXPORT BOOL hb_fsMaxFilesError( void ); /* wrapper to fopen() which calls hb_fsNameConv() */ extern FILE * hb_fopen( const char *path, const char *mode ); diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index 4113b161a8..bb6b2f3e5d 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -890,6 +890,31 @@ HB_EXPORT BOOL hb_fsSetDevMode( FHANDLE hFileHandle, USHORT uiDevMode ) #endif } +HB_EXPORT BOOL hb_fsGetFileTime( BYTE * pszFileName, LONG * plJulian, LONG * plMillisec ) +{ + HB_TRACE(HB_TR_DEBUG, ("hb_fsGetFileTime(%s, %p, %p)", pszFileName, plJulian, plMillisec)); + + /* TODO */ + + HB_SYMBOL_UNUSED( pszFileName ); + HB_SYMBOL_UNUSED( plJulian ); + HB_SYMBOL_UNUSED( plMillisec ); + + return FALSE; +} + +HB_EXPORT BOOL hb_fsGetAttr( BYTE * pszFileName, ULONG * pulAttr ) +{ + HB_TRACE(HB_TR_DEBUG, ("hb_fsGetAttr(%s, %p)", pszFileName, pulAttr)); + + /* TODO */ + + HB_SYMBOL_UNUSED( pszFileName ); + HB_SYMBOL_UNUSED( pulAttr ); + + return FALSE; +} + HB_EXPORT BOOL hb_fsSetFileTime( BYTE * pszFileName, LONG lJulian, LONG lMillisec ) { BOOL fResult;