⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _blkdev.h

📁 DOC文件系统驱动源代码
💻 H
📖 第 1 页 / 共 5 页
字号:
/* Sets the current position in the file, relative to file start, end or*/
/* current position.                                                    */
/* Note: This function will not move the file pointer beyond the        */
/* beginning or end of file, so the actual file position may be         */
/* different from the required. The actual position is indicated on     */
/* return.                                                              */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle  : File handle to close.                             */
/*        irLength  : Offset to set position.                           */
/*        irFlags   : Method code                                       */
/*                     SEEK_START: absolute offset from start of file   */
/*                     SEEK_CURR:  signed offset from current position  */
/*                     SEEK_END:   signed offset from end of file       */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success, otherwise failed              */
/*        irLength        : Actual absolute offset from start of file   */
/*----------------------------------------------------------------------*/

/* Values of irFlags for flSeekFile: */

#define   SEEK_START   0        /* offset from start of file    */
#define   SEEK_CURR    1        /* offset from current position */
#define   SEEK_END     2        /* offset from end of file      */


#define flSeekFile(ioreq)        bdCall(FL_SEEK_FILE,ioreq)

/*----------------------------------------------------------------------*/
/*                          f l F i n d F i l e                         */
/*                                                                      */
/* Finds a file entry in a directory, optionally modifying the file     */
/* time/date and/or attributes.                                         */
/* Files may be found by handle no. provided they are open, or by name. */
/* Only the Hidden, System or Read-only attributes may be modified.     */
/* Entries may be found for any existing file or directory other than   */
/* the root. A DirectoryEntry structure describing the file is copied   */
/* to a user buffer.                                                    */
/*                                                                      */
/* The DirectoryEntry structure is defined in dosformt.h                */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle     : If by name: Drive number (socket+partitions)   */
/*                       else      : Handle of open file                */
/*        irPath       : If by name: Specifies a file or directory path */
/*        irFlags      : Options flags                                  */
/*                        FIND_BY_HANDLE: Find open file by handle.     */
/*                                        Default is access by path.    */
/*                        SET_DATETIME:   Update time/date from buffer  */
/*                        SET_ATTRIBUTES: Update attributes from buffer */
/*        irDirEntry   : Address of user buffer to receive a            */
/*                       DirectoryEntry structure                       */
/*                                                                      */
/* Returns:                                                             */
/*        irLength        : Modified                                    */
/*        FLStatus        : 0 on success, otherwise failed              */
/*----------------------------------------------------------------------*/

/** Bit assignment of irFlags for flFindFile: */

#define SET_DATETIME     1   /* Change date/time                        */
#define SET_ATTRIBUTES   2   /* Change attributes                       */
#define FIND_BY_HANDLE   4   /* Find file by handle rather than by name */

#define        flFindFile(ioreq)        bdCall(FL_FIND_FILE,ioreq)


/*----------------------------------------------------------------------*/
/*                 f l F i n d F i r s t F i l e                        */
/*                                                                      */
/* Finds the first file entry in a directory.                           */
/* This function is used in combination with the flFindNextFile call,   */
/* which returns the remaining file entries in a directory sequentially.*/
/* Entries are returned according to the unsorted directory order.      */
/* flFindFirstFile creates a file handle, which is returned by it. Calls*/
/* to flFindNextFile will provide this file handle. When flFindNextFile */
/* returns 'noMoreEntries', the file handle is automatically closed.    */
/* Alternatively the file handle can be closed by a 'closeFile' call    */
/* before actually reaching the end of directory.                       */
/* A DirectoryEntry structure is copied to the user buffer describing   */
/* each file found. This structure is defined in dosformt.h.            */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle      : Drive number (0, 1, ...)                      */
/*                        bits 7-4 - Partition # (zero based)           */
/*                        bits 3-0 - Socket # (zero based)              */ 
/*        irPath         : Specifies a directory path                   */
/*        irData         : Address of user buffer to receive a          */
/*                         DirectoryEntry structure                     */
/*                                                                      */
/* Returns:                                                             */
/*        irHandle       : File handle to use for subsequent operations */
/*        FLStatus       : 0 on success, otherwise failed               */
/*----------------------------------------------------------------------*/

