home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / harbb30g.zip / INCLUDE / filesys.h < prev    next >
C/C++ Source or Header  |  1999-09-15  |  5KB  |  104 lines

  1. /*
  2.  * $Id: filesys.h,v 1.23 1999/09/15 14:03:36 vszel Exp $
  3.  */
  4.  
  5. /*
  6.  * Harbour Project source code:
  7.  * Header file for the Filesys API
  8.  *
  9.  * Copyright 1999 David G. Holm <dholm@jsd-llc.com>
  10.  * www - http://www.harbour-project.org
  11.  *
  12.  * This program is free software; you can redistribute it and/or modify
  13.  * it under the terms of the GNU General Public License as published by
  14.  * the Free Software Foundation; either version 2 of the License, or
  15.  * (at your option) any later version, with one exception:
  16.  *
  17.  * The exception is that if you link the Harbour Runtime Library (HRL)
  18.  * and/or the Harbour Virtual Machine (HVM) with other files to produce
  19.  * an executable, this does not by itself cause the resulting executable
  20.  * to be covered by the GNU General Public License. Your use of that
  21.  * executable is in no way restricted on account of linking the HRL
  22.  * and/or HVM code into it.
  23.  *
  24.  * This program is distributed in the hope that it will be useful,
  25.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  27.  * GNU General Public License for more details.
  28.  *
  29.  * You should have received a copy of the GNU General Public License
  30.  * along with this program; if not, write to the Free Software
  31.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit
  32.  * their web site at http://www.gnu.org/).
  33.  *
  34.  */
  35.  
  36. /*
  37.  * ChangeLog:
  38.  *
  39.  * V 1.22   David G. Holm               Added FS_ERROR.
  40.  * V 1.21   David G. Holm               Added hb_fsFile().
  41.  * V 1.7    Victor Szel                 #include <x> changed to #include "x".
  42.  * V 1.6    David G. Holm               Added my email address.
  43.  * V 1.5    David G. Holm               Added copyright and license header,
  44.  *                                      along with a complete version history.
  45.  * V 1.4    Victor Szel                 Undocumented change.
  46.  * V 1.3    Gonzalo A. Diethelm         Ensured that all Harbour functions
  47.  *                                      are declared as HB_FUNCTION( void );
  48.  * V 1.2    David G. Holm               Corrected RCS Id keyword.
  49.  * V 1.1    David G. Holm               Committed to CVS.
  50.  * V 1.0    David G. Holm               Initial version.
  51.  *
  52.  */
  53.  
  54. #ifndef HB_FILESYS_H_
  55. #define HB_FILESYS_H_
  56.  
  57. #include "extend.h"
  58. #include "fileio.ch"
  59.  
  60. #define FS_ERROR F_ERROR
  61.  
  62. typedef int    FHANDLE;
  63.  
  64. /* Filename support */
  65. typedef struct
  66. {
  67.   char   szBuffer[ _POSIX_PATH_MAX + 3 ];
  68.   char * szPath;
  69.   char * szName;
  70.   char * szExtension;
  71. } HB_FNAME, * PHB_FNAME, * HB_FNAME_PTR;
  72.  
  73. extern BOOL     hb_fsChDir      ( BYTE * pDirName );
  74. extern USHORT   hb_fsChDrv      ( BYTE nDrive );
  75. extern void     hb_fsClose      ( FHANDLE hFileHandle );
  76. extern void     hb_fsCommit     ( FHANDLE hFileHandle );
  77. extern FHANDLE  hb_fsCreate     ( BYTE * pFilename, USHORT uiAttribute );
  78. extern BYTE *   hb_fsCurDir     ( USHORT uiDrive );
  79. extern BYTE     hb_fsCurDrv     ( void );
  80. extern int      hb_fsDelete     ( BYTE * pFilename );
  81. extern USHORT   hb_fsError      ( void );
  82. extern BOOL     hb_fsFile       ( BYTE * pFilename );
  83. extern FHANDLE  hb_fsExtOpen    ( BYTE * pFilename, BYTE * pDefExt,
  84.                                   USHORT uiFlags, BYTE * pPaths, PHB_ITEM pError );
  85. extern USHORT   hb_fsIsDrv      ( BYTE nDrive );
  86. extern BOOL     hb_fsLock       ( FHANDLE hFileHandle, ULONG ulStart,
  87.                                   ULONG ulLength, USHORT uiMode );
  88. extern BOOL     hb_fsMkDir      ( BYTE * pDirName );
  89. extern FHANDLE  hb_fsOpen       ( BYTE * pFilename, USHORT uiFlags );
  90. extern USHORT   hb_fsRead       ( FHANDLE hFileHandle, BYTE * pBuff, USHORT ulCount );
  91. extern ULONG    hb_fsReadLarge  ( FHANDLE hFileHandle, BYTE * pBuff, ULONG ulCount );
  92. extern BOOL     hb_fsRmDir      ( BYTE * pDirName );
  93. extern int      hb_fsRename     ( BYTE * pOldName, BYTE * pNewName );
  94. extern ULONG    hb_fsSeek       ( FHANDLE hFileHandle, LONG lOffset, USHORT uiMode );
  95. extern void     hb_fsSetDevMode ( FHANDLE hFileHandle, USHORT uiDevMode );
  96. extern void     hb_fsSetError   ( USHORT uiError );
  97. extern USHORT   hb_fsWrite      ( FHANDLE hFileHandle, BYTE * pBuff, USHORT ulCount );
  98. extern ULONG    hb_fsWriteLarge ( FHANDLE hFileHandle, BYTE * pBuff, ULONG ulCount );
  99.  
  100. extern PHB_FNAME hb_fsFNameSplit ( char * szFilename ); /* Split given filename into path, name and extension */
  101. extern char *    hb_fsFNameMerge ( char * szFileName, PHB_FNAME pFileName ); /* This function joins path, name and extension into a string with a filename */
  102.  
  103. #endif /* HB_FILESYS_H_ */
  104.