next up previous contents
Next: Data Segments Up: Function calls and their Previous: Keywords   Contents

Links

int status = drms_setlink(DRMS_Record_t *record, char *linkname, int index)

Set the link named linkname in the data record associated with record to point to a given record in the target series. The target series is defined in the global series definition of the series to which record belongs. If the link type is static, index should contain a unique record number in the target series. If the link type is dynamic, index should contain a primary index value in the target series.

If status=0 the call succeeded. If status=-1 the call failed because there is no link named linkname in record. [What to do if index refers to a record in the target series that does not (yet) exist? Should this be checked at runtime by querying the database?]

int status = drms_getlink(DRMS_Record_t *record, char *linkname, char **target_series, int *index)

Return the target series and index of a link. If a link with the name in linkname exists status=0 is returned indicating success. Otherwise status=-1 is returned.

DRMS_Record_t *record = drms_followlink(DRMS_Record_t *record, char *linkname, int *status)

Return a record containing the target record pointed to by the link named linkname in record. A dynamic link will be resolved to the record with the highest record number among those with primary index equal to the one in the link.

If no such target record exists or there is no link named linkname a NULL pointer is returned. If status is not NULL it is set to 0 for ``success'', -1 for ``no such target record'', and -2 for ``no such link''.

DRMS_Record_t **record = drms_followlink_allversions(DRMS_Record_t *record, char *linkname, int *num_versions, int *status)

Works like drms_followlink, except that if the link is a dynamic link an array is returned of all record with primary index equal to the one in the link. The number of matching records is returned in *num_records.


next up previous contents
Next: Data Segments Up: Function calls and their Previous: Keywords   Contents
Philip Scherrer 2006-06-17