Operations table for the low-level OSAL file abstraction. More...
#include <osal_file_ops.h>
Data Fields | |
| osal_file_status_t(* | open )(OSAL_FILE **out, const char *pathname, const char *mode, const osal_mem_ops_t *mem_ops) |
| Open a file resource. | |
| size_t(* | read )(void *ptr, size_t size, size_t nmemb, OSAL_FILE *stream, osal_file_status_t *st) |
Read elements from an open OSAL_FILE. | |
| size_t(* | write )(const void *ptr, size_t size, size_t nmemb, OSAL_FILE *stream, osal_file_status_t *st) |
Write elements to an open OSAL_FILE. | |
| osal_file_status_t(* | flush )(OSAL_FILE *stream) |
Flush buffered output associated with an open OSAL_FILE. | |
| osal_file_status_t(* | close )(OSAL_FILE *stream) |
Close an open OSAL_FILE and release its associated resource. | |
This API defines the low-level file operations exposed by the osal_file module.
It provides a portable file-oriented operations table for the active platform, while keeping higher-level adapter concerns outside of the OSAL.
Low-level file operations for the active OSAL backend.
This structure groups the primitive operations used to acquire, access, flush, and release OSAL_FILE resources through the OS abstraction layer.
These operations are intentionally file-oriented. They do not define a higher-level byte-stream port contract.
Definition at line 54 of file osal_file_ops.h.
| osal_file_status_t(* osal_file_ops::close) (OSAL_FILE *stream) |
| stream | Open OSAL_FILE handle to close. |
OSAL_FILE_STATUS_OK on success, or an error status on failure. Definition at line 167 of file osal_file_ops.h.
| osal_file_status_t(* osal_file_ops::flush) (OSAL_FILE *stream) |
| stream | Open OSAL_FILE handle. |
OSAL_FILE_STATUS_OK on success, or an error status on failure. Definition at line 156 of file osal_file_ops.h.
| osal_file_status_t(* osal_file_ops::open) (OSAL_FILE **out, const char *pathname, const char *mode, const osal_mem_ops_t *mem_ops) |
| [out] | out | Receives the acquired OSAL_FILE handle on success. |
| pathname | Path of the file to open, expressed as a project-level UTF-8 path string. Platform-specific conversion is performed by the active OSAL backend. | |
| mode | File access mode string. Only mode values supported by the portable osal_file contract are valid. | |
| mem_ops | Memory operations table used to allocate and release the OSAL file handle. |
OSAL_FILE_STATUS_OK on success, or an error status on failure.osal_file_ops_t::close. Definition at line 81 of file osal_file_ops.h.
| size_t(* osal_file_ops::read) (void *ptr, size_t size, size_t nmemb, OSAL_FILE *stream, osal_file_status_t *st) |
| ptr | Destination buffer. | |
| size | Size in bytes of each element. | |
| nmemb | Number of elements to read. | |
| stream | Open OSAL_FILE handle. | |
| [out] | st | Receives the operation status. |
nmemb does not by itself distinguish between end-of-file and failure; callers must inspect st. Definition at line 112 of file osal_file_ops.h.
| size_t(* osal_file_ops::write) (const void *ptr, size_t size, size_t nmemb, OSAL_FILE *stream, osal_file_status_t *st) |
| ptr | Source buffer. | |
| size | Size in bytes of each element. | |
| nmemb | Number of elements to write. | |
| stream | Open OSAL_FILE handle. | |
| [out] | st | Receives the operation status. |
Definition at line 140 of file osal_file_ops.h.