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

📄 fs_efs.h

📁 嵌入式文件系统 ucfs.包含全部源代码
💻 H
字号:
/*
**********************************************************************
*                          Micrium, Inc.
*                      949 Crestview Circle
*                     Weston,  FL 33327-1848
*
*                            uC/FS
*
*             (c) Copyright 2001 - 2003, Micrium, Inc.
*                      All rights reserved.
*
***********************************************************************

----------------------------------------------------------------------
File        : fs_efs.h
Purpose     : EFS File System Layer header
---------------------------END-OF-HEADER------------------------------
*/

#ifndef _FS_EFS_H_
#define _FS_EFS_H_

#if defined(__cplusplus)
extern "C" {     /* Make sure we have C-declarations in C++ programs */
#endif

#include "fs_int.h"

/*********************************************************************
*
*             #define constants
*
**********************************************************************
*/

#define FS_EFS_ATTR_READ_ONLY    FS_ATTR_READ_ONLY       
#define FS_EFS_ATTR_HIDDEN       FS_ATTR_HIDDEN          
#define FS_EFS_ATTR_SYSTEM       FS_ATTR_SYSTEM          
#define FS_EFS_VOLUME_ID         FS_ATTR_VOLUME_ID       
#define FS_EFS_ATTR_ARCHIVE      FS_ATTR_ARCHIVE         
#define FS_EFS_ATTR_DIRECTORY    FS_ATTR_DIRECTORY       

/*********************************************************************
*
*             Global data types
*
**********************************************************************
*/



/*********************************************************************
*
*             Global function prototypes
*
**********************************************************************
*/

/*********************************************************************
*
*             EFS_misc
*/
int         FS_EFS_CheckUnit           (FS_VOLUME * pVolume);
FS_U32      FS_EFS_CalcDirSector       (FS_VOLUME * pVolume, FS_U32 DirStart, FS_U32 DirSec);
FS_U32      FS_EFS_CalcDirSectorByIndex(FS_VOLUME * pVolume, FS_U32 FirstCluster, FS_U32 DirEntryIndex);
FS_U32      FS_EFS_ClusterId2SectorNo  (FS_EFS_INFO* pEFSInfo, FS_U32 ClusterId);
FS_U32      FS_EFS_FindDir             (FS_VOLUME * pVolume, char *pDirName, FS_U32 DirStart, FS_U32 DirSize);
FS_U32      FS_EFS_FindFreeCluster     (FS_VOLUME * pVolume, FS_SB * pSB, FS_U32 FirstCluster);

/*********************************************************************
*
*             EFS_in
*/

FS_U32   FS_EFS_Read    (FS_FILE *pFile, void  *pData, FS_U32 NumBytes);
FS_U32   FS_EFS_ReadData(FS_FILE *pFile, FS_U8 *pData, FS_U32 NumBytesReq, FS_SB * pSB);


/*********************************************************************
*
*             EFS_out
*/
FS_SIZE_T   FS_EFS_Write    (FS_FILE *pFile, const void  * pData, FS_U32 NumBytes);
FS_U32      FS_EFS_WriteData(FS_FILE *pFile, const FS_U8 * pData, FS_U32 NumBytes2Write, FS_SB * pSB);
void        FS_EFS_Close    (FS_FILE *pFile);


/*********************************************************************
*
*             EFS_open
*/
char            FS_EFS_FOpen                (const char *pFileName, FS_FILE *pFile, char DoDel, char DoOpen, char DoCreate);
char            FS_EFS_FindPath             (FS_VOLUME * pVolume, FS_SB * pSB,  const char *pFullName, const char * *ppFileName, FS_FILE *pDirFile);
char            FS_EFS_DeleteFileOrDir      (FS_FILE  * pDirFile, FS_SB * pSB, FS_U8 IsFile);
char            FS_EFS_FindDirEntry         (FS_FILE  * pDirFile, FS_SB * pSB, const char *pEntryName, int NameLen);
char            FS_EFS_WriteDirEntry        (FS_FILE  * pDirFile, FS_SB * pSB, const char * pFileName, unsigned EntryLen, FS_U16 Time, FS_U16 Date, FS_U32 Size, FS_U32 ClusterId, FS_U8 Attrib);
FS_U8           FS_EFS_ReadDirEntry         (FS_FILE * pDirFile, FS_SB * pSB, FS_U8 * pBuffer);
char            FS_EFS_FindEmptyDirEntry    (FS_FILE * pDirFile,  FS_SB* pSB, unsigned * pEntryLen);
void            FS_EFS_MarkDirEntryAsInvalid(FS_FILE * pDirFile, FS_SB  * pSB);


/*********************************************************************
*
*             EFS_ioctl
*/
int      FS_EFS_Ioctl(FS_VOLUME * pVolume, FS_I32 Cmd, FS_I32 Aux, void *pBuffer);


/*********************************************************************
*
*             EFS_dir
*/

#if FS_POSIX_DIR_SUPPORT
  FS_DIR             *FS_EFS_OpenDir  (const char *pDirName, FS_DIR *pDir);
  int                 FS_EFS_CloseDir (FS_DIR *pDir);
  FS_DIRENT          *FS_EFS_ReadDir  (FS_DIR *pDir);
  int                 FS_EFS_RemoveDir(FS_VOLUME * pVolume, const char *pDirName);
  int                 FS_EFS_CreateDir(FS_VOLUME * pVolume, const char *pDirName);
#endif /* FS_POSIX_DIR_SUPPORT */

/*********************************************************************
*
*             EFS_Rename
*/
int FS_EFS_Rename(const char * sOldName, const char * sNewName, FS_VOLUME * pVolume);

/*********************************************************************
*
*             EFS_Move
*/
int FS_EFS_Move(const char * sOldName, const char * sNewName, FS_VOLUME * pVolume);

/*********************************************************************
*
*       EFS_DirEntry
*
*/
int FS_EFS_SetDirEntryInfo(FS_VOLUME * pVolume, const char * sName, const void * p, int Mask);
int FS_EFS_GetDirEntryInfo(FS_VOLUME * pVolume, const char * sName,       void * p, int Mask);


#if defined(__cplusplus)
}                /* Make sure we have C-declarations in C++ programs */
#endif

#endif  /* _FS_EFS_H_ */

/*************************** End of file ****************************/

⌨️ 快捷键说明

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