VLScpdReadNextRecord
Syntax
int VLScpdReadNextRecord(	 	 
int	 	iIsFirstInvocation,
int	 	iPersistType,
char	 	*pcCpdKeyOut,
int	 	iSzKey,
char	 	*pcCpdValueOut,
int	 	iSzValue,
char	 	*pcErrorInfoOut);| Argument | Direction | Data Type | Description | 
|---|---|---|---|
| iIsFirstInvocation | IN | int | When this API is called for the first time, the value of this parameter is specified as 1. It returns the first record for a specific persistence type. All subsequent calls use 0 as the value for this parameter. | 
| iPersistType | IN | int | Type of persistence device. Refer to Persistence Types section for more information. | 
| pcCpdKeyOut | OUT | char* | The persistence data is stored in key value pairs. This parameter stores the key. | 
| iSzKey | IN | int | Length of the key. | 
| pcCpdValueOut | OUT | char* | The persistence data is stored in key value pairs. This parameter stores the value. | 
| iSzValue | IN | int | Length of the value data. | 
| pcErrorInfoOut | OUT | char* | 
Description
This API reads all the records from a custom persistence device object using the iPersistType parameter (instead of identifying the records with key).
>When Sentinel RMS calls this API for the first time, the value of iIsFirstInvocation parameter is passed as 1 to indicate the beginning of read process for all records of a particular persistence type. Developers need to track the first record of a particular persistence type and return the record back to Sentinel RMS.
>Subsequent API calls will pass 0 as the value for iIsFirstInvocation parameter to indicate that the implementation should return the next available record of a particular persistence type until all existing records have been read.
>After reading all available records, the callback implementation should return the error VLS_CPD_NO_MORE_RECORD to Sentinel RMS. This error indicates that all available records of a particular persistence type have been read.
The developer’s implementation should handle the error scenario related to the VLS_CPD_NO_MORE_RECORD error.
Returns
This status code VLS_CPD_SUCCESS is returned if successful. Otherwise, it will return one of the following errors codes:
| Error Code | Description | 
|---|---|
| VLS_CPD_BAD_INPUT | Arguments are not defined as per the specification of this API. | 
| VLS_CPD_DEVICE_NO_PERM | Insufficient permissions. | 
| VLS_CPD_NO_MORE_RECORD_FOUND | All records for the selected persistence type have been read. | 
| VLS_CPD_DEVICE_FATAL_ERROR | Read/write failure or any other error. | 
