DlpReadRecordIDList(3)

NAME
DlpReadRecordIDList - read list of record IDs from a Palm database

LIBRARY
libpconn

SYNOPSIS
#include <palm.h>
#include <pconn/pconn.h>
int
DlpReadRecordIDList(PConnection *pconn, const ubyte handle, const ubyte flags, const uword start, const uword max, uword *numread, udword recids[]);

DESCRIPTION
DlpReadRecordIDList reads a list of record IDs found in a database.

handle is the database handle given by DlpOpenDB.

flags specifies flags. The only flag defined so far is DLPCMD_RRIDFLAG_SORT, which says to sort the database before returning the list of record IDs.

start specifies the index of the first record to read. Use 0 to start reading at the beginning.

max specifies the maximum number of record IDs to return. The special value DLPC_RRECIDL_TOEND says to return as many entries as possible. You may find it useful to call DlpReadOpenDBInfo() to find out how many records there are in the database.

numread is filled in with the number of entries actually read.

recids is filled in with record IDs.

RETURN VALUE
DlpReadRecordIDList returns 0 if successful, or a negative value otherwise.

SEE ALSO
libpconn(3), DlpOpenDB(3), DlpReadOpenDBInfo(3).

NOTES
The Palm may not return as many entries as you want. In the author's experience, the maximum number of entries returned at one time is around 500. To read all of the records, you might need to call DlpReadRecordIDList inside a loop, e.g.:

    uword numrecs;		// # of records in database
    uword ihave;		// # of record IDs read so far
    udword recids[FOO];	// Array of record IDs
    ihave = 0;
    while (ihave < numrecs)
    {
    	uword num_read;		// # record IDs read this time around
    	DlpReadRecordIDList(pconn, dbh, 0,
    			    ihave,
    			    numrecs - ihave,
    			    &num_read,
    			    recids + ihave);
    	ihave += num_read;
    }