Records

A record object is a retrival record on the client side - created from result sets.


     void Z3950_resultset_records (Z3950_resultset r,
                                   Z3950_record *recs,
			           size_t start, size_t count);
     Z3950_record Z3950_resultset_record (Z3950_resultset s, size_t pos);

     void *Z3950_record_get (Z3950_record rec, const char *type,
                             size_t *len);

     void Z3950_record_destroy (Z3950_record rec);
   

Records are created by functions Z3950_resultset_records or Z3950_resultset_record and destroyed by Z3950_record_destroy.

A single record is created and returned by function Z3950_resultset_record that takes a position as argument. First record has position zero. If no record could be obtained NULL is returned.

Function Z3950_resultset_records retrieves a number of records from a result set. Parameter start and count specifies the range of records to be returned. Upon completion array recs[0], ..recs[count-1] holds record objects for the records. The array of records recs should be allocate prior to calling Z3950_resultset_records. Note that for those records that couldn't be retrieved from the target recs[ ..] is set to NULL.

In order to extract information about a single record, Z3950_record_get is provided. The function returns a pointer to certain record information. The nature (type) of the pointer depends on the type given. In addition for certain types, the length len passed will be set to the size in bytes of the returned information.

database

The database that holds the record is returned as a C string. Return type char *.

syntax

The transfer syntax (OID) of the record is returned as a C string. Return type char *.

render

The record is returned in a display friendly format. Upon completion buffer is returned (type char *) and length is stored in *len.

raw

The record is returned in the internal YAZ specific format. The raw data is returned as type Z_External * is just the type for the member retrievalRecord in type NamePlusRecord.

Protocol behavior

The functions Z3950_resultset_record and Z3950_resultset_records inspects the client-side record cache. If the records(s) were not found, i.e. not yet retrieved from, they are fetched using Present Requests.