Exemplo n.º 1
0
long FileTell(FILE_HANDLE fh)
{
    #if defined STACK_USE_MPFS2
        return MPFSGetPosition(fh);
    #elif defined STACK_USE_MDD 
        return FSftell(fh);
    #endif
}
Exemplo n.º 2
0
/*****************************************************************************
  Function:
    bool MPFS_EOF( uintptr_t handle )

  Description:
    Returns if the present file pointer already reached end of file?

  Precondition:
    None

  Parameters:
    handle - a valie handle to the file

  Returns:
    End of file     - true
    Not end of file - false
*/
bool MPFS_EOF( uintptr_t handle )
{
    MPFS_HANDLE hMPFS = ((MPFS_HANDLE )handle);
    volatile unsigned long len, position;

    len = MPFSGetSize ( hMPFS );
    position = MPFSGetPosition ( hMPFS );

    if(position == len)
        return 1;
    else
        return 0;
//    return (position == len ? 1 : 0);
}
Exemplo n.º 3
0
/*****************************************************************************
  Function:
    uint32_t MPFS_GetPosition ( uintptr_t handle)

  Description:
    Obtains the present file pointer position

  Precondition:
    None

  Parameters:
    handle - a valie handle to the file

  Returns:
    The present file pointer.
*/
uint32_t MPFS_GetPosition ( uintptr_t handle)
{
    MPFS_HANDLE hMPFS = ((MPFS_HANDLE )handle);

    return (MPFSGetPosition ( hMPFS ));
}