FSFile_BufAssign()
void FSFile_BufAssign (FS_FILE *p_file, void *p_buf, FS_FLAGS mode, CPU_SIZE_T size, FS_ERR *p_err);
File | Called from | Code enabled by |
---|---|---|
| Application; |
|
Assign buffer to a file.
See fs_setvbuf()
for more information.
Arguments
p_file
Pointer to a file.
p_buf
Pointer to buffer.
mode
Buffer mode:
FS_FILE_BUF_MODE_RD
Data buffered for reads.
FS_FILE_BUF_MODE_WR
Data buffered for writes.
FS_FILE_BUF_MODE_RD_WR
Data buffered for reads and writes.
FS_FILE_BUF_MODE_SEC_ALIGNED
Force buffers to be aligned on sector boundaries.
size
Size of buffer, in octets.
p_err
Pointer to variable that will receive the return error code from this function:
FS_ERR_NONE
File buffer assigned.
FS_ERR_NULL_PTR
Argument p_file
or p_buf
passed a NULL pointer.
FS_ERR_INVALID_TYPE
Argument p_file
's type is invalid or unknown.
FS_ERR_FILE_INVALID_BUF_MODE
Invalid buffer mode.
FS_ERR_FILE_INVALID_BUF_SIZE
Invalid buffer size.
FS_ERR_FILE_BUF_ALREADY_ASSIGNED
Buffer already assigned.
FS_ERR_FILE_NOT_OPEN
File not open.
Returned Value
None.
Notes/Warnings
None.