Functions
sbgInterfaceFile.c File Reference
#include "sbgInterfaceFile.h"
Include dependency graph for sbgInterfaceFile.c:

Go to the source code of this file.

Functions

SbgErrorCode sbgInterfaceFileClose (SbgInterface *pHandle)
 
size_t sbgInterfaceFileGetCursor (const SbgInterface *pHandle)
 
size_t sbgInterfaceFileGetSize (SbgInterface *pHandle)
 
SbgErrorCode sbgInterfaceFileOpen (SbgInterface *pHandle, const char *filePath)
 
SbgErrorCode sbgInterfaceFileRead (SbgInterface *pHandle, void *pBuffer, size_t *pReadBytes, size_t bytesToRead)
 
SbgErrorCode sbgInterfaceFileReadFake (SbgInterface *pHandle, void *pBuffer, size_t *pReadBytes, size_t bytesToRead)
 
SbgErrorCode sbgInterfaceFileWrite (SbgInterface *pHandle, const void *pBuffer, size_t bytesToWrite)
 
SbgErrorCode sbgInterfaceFileWriteFake (SbgInterface *pHandle, const void *pBuffer, size_t bytesToWrite)
 
SbgErrorCode sbgInterfaceFileWriteOpen (SbgInterface *pHandle, const char *filePath)
 

Function Documentation

SbgErrorCode sbgInterfaceFileClose ( SbgInterface pHandle)

Destroy an interface initialized using sbgInterfaceFileOpen.

Parameters
[in]pInterfaceValid handle on an initialized interface.
Returns
SBG_NO_ERROR if the interface has been closed and released.

Definition at line 113 of file sbgInterfaceFile.c.

size_t sbgInterfaceFileGetCursor ( const SbgInterface pHandle)

Returns the current cursor position in the file in bytes.

Parameters
[in]pInterfaceValid handle on an initialized interface.
Returns
The current cursor position in bytes.

Definition at line 187 of file sbgInterfaceFile.c.

size_t sbgInterfaceFileGetSize ( SbgInterface pHandle)

Returns the file size in bytes.

Parameters
[in]pInterfaceValid handle on an initialized interface.
Returns
The file size in bytes.

Definition at line 144 of file sbgInterfaceFile.c.

SbgErrorCode sbgInterfaceFileOpen ( SbgInterface pHandle,
const char *  filePath 
)

Open a file as an interface for read only operations.

Parameters
[in]pHandlePointer on an allocated interface instance to initialize.
[in]filePathFile path to open.
Returns
SBG_NO_ERROR if the interface has been created.

Definition at line 17 of file sbgInterfaceFile.c.

SbgErrorCode sbgInterfaceFileRead ( SbgInterface pHandle,
void *  pBuffer,
size_t *  pReadBytes,
size_t  bytesToRead 
)

Try to read some data from an interface.

Parameters
[in]pHandleValid handle on an initialized interface.
[in]pBufferPointer on an allocated buffer that can hold at least bytesToRead bytes of data.
[out]pReadBytesPointer on an uint32 used to return the number of read bytes.
[in]bytesToReadNumber of bytes we would like to read.
Returns
SBG_NO_ERROR if no error occurs, please check the number of received bytes.

Definition at line 270 of file sbgInterfaceFile.c.

SbgErrorCode sbgInterfaceFileReadFake ( SbgInterface pHandle,
void *  pBuffer,
size_t *  pReadBytes,
size_t  bytesToRead 
)

Fake read function for write only interfaces

Parameters
[in]pHandleValid handle on an initialized interface.
[in]pBufferPointer on an allocated buffer that can hold at least bytesToRead bytes of data.
[out]pReadBytesPointer on an uint32 used to return the number of read bytes.
[in]bytesToReadNumber of bytes we would like to read.
Returns
SBG_NO_ERROR if no error occurs, please check the number of received bytes.

Definition at line 322 of file sbgInterfaceFile.c.

SbgErrorCode sbgInterfaceFileWrite ( SbgInterface pHandle,
const void *  pBuffer,
size_t  bytesToWrite 
)

Try to write some data to an interface.

Parameters
[in]pHandleValid handle on an initialized interface.
[in]pBufferPointer on an allocated buffer that contains the data to write
[in]bytesToWriteNumber of bytes we would like to write.
Returns
SBG_NO_ERROR if all bytes have been written successfully.

Definition at line 227 of file sbgInterfaceFile.c.

SbgErrorCode sbgInterfaceFileWriteFake ( SbgInterface pHandle,
const void *  pBuffer,
size_t  bytesToWrite 
)

Fake write function for read only interfaces

Parameters
[in]pHandleValid handle on an initialized interface.
[in]pBufferPointer on an allocated buffer that contains the data to write
[in]bytesToWriteNumber of bytes we would like to write.
Returns
SBG_NO_ERROR if all bytes have been written successfully.

Definition at line 302 of file sbgInterfaceFile.c.

SbgErrorCode sbgInterfaceFileWriteOpen ( SbgInterface pHandle,
const char *  filePath 
)

Open a file as an interface for write only operations.

Parameters
[in]pHandlePointer on an allocated interface instance to initialize.
[in]filePathFile path to open.
Returns
SBG_NO_ERROR if the interface has been created.

Definition at line 68 of file sbgInterfaceFile.c.



sbg_driver
Author(s):
autogenerated on Sun Jan 27 2019 03:42:20