#define        flFindFirstFile(ioreq)        bdCall(FL_FIND_FIRST_FILE,ioreq)


/*----------------------------------------------------------------------*/
/*                 f l F i n d N e x t F i l e                          */
/*                                                                      */
/* See the description of 'flFindFirstFile'.                            */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle        : File handle returned by flFindFirstFile.    */
/*        irData          : Address of user buffer to receive a         */
/*                          DirectoryEntry structure                    */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success, otherwise failed              */
/*----------------------------------------------------------------------*/

#define        flFindNextFile(ioreq)        bdCall(FL_FIND_NEXT_FILE,ioreq)

/*----------------------------------------------------------------------*/
/*                      f l G e t D i s k I n f o                       */
/*                                                                      */
/* Returns general allocation information.                              */
/*                                                                      */
/* The bytes/sector, sector/cluster, total cluster and free cluster     */
/* information are returned into a DiskInfo structure.                  */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle        : Drive number (0, 1, ...)                    */
/*                        bits 7-4 - Partition # (zero based)           */
/*                        bits 3-0 - Socket # (zero based)              */ 
/*        irData          : Address of DiskInfo structure               */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success, otherwise failed              */
/*----------------------------------------------------------------------*/

typedef struct {
  unsigned        bytesPerSector;
  unsigned        sectorsPerCluster;
  unsigned        totalClusters;
  unsigned        freeClusters;
} DiskInfo;

#define flGetDiskInfo(ioreq)        bdCall(FL_GET_DISK_INFO,ioreq)

#ifndef FL_READ_ONLY
/*----------------------------------------------------------------------*/
/*                      f l D e l e t e F i l e                         */
/*                                                                      */
/* Deletes a file.                                                      */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle        : Drive number (0, 1, ...)                    */
/*                        bits 7-4 - Partition # (zero based)           */
/*                        bits 3-0 - Socket # (zero based)              */ 
/*        irPath          : path of file to delete                      */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success, otherwise failed              */
/*----------------------------------------------------------------------*/

#define flDeleteFile(ioreq)        bdCall(FL_DELETE_FILE,ioreq)

#ifdef RENAME_FILE

/*----------------------------------------------------------------------*/
/*                      f l R e n a m e F i l e                         */
/*                                                                      */
/* Renames a file to another name.                                      */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle        : Drive number (0, 1, ...)                    */
/*                        bits 7-4 - Partition # (zero based)           */
/*                        bits 3-0 - Socket # (zero based)              */ 
/*        irPath          : path of existing file                       */
/*        irData          : path of new name.                           */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success, otherwise failed              */
/*----------------------------------------------------------------------*/

#define flRenameFile(ioreq)        bdCall(FL_RENAME_FILE,ioreq)

#endif /* RENAME_FILE */

#ifdef SUB_DIRECTORY

/*----------------------------------------------------------------------*/
/*                      f l M a k e D i r                               */
/*                                                                      */
/* Creates a new directory.                                             */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle        : Drive number (0, 1, ...)                    */
/*                        bits 7-4 - Partition # (zero based)           */
/*                        bits 3-0 - Socket # (zero based)              */ 
/*        irPath          : path of new directory.                      */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success, otherwise failed              */
/*----------------------------------------------------------------------*/

#define flMakeDir(ioreq)        bdCall(FL_MAKE_DIR,ioreq)

/*----------------------------------------------------------------------*/
/*                      f l R e m o v e D i r                           */
/*                                                                      */
/* Removes an empty directory.                                          */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle        : Drive number (0, 1, ...)                    */
/*                        bits 7-4 - Partition # (zero based)           */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -