📄 fs41clearallvolobj.c
字号:
#ifdef FSS_FTR#define ACCESS_RIGHTS_INTERNAL_FS#define FS41CLEARALLVOLOBJ_C#include "Fs.h"#undef FILE_NUMBER#define FILE_NUMBER 41 #undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 1/* Local prototype definition */void Fs41_03ClearAllObjOneVol( t_fsVolStruct * pp_Volume);#undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 1void Fs41_01ClearAllVolObj( void * pp_Param ){ t_fsVolStruct * pl_Volume; t_FssCmdGetVolInfo * pl_Param = (t_FssCmdGetVolInfo *) pp_Param; u32 i; /* If all volumes must be cleared loops to makes it */ if ( pl_Param->p_VolName == NIL ) { for ( i = 0;; i++ ) { pl_Volume = MC_FS_VD_GET_VOL(i); if ( pl_Volume != 0 ) Fs41_03ClearAllObjOneVol(pl_Volume); else break; } } else { /* Search if volume exist */ pl_Volume = MC_FS_VD_SEARCH_VOL_BY_NAME( (fsVolName *)pl_Param->p_VolName, FSS_NAME_MAX ); /* If volume do not exist return error */ if ( pl_Volume == NIL ) { /* Volume unknow -> error */ MC_FS_STATUS(pl_Param) = FS_ENXIO; return; } /* Clear volume */ Fs41_03ClearAllObjOneVol(pl_Volume); }}#undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 2u32 Fs41_02ProcessClearAllVolObj( u8 vp_Behaviour, const fsVolName * pp_VolName){ /* Reserve message space */ t_FssCmdClearAllVolObj * pl_ClearAllVolObj = (t_FssCmdClearAllVolObj*) MC_FS_GET_MEMORY(sizeof(t_FssCmdClearAllVolObj)); /* Fill message with input parameters */ pl_ClearAllVolObj->p_VolName = pp_VolName; /* Send message by setting operation and return command identifier */ return( MC_FS_MA_SEND_CMD_MSG_TO_FS(vp_Behaviour, (void*)pl_ClearAllVolObj, FS_CMD_CLEARALLVOLOBJ_REQ));}#undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 3void Fs41_03ClearAllObjOneVol( t_fsVolStruct * pp_Volume){ t_fsFILE * pl_Stream; t_fsDIR * pl_Dir; /* Set the interlayer table pointer on new volume */ MC_FS_LL_SET_NEW_VOL(pp_Volume); /* Scann all open files of volume, flush and close these */ while ( 1 ) { /* Point on first file of the list ( the Close of a Stream extracts the structure from the list -> We take allways the first object ) */ pl_Stream = MC_FS_VD_GET_FIRST_FILE( pp_Volume ); /* If list empty break */ if ( pl_Stream == (t_fsFILE *) NIL ) break; /* Flush stream */ Fs29_03FlushStream ( pl_Stream ); /* Close stream */ Fs21_03CloseStream ( pl_Stream ); } /* Scann all open directories of the volume and close these */ /* To implement in version which implement directories ( the Close of a dir extract the structure from the list -> We take allways the first object )*/ while ( 1 ) { /* Point on first file of the list */ pl_Dir = MC_FS_VD_GET_FIRST_DIR( pp_Volume ); /* If list empty break */ if ( pl_Dir == (t_fsDIR *) NIL ) break; /* Close stream */ Fs51_03CloseADir( pl_Dir );; } }#endif /* FSS_FTR */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -