📄 fs82voldata.c
字号:
/* *//* Used procedures : *//* ------------------- *//* *//* *//*----------------------------------------------------------------------------*//*----------------------------------------------------------------------------*//* DESCRIPTION *//* *//* This function insert a new file in volume's open files list *//* *//*----------------------------------------------------------------------------*//***************************************************************************)P*//* #*/#undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 6void Fs82_06VDInsertFileInVol( t_fsVolStruct * pp_Vol, t_fsFILE * pp_File ){ register t_fsFILE * pl_FileList = ( t_fsFILE *) pp_Vol->p_FileList; /* Point on entity's file list */ /* If list not empty update previous pointer of object in top of queue */ /* If list is not empty previous pointer of element in top of queue is to pdate */ if ( pl_FileList != NIL ) pl_FileList->p_VolPrecPtr = pp_File; /* Next pointers is set to pointer on linked list value */ pp_File->p_VolNextPtr = pl_FileList; /* Like the insert is in top of file previous pointer is set to NIL */ pp_File->p_VolPrecPtr = NIL; /* Pointer in volume structure point on the file structure */ pp_Vol->p_FileList = pp_File; /* Update volume pointer in structure */ pp_File->p_VolOfFile = pp_Vol;}/**//*P(***************************************************************************//* Procedure name : Fs82_07VDDeleteFileFromVol *//* Object : Delete a file from the opened file volume's opened files list *//*----------------------------------------------------------------------------*//* Input parameters : *//* ------------------- *//* t_fsVolStruct * pp_Vol : pointer on volume's control block *//* t_fsFILE * pp_File : Pointer on file structure *//* *//* *//* Output parameters : *//* ------------------- *//* *//* Used variables : *//* ------------------- *//* *//* *//* Used procedures : *//* ------------------- *//* *//* *//*----------------------------------------------------------------------------*//*----------------------------------------------------------------------------*//* DESCRIPTION *//* *//* This function insert a new file in volume's open files list *//* *//*----------------------------------------------------------------------------*//***************************************************************************)P*//* #*/#undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 7void Fs82_07VDDeleteFileFromVol( t_fsFILE * pp_File ){ t_fsVolStruct *pl_Volume = pp_File->p_VolOfFile; /* If object to delete in top of list updates list pointer else next pointer of previous object */ if ( pp_File-> p_VolPrecPtr == NIL ) pl_Volume->p_FileList = pp_File-> p_VolNextPtr; else pp_File-> p_VolPrecPtr->p_VolNextPtr = pp_File-> p_VolNextPtr; /* If object to delete not last of the queue updates previous pointer of next object */ if ( pp_File-> p_VolNextPtr != NIL ) pp_File->p_VolNextPtr->p_VolPrecPtr = pp_File->p_VolPrecPtr;}/**//*P(***************************************************************************//* Procedure name : Fs82_08EDInsertDirInVolume *//* Object : Insert a new directory in volume's opened directories *//*----------------------------------------------------------------------------*//* Input parameters : *//* ------------------- *//* t_fsVolStruct * pp_Vol : pointer on volume's control block *//* t_fsDIR * pp_Dir : Pointer on directory structure *//* *//* *//* Output parameters : *//* ------------------- *//* *//* Used variables : *//* ------------------- *//* *//* *//* Used procedures : *//* ------------------- *//* *//* *//*----------------------------------------------------------------------------*//*----------------------------------------------------------------------------*//* DESCRIPTION *//* *//* This function insert a new directory in volume's open directory list *//* *//*----------------------------------------------------------------------------*//***************************************************************************)P*//* #*/#undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 8void Fs82_08VDInsertDirInVol( t_fsVolStruct * pp_Vol, t_fsDIR * pp_Dir ){ register t_fsDIR * pl_DirList = (t_fsDIR *) pp_Vol->p_DirList; /* Point on volume's directory list */ /* If list not empty update previous pointer of object in top of queue */ /* If list is not empty previous pointer of element in top of queue is to pdate */ if ( pl_DirList != NIL ) pl_DirList->p_VolPrecPtr = pp_Dir; /* Next pointers is set to pointer on linked list value */ pp_Dir->p_VolNextPtr = pl_DirList; /* Like the insert is in top of file previous pointer is set to NIL */ pp_Dir->p_VolPrecPtr = NIL; /* pointer in volume structure point on the file structure */ pp_Vol->p_DirList = pp_Dir; /* Note volume pointer in dir structure */ pp_Dir->p_VolOfDir = pp_Vol;}/**//*P(***************************************************************************//* Procedure name : Fs82_09VDDeleteDirFromVol *//* Object : Delete a directory from the opened dir volume's opened dir list *//*----------------------------------------------------------------------------*//* Input parameters : *//* ------------------- *//* *//* t_fsVolStruct * pp_Vol : pointer on volume's control block *//* t_fsDIR * pp_Dir : Pointer on directory's structure *//* *//* *//* Output parameters : *//* ------------------- *//* *//* Used variables : *//* ------------------- *//* *//* *//* Used procedures : *//* ------------------- *//* *//* *//*----------------------------------------------------------------------------*//*----------------------------------------------------------------------------*//* DESCRIPTION *//* *//* This function insert a new directory in volume's open directory list *//* *//*----------------------------------------------------------------------------*//***************************************************************************)P*//* #*/#undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 9void Fs82_09VDDeleteDirFromVol( t_fsDIR * pp_Dir ){ t_fsVolStruct * pl_Volume = pp_Dir->p_VolOfDir; /* If object to delete in top of list updates list pointer else next pointer of previous object */ if ( pp_Dir-> p_VolPrecPtr == NIL ) pl_Volume->p_DirList = pp_Dir-> p_VolNextPtr; else pp_Dir-> p_VolPrecPtr->p_VolNextPtr = pp_Dir-> p_VolNextPtr; /* If object to delete not last of the queue updates previous pointer of next object */ if ( pp_Dir-> p_VolNextPtr != NIL ) pp_Dir->p_VolNextPtr->p_VolPrecPtr = pp_Dir->p_VolPrecPtr;}/**//*P(***************************************************************************//* Procedure name : Fs82_10VDGetVolume *//* Object : gets a volume structure pointer of a given index *//*----------------------------------------------------------------------------*//* Input parameters : *//* ------------------- *//* *//* u16 vp_Index : order of the volume *//* *//* *//* Output parameters : *//* ------------------- *//* t_fsVolStruct * : pointer on the volume's structure *//* *//* Used variables : *//* ------------------- *//* *//* *//* Used procedures : *//* ------------------- *//* *//* *//*----------------------------------------------------------------------------*//*----------------------------------------------------------------------------*//* DESCRIPTION *//* *//* Gets the volume structure in index passed in parameter *//* *//*----------------------------------------------------------------------------*//***************************************************************************)P*//* #*/#undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 10t_fsVolStruct * Fs82_10VDGetVolume( u16 vp_Index ){ t_fsVolStruct ** pl_VolumePtr = s_VolDataBaseStruct.p_VolTabIndexedByAlpha; /* If index greather than number of volumes mounted end of table reached return 0 */ if ( vp_Index >= s_VolDataBaseStruct.v_NbrVolMounted ) return ( NIL ); /* Else return value corresponding to index */ return ( pl_VolumePtr[vp_Index] );}#endif /* FSS_FTR */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -