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

📄 fs22remove.c

📁 我今天开始上传5份TI、NXP、MTK的手机开发全套资料。希望对大家有很大的帮助
💻 C
字号:
#ifdef FSS_FTR#define ACCESS_RIGHTS_INTERNAL_FS#define FS22REMOVE_C#undef  FILE_NUMBER#define FILE_NUMBER 22 #include "Fs.h"#undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 1void Fs22_01Remove ( void * pp_Param ){   t_fsEntityStruct * pl_FsEntityPtr = NIL;	/* Pointer on entity's CB */   fsPath * pl_RestOfPath;   /* Point in the path after the volume name or if the current path is				available pointer on it */   t_ObjectInfo sl_Info;      /* Information on an object given from LL */   t_fsVolStruct * pl_Volume;   t_FsCmdRemove * pl_Param = ( t_FsCmdRemove * ) pp_Param;    /* Get entity's context pointer if current path used ( file path begin not with slatch ) */    if ( *pl_Param->p_FileName != '/' )    	pl_FsEntityPtr = MC_FS_ED_GET_ENTITY_PTR( MC_FS_KERNEL_ID(pl_Param) );    /* Get volume of object */    pl_Volume =  MC_FS_CO_GIVE_VOLUME_FROM_PATH( pl_FsEntityPtr, (ascii*)pl_Param->p_FileName, 						&pl_RestOfPath, &sl_Info, 						&MC_FS_STATUS(pl_Param));    /* If no volume return ( status was update by function ) */    if ( pl_Volume == NIL ) return;    /* If rest of path empty  no file name can be present -> err no entry */     if ( pl_RestOfPath == NIL )    { 	MC_FS_STATUS(pl_Param) = FS_ENOENT;	return;    }    /* Set the interlayer table pointer */    MC_FS_LL_SET_NEW_VOL(pl_Volume);     /* Take info on object ( dir exist, object exist, ...) at low layers */    MC_FS_LL_GET_OBJECT_INFO (&sl_Info, pl_RestOfPath, &MC_FS_STATUS(pl_Param));    /* If an error in info get return */    if ( MC_FS_STATUS(pl_Param) != FS_OK )    {	if ( MC_FS_STATUS(pl_Param) == FSS_ERR_MEMORY_CORRUPTED )	    /* Make delete the file from FM: when the error FSS_ERR_MEMORY_CORRUPTED occurs, a directory	       updating has to be done */	    MC_FS_LL_REMOVE_FILE( &sl_Info, &MC_FS_STATUS(pl_Param) );	return;    }    /* This file exist ? */    if ( sl_Info.s_FileStatus.v_ObjExist )    {  	/* Verify if object is a file */        if ( sl_Info.s_FileStatus.v_ObjIsFile == FALSE )	{	    /* Object is not a file but a directory error */	    MC_FS_STATUS(pl_Param) = FS_EISDIR;	    return;	}    }    else    {   	/* No object exist return no entry */ 	MC_FS_STATUS(pl_Param) = FS_ENOENT;	return;    }    /* Verify if file to delete is not now open from an entity */    {       t_FileMode s_AlreadyOpenMode;	*((u32*)(&s_AlreadyOpenMode)) = 0;       /* The file exist this file can already been open.	   if is is already open in write mode no other open is possible	   if it has been open in read mode no other open in write mode is possible	   than no other open is possible       */        MC_FS_CO_CHECK_FILE_ALREADY_OPEN_MODE ( pl_Volume, & sl_Info , &s_AlreadyOpenMode);         /* If file is open in read or write mode it is open, it is not possible to			delete the file */        if ( ( s_AlreadyOpenMode.v_WriteEnabled ) || ( s_AlreadyOpenMode.v_ReadEnabled ) )	{	    /* File is used return error */	    MC_FS_STATUS(pl_Param) = FS_EBUSY;	    return;	}    }    /* Make delete the file from FM */    MC_FS_LL_REMOVE_FILE( &sl_Info, &MC_FS_STATUS(pl_Param) );}#undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 2u32 Fs22_02ProcessRemove( u8 vp_Behavior, const fsPath * pp_FileName){   /* Reserve message space */   t_FsCmdRemove * pl_Remove = ( t_FsCmdRemove * ) MC_FS_GET_MEMORY(sizeof(t_FsCmdRemove));    /* Fill message with input parameters */    pl_Remove->p_FileName = pp_FileName;    /* Send message by setting operation and return command identifier */    return( MC_FS_MA_SEND_CMD_MSG_TO_FS(vp_Behavior, (void*)pl_Remove, FS_CMD_REMOVE_REQ));}#endif /* FSS_FTR */

⌨️ 快捷键说明

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