A structure containing callback functions to create BLOBs from named entities. More...
#include "swblobfactory.h"
Data Fields | |
sw_api_info | info |
Version number, name, display name, instance size. More... | |
sw_blob_result(* | open_named )(sw_blob_factory_instance *instance, uint8 *name, size_t name_len, int mode, sw_blob_instance **blob) |
Create a new blob data source based upon a named entity. More... | |
A structure containing callback functions to create BLOBs from named entities.
The RIP will provide the module with these callbacks to create BLOB objects based on named entities. The callbacks will be presented in the form of factory instances, which are subclassed by the RIP to encapsulate parameters for named blob providers.
sw_api_info sw_blob_factory_api::info |
Version number, name, display name, instance size.
This is REQUIRED to be the first field.
sw_blob_result( * sw_blob_factory_api::open_named) ( sw_blob_factory_instance *instance, uint8 *name, size_t name_len, int mode, sw_blob_instance **blob) |
Create a new blob data source based upon a named entity.
This method allows modules to request the RIP to provide a data blob from a location named by the module. This is method is typically connected to an implementation that opens named files on the RIP's filesystem.
[in] | instance | The sw_blob_factory_instance pointer provided by the RIP. |
[in] | name | The name to use to open a blob. The semantics of the name depend on the implementation. For the file system access implementation, the name must be an absolute device name, a device name and file name, or just a file name. |
[in] | name_len | The length of the name. |
[in] | mode | An access mode composed of one of SW_RDWR, SW_WRONLY, or SW_RDONLY, possibly combined with the flags SW_EXCL and SW_FONT defined in swdevice.h. |
[out] | blob | On a successful exit, an open blob reference is stored here. |
SW_BLOB_OK | Returned if the blob was opened, in which case the blob parameter is updated with a reference to the blob. The blob's sw_blob_api::close() call MUST be called when the module no longer needs the blob to allow the RIP to deallocate the resources used by the blob. |
SW_BLOB_ERROR_MEMORY | Returned if the RIP cannot allocate a blob instance. |
SW_BLOB_ERROR_INVALID | Returned if any of the parameters are invalid (e.g., the name, implementation or return pointer are NULL, or the filename is too long). |
SW_BLOB_ERROR_ACCESS | Returned if the access mode is not supported. |