Private factory constructor callback for the fs_stream adapter.
More...
#include "stream/borrowers/stream_types.h"
Go to the source code of this file.
Functions | |
| stream_status_t | fs_stream_ctor (const void *ud, const void *args, stream_t **out) |
Factory constructor callback for the fs_stream adapter. | |
This constructor is stored in the adapter descriptor created by fs_stream_create_desc() and later invoked by the stream port factory when creating a file-backed stream instance.
Definition in file fs_stream_ctor.h.
| stream_status_t fs_stream_ctor | ( | const void * | ud, |
| const void * | args, | ||
| stream_t ** | out | ||
| ) |
This function implements the stream_ctor_fn_t contract expected by the stream port factory.
The opaque user-data pointer ud is expected to reference a fs_stream_ctor_ud_t structure containing the configuration and environment required to construct the stream instance.
The args parameter is the runtime argument blob supplied by the factory when creating a stream instance. It is expected to point to a const fs_stream_args_t * describing the file to open.
| [in] | ud | Opaque user data stored in the adapter descriptor. |
Expected type:
const fs_stream_ctor_ud_t *| [in] | args | Runtime argument blob supplied by the factory. |
Expected type:
const fs_stream_args_t *| [out] | out | Receives the created stream handle. |
STREAM_STATUS_OK on successSTREAM_STATUS_INVALID if one or more arguments are invalidSTREAM_STATUS_OOM on allocation failureSTREAM_STATUS_IO_ERROR if the underlying OSAL file operation fails*out receives a newly created stream instance owned by the caller.On failure, *out is left unchanged.
Definition at line 233 of file fs_stream.c.