PMPlib export functions for a driver module
[PMPlib APIs]

This API defines the interface that a driver module must implement. More...

Typedefs

typedef void(*) pmplib_enumerate_devid_callback_t (void *instance, const char *devid)
 Prototype of a callback function receiving device IDs from pmplib_create().
typedef result_t(*) pmplib_create_t (pmp_t **ptr_pmp, const ucs2char_t *path_to_device, const char *id)
 Query a driver and construct a pmp_t instance.
typedef result_t(*) pmplib_enumerate_devid_t (pmplib_enumerate_devid_callback_t callback, void *instance)
 Enumerate device identifiers supported by the driver module.

Detailed Description

This API defines the interface that a driver module must implement.


Typedef Documentation

typedef result_t(*) pmplib_create_t(pmp_t **ptr_pmp, const ucs2char_t *path_to_device, const char *id)

Query a driver and construct a pmp_t instance.

This function queries the driver suitable for the portable media device specified by the mount location and/or identifier. A driver module must return the interface to the driver (pmp_t instance) if it supports the device. Parameter path_to_device is expected to be specified. If parameter id is not NULL, the driver module should return the interface to the driver with the device identifier specified in id parameter. If the parameter id is NULL, the driver module should recognize the model of the device based on the content of the files located under path_to_device.

Parameters:
path_to_device A UCS-2 string representing the location of the target device. This parameter cannot be NULL.
id A C-string representing the device identifier of the target device. If this argument is NULL, this function tries to recognize the model of the device based on the location (path_to_device).
Return values:
ptr_pmp The pointer to the buffer to receive the pointer to the driver interface (pmp_t instance).
result_t The status code.
Assertions:
 ptr_pmp != NULL 
 path_to_device != NULL 

Definition at line 789 of file pmp.h.

typedef void(*) pmplib_enumerate_devid_callback_t(void *instance, const char *devid)

Prototype of a callback function receiving device IDs from pmplib_create().

Parameters:
instance The user-defined instance value.
devid The device identifier.

Definition at line 760 of file pmp.h.

Enumerate device identifiers supported by the driver module.

The driver module should enumerate the device identifiers supported by the module and invoke the callback function for each identifier.

Parameters:
callback The pointer to the callback function to receive device identifiers.
instance A user-defined instance value. The callback function will receive the same value.
Return values:
result_t The status code.
Assertions:
 callback != NULL 

Definition at line 806 of file pmp.h.