📄 fs48chdir.c
字号:
#ifdef FSS_FTR#define ACCESS_RIGHTS_INTERNAL_FS#define FS48CHDIR_C#include "Fs.h"#undef FILE_NUMBER#define FILE_NUMBER 48 #undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 1void Fs48_01ChDir( void * pp_Param ){ t_EntityPathInfo s_EntityPathInfo; t_FsCmdChDir * pl_Param = (t_FsCmdChDir *) pp_Param; 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; t_fsEntityStruct * pl_FsEntityPtr; /* Pointer on entity's CB */ t_fsVolStruct * pl_Volume; s32 vl_Status = FS_OK; /* Get entity's context pointer */ pl_FsEntityPtr = MC_FS_ED_GET_ENTITY_PTR( MC_FS_KERNEL_ID(pl_Param) ); /* If the path is not absolute -> error */ if ( *((fssPath *)pl_Param->p_Path) != '/' ) { MC_FS_STATUS(pl_Param) = FS_EINVAL; return; } /* Get volume of object */ pl_Volume = MC_FS_CO_GIVE_VOLUME_FROM_PATH ( pl_FsEntityPtr, (fssPath *)pl_Param->p_Path, &pl_RestOfPath, &sl_Info, &vl_Status); /* Is a volume present ? */ if ( pl_Volume == NIL ) { /* No but the path is equal to "/" then it is OK else error */ if ( *(((fssPath *)pl_Param->p_Path+1)) != '\0' ) { MC_FS_STATUS(pl_Param) = vl_Status; return; } } else { /* 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 ) return; /* Verify that the object exist and is a directory else -> err */ if ( sl_Info.s_FileStatus.v_ObjExist == FALSE ) { /* Updates status in interface structure and return */ MC_FS_STATUS(pl_Param) = FS_ENOENT; return; } if ( sl_Info.s_FileStatus.v_ObjIsFile ) { /* Object is a file and not a directory error */ MC_FS_STATUS(pl_Param) = FS_ENOTDIR; return; } } /* Fill structure of path info and memorize it */ s_EntityPathInfo.p_Path = (fssPath*)pl_Param->p_Path; s_EntityPathInfo.p_CurrVolume = pl_Volume; s_EntityPathInfo.v_PathLenght = strlen(pl_Param->p_Path); s_EntityPathInfo.v_CurrentDirIDLevelN = sl_Info.v_ObjID; s_EntityPathInfo.v_CurrentDirIDLevelN_1 = sl_Info.v_DirID; s_EntityPathInfo.v_DirLevelNExist = sl_Info.s_FileStatus.v_ObjExist; s_EntityPathInfo.v_DirLevelN_1Exist = sl_Info.s_FileStatus.v_DirExist ; MC_FS_ED_MEMO_PATH( pl_FsEntityPtr, pp_Path , &s_EntityPathInfo);}#undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 2u32 Fs48_02ProcessChDir( u8 vp_Behaviour, const fsPath * pp_Path ){ /* Reserve message space */ t_FsCmdChDir * pl_ChDir = ( t_FsCmdChDir *) MC_FS_GET_MEMORY(sizeof(t_FsCmdChDir)); /* Fill message with input parameters */ pl_ChDir->p_Path = pp_Path; /* Send message by setting operation and return command identifier */ return( MC_FS_MA_SEND_CMD_MSG_TO_FS(vp_Behaviour, (void*)pl_ChDir,FS_CMD_CHDIR_REQ));}#endif /* FSS_FTR */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -