Skip to main content

PVK_read( ): Read a Record from a File

Format

int PVK_read(int fh, char *dtabfr, int dtasz, int function);

Where:

fh

File handle returned from a prior call to PVK_OpenExt( )

dtabfr

Pointer to the data buffer to receive the record data

dtasz

Size (in bytes) of the data buffer

function

Type of read to be performed. Values are:

PVKRD_CUR

Returns current

PVKRD_NEXT

Returns next

PVKRD_PRIOR

Returns prior

PVKRD_LOCK

OR'ed into function to lock the record

PVKRD_UNLOCK

OR'ed into function to unlock all records

Description

PVK_read( ) is used to read a record from a PxPlus Keyed, Indexed or EFF file. The return value will contain the length of the record in bytes or -1 if an error occurred. A return value of -2 indicates that the supplied buffer was not large enough to store the entire data record.

A record may be locked or extracted by specifying PVKRD_LOCK in conjunction with the appropriate function (e.g. PVKRD_NEXT | PVKRD_LOCK).