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

📄 efs_intern.h

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

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

#ifndef EFS_INTERN_H
#define EFS_INTERN_H

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

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

#define EFS_VERSION   0x100
#define EFS_SIGNATURE 0x00534645      /* "EFS" */

#define EFS_MAX_DIR_ENTRY_SIZE 255
#define EFS_FIRST_CLUSTER        1    /* Can be changed, but should not be 0 */

#define EFS_ALLOC_VALUE_FREE     0
#define EFS_ALLOC_VALUE_USED     1


/*********************************************************************
*
*       EFS_SECTOR_...
*
*/
#define EFS_SECTOR_INFO        0    /* Info sector */
#define EFS_SECTOR_STATUS      1    /* Status sector */
#define EFS_SECTOR_ALLOC_MAP   2    /* Start sector of allocation map */

/*********************************************************************
*
*       DIR_ENTRY_OFF_...
*
*  Purpose
*    Defines the position of the individual elements in a directory entry
*/
#define DIR_ENTRY_OFF_OFFNEXT        0x00
#define DIR_ENTRY_OFF_ISVALID        0x01
#define DIR_ENTRY_OFF_ATTRIB         0x02
#define DIR_ENTRY_OFF_NAMELEN        0x03
#define DIR_ENTRY_OFF_FIRSTCLUSTER   0x04
#define DIR_ENTRY_OFF_SIZELO         0x08
#define DIR_ENTRY_OFF_SIZEHI         0x0C
#define DIR_ENTRY_OFF_TIMESTAMP      0x10
#define DIR_ENTRY_OFF_NAME           0x14

#define DIR_ENTRY_FIXED_SIZE         0x14       /* For total size of entry, add len of file name */


/*********************************************************************
*
*       INFO_OFF_...
*
*  Purpose
*    Defines the position of the individual elements in the info sector
*/
#define INFO_OFF_SIGNATURE             0x0
#define INFO_OFF_VERSION               0x4
#define INFO_OFF_LD_BPS                0x6          /* ld Bytes per sector */
#define INFO_OFF_NUM_SECTORS           0x8
#define INFO_OFF_NUM_CLUSTERS          0xc
#define INFO_OFF_FIRST_DATA_SECTOR     0x10
#define INFO_OFF_LD_SPC                0x14         /* ld Sectors per cluster */


/*********************************************************************
*
*       ALLOC_NODE_OFF_...
*
*  Purpose
*    Defines the position of the individual elements in the alloc node
*/
#define ALLOC_NODE_OFF_SIZE           0x0
#define ALLOC_NODE_OFF_NEXT_CLUSTER   0x4
#define SIZEOF_ALLOC_NODE             0x8


/*********************************************************************
*
*       DIR_...
*
*/
#define DIR_MAX_SIZE                 0x7FFFFFFF


/*********************************************************************
*
*             EFS_misc
*/
FS_U32 FS_EFS_AllocClusterBlock(FS_VOLUME   * pVolume, FS_U32 NumBytes2Write, FS_U32 * pFirstNewCluster, FS_U32 StartCluster, FS_SB * pSB);
char   FS_EFS_ClusterIsFree    (FS_EFS_INFO * pEFSInfo, FS_U32 Cluster, FS_SB * pSB);
void   FS_EFS_MarkAsFree       (FS_VOLUME   * pVolume,  FS_U32 Cluster, FS_SB * pSB);
void   FS_EFS_MarkAsUsed       (FS_VOLUME   * pVolume,  FS_U32 Cluster, FS_SB * pSB);
char   FS_EFS_OpenDirFile      (FS_FILE * pDirFile, FS_VOLUME * pVolume, FS_SB * pSB, FS_U32 DirStart);
void   FS_EFS_WriteAllocNode   (FS_U8 * pBuffer, FS_U32 ClusterId, FS_U32 NumClusters);
int    FS_EFS_FindFileCluster  (FS_FILE *pFile, FS_SB * pSB);
char   FS_EFS_FindEmptyDirEntry(FS_FILE * pDirFile,  FS_SB* pSB, unsigned * pEntryLen);
void   FS__EFS_GetDirEntryInfo  (FS_FILE * pDirFile, FS_SB* pSB, FS_U32 * pFirstCluster, FS_U32 * pFileSize, FS_U8 * pAttributes, FS_U32 * pTimeStamp);



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

#endif  /* Avoid multiple inclusion */

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

⌨️ 快捷键说明

